xzw 3 years ago
parent
commit
10008254f6
2 changed files with 84 additions and 29 deletions
  1. 55 17
      public/SuperTwo/js/Hot.js
  2. 29 12
      public/SuperTwo/js/main_2020_show.js

+ 55 - 17
public/SuperTwo/js/Hot.js

@@ -25,13 +25,9 @@ window.initHot = function(model){
     var originPhotoCount = photoLoaded = originModelCount = modelLoaded = 0;
     
     var defaultTex1 = Texture.load(g_HotImage.point);
-    var defaultTex2 = Texture.load(g_HotImage.point2)    
+    var defaultTex2 = Texture.load(g_HotImage.point2)  
+    var defaultTex3 = Texture.load('images/4dagePoint_shixin.png') 
     
-    /* var _boxMat = new THREE.MeshBasicMaterial({ 
-        color: "#eeeeee",
-        transparent: !0,
-        opacity: 0.8
-    }) */
     var _boxMat = new THREE.MeshPhongMaterial({ 
         color: "#eeeeee",
         transparent: !0,
@@ -407,16 +403,24 @@ window.initHot = function(model){
                 this.material_.color.set("#FFFFFF");
                 this.material_.opacity = 1
                 this.material_.needsUpdate = true
-            }
-             
-            
-            
-            
+            } 
             
         } 
-
         
-        changeShineTex(styleImg){ 
+        
+        changeHighlightState(state){//add
+            if(this.texType == 'shine'){
+                this.changeShineTex(null, state) 
+                if(state){
+                    this.titleElem.addClass('hotactive');
+                }else{
+                    this.titleElem.removeClass('hotactive');
+                }
+                
+            }
+        }
+        
+        changeShineTex(styleImg, isHighlight){ 
             
             styleImg = styleImg || this.styleImg
             var tex1, tex2
@@ -425,8 +429,12 @@ window.initHot = function(model){
                 tex2 = Texture.load(styleImg[1]&&styleImg[1].src || styleImg[0].src); 
                 
             }else{
-                tex1 = defaultTex1;
-                tex2 = defaultTex2; 
+                tex1 = defaultTex1; 
+                if(isHighlight){
+                    tex2 = defaultTex3; 
+                }else{
+                    tex2 = defaultTex2; 
+                }
             } 
             this.changeMaterial(getShineMat(tex1, tex2)) 
             this.styleImg = styleImg
@@ -1007,8 +1015,38 @@ window.initHot = function(model){
             }
         } 
         
+        updateTitle(){
+            if(!this.titleElem)return;
+            
+            var unvisi = ()=>{
+                this.titleElem.css("display","none");
+            }
+            var visi = ()=>{
+                var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
+                if(pos.trueSide){//inSight
+                    this.titleElem.css( { "left" : `${pos.pos.x}px`,  "top": `${pos.pos.y}px ` });
+                    this.titleElem.css("display","block");
+                }else{
+                    unvisi()
+                }
+            }
+            if(this.mesh.visible){
+                if(player.mode == 'panorama'){
+                    visi()
+                }else{
+                    var ifShelter = convertTool.ifShelter(this.position)
+                    if(ifShelter)unvisi()
+                    else visi() 
+                }
+            }else{
+                unvisi()
+            }                
+                           
+        }
         
-        showTitle(){
+        
+        
+        /* showTitle(){
             if(!this.titleElem)return;
             var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
             if(pos.trueSide){//inSight
@@ -1022,7 +1060,7 @@ window.initHot = function(model){
         hideTitle(){
             if(!this.titleElem)return;
             this.titleElem.css("display","none");
-        }
+        } */
         
         
        

+ 29 - 12
public/SuperTwo/js/main_2020_show.js

@@ -8171,14 +8171,19 @@ window.Modernizr = function(n, e, t) {
         }
         function s(e, t) {
             setTimeout(function() {
+                // h.isHelpEnabled()
                 if (h.isHelpEnabled()) {
-                    if (t(),
+                    t(),
                     u.init(),
-                    C.addClass("fadeIn landing " + u.deviceType),
-                    h.isSmallHelpEnabled())
-                        return void C.addClass("small");
-                    u.fill(I, d.LANDING[E]),
-                    C.addClass(E)
+                    $('.isHelp').fadeIn();
+
+                    $('.isHelp').click(()=>{
+                        $('.isHelp').fadeOut()
+                    })
+
+                    setTimeout(function() {
+                        $('.isHelp').fadeOut()
+                    }, 8000)
                 }
             }, e)
             //csz 用户引导界面
@@ -14854,6 +14859,15 @@ window.Modernizr = function(n, e, t) {
 							de.warn("Total load time: " + e / 1e3),
 							H.loadComplete(e),
 							de.warn("First render after model load finished.")
+
+                            try{ 
+                                window.parent.postMessage({
+                                    source: "loadComplete",
+                                    data: true,
+                                },'*') 
+                            }catch(e){
+                                console.log(e)
+                            }
 						}),
 						S.on(le.MemoryUsageUpdated, n)
 					}).fail(b.bind(this, e))
@@ -22830,15 +22844,15 @@ window.Modernizr = function(n, e, t) {
                         this.lastChangeTime = Date.now(),
                         !this.mouseDown && this.containsMouse && this.updateIntersect(),
                         this.emit(w.ViewChanged),
-                        
-                        this.intersectHot && this.intersectHot.showTitle() 
-                        
+                         
                         this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
 
                     }
 
                     if(e.cameraChanged){
-                         
+                        for(var i in this.model.hots){
+                            this.model.hots[i].updateTitle()
+                        } 
                        
                     }
                     if(e.cameraChanged2){ //变化要更大些
@@ -23113,7 +23127,9 @@ window.Modernizr = function(n, e, t) {
                   , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
                 
                 {//clear:
-                    if(this.intersectHot) this.intersectHot.hideTitle()
+                    if(this.intersectHot) { 
+                        this.intersectHot.changeHighlightState(false)
+                    }
                     this.intersectHot = null
                     $("#player").css("cursor", "")
                 }
@@ -23126,7 +23142,8 @@ window.Modernizr = function(n, e, t) {
                                 this.intersectHot = this.intersectHot.parent
                             } 
                             $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active") 
-                            this.intersectHot.showTitle()  
+                            
+                            this.intersectHot.changeHighlightState(true)                            
                         }  
                     } 
                 }