Selaa lähdekoodia

tourInterlude 改bug, 注意,音乐只在外层有

xzw 3 vuotta sitten
vanhempi
commit
37fc29d3ef
2 muutettua tiedostoa jossa 13 lisäystä ja 11 poistoa
  1. 7 5
      js/main_2020_edit.js
  2. 6 6
      js/main_2020_show.js

+ 7 - 5
js/main_2020_edit.js

@@ -4665,7 +4665,7 @@ function o(a, s, l) {
             ,
             t.prototype.goToDestination = function(e, t, i, n) { 
                 //音频
-                var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
+                var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo //只有外层有音乐
                 if(musicInfo && musicInfo.music){
                     let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music :  g_Prefix + musicInfo.music;
                     let audioObj = SoundManager.list.find(e=>e.name == 'tour')
@@ -22379,15 +22379,17 @@ function o(a, s, l) {
                 var defaultRotTime = DATA.tourRotTime * 1000
                 var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
                  
+                 
                 var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
+                var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]] 
                 var rotTime
                 if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
-                    var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
-                    var hasMusic = currentLocation.musicInfo && currentLocation.musicInfo.music
+                    var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
+                    var hasMusic = currentLocation0.musicInfo && currentLocation0.musicInfo.music
                     if(hasMusic){
                         var audioObj = SoundManager.list.find(e=>e.name == 'tour') 
                         var current = audioObj.audio.currentTime * 1e3 // || 0  //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
-                        rotTime = currentLocation.musicInfo.time - current
+                        rotTime = currentLocation0.musicInfo.time - current
                         if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
                             rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);   
                         }  
@@ -22395,7 +22397,7 @@ function o(a, s, l) {
                         rotTime = defaultRotTime
                     } 
                     rotTime = Math.max(0, rotTime)
-                    console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : '')) 
+                    console.log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : '')) 
                 }else{
                     rotTime = currentLocation.rotTime * 1000
                     console.log("rotTime "+rotTime +" at item "+this.director.currentItem) 

+ 6 - 6
js/main_2020_show.js

@@ -23606,17 +23606,17 @@ window.Modernizr = function(n, e, t) {
                 var defaultRotTime = DATA.tourRotTime * 1000
                 var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
                  
-                //var currentLocation = this.model.heroLocations[this.director.currentItem[0]] 
+                 
                 var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
-                
+                var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]] 
                 var rotTime
                 if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
-                    var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
-                    var hasMusic = currentLocation && currentLocation.musicInfo.music
+                    var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
+                    var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
                     if(hasMusic){
                         var audioObj = SoundManager.list.find(e=>e.name == 'tour') 
                         var current = audioObj.audio.currentTime * 1e3 // || 0  //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
-                        rotTime = currentLocation.musicInfo.time - current
+                        rotTime = currentLocation0.musicInfo.time - current
                         if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
                             rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);   
                         }  
@@ -23624,7 +23624,7 @@ window.Modernizr = function(n, e, t) {
                         rotTime = defaultRotTime
                     } 
                     rotTime = Math.max(0, rotTime)
-                    Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : ''),"#E8E") 
+                    Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E") 
                 }else{
                     rotTime = currentLocation.rotTime * 1000
                     Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")