|
|
@@ -4140,7 +4140,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
, i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
|
|
|
this.pinchDistance = Math.sqrt(t * t + i * i)
|
|
|
}
|
|
|
- settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
|
|
|
+ //settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
|
|
|
this.emit(u.InputStart, "touch")
|
|
|
}
|
|
|
}
|
|
|
@@ -4164,7 +4164,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
case c.LEFT:
|
|
|
this.startRotationFrom(e.clientX, e.clientY)
|
|
|
}
|
|
|
- settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
|
|
|
+ //settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
|
|
|
this.emit(u.InputStart, "mouse")
|
|
|
}
|
|
|
}
|
|
|
@@ -4568,6 +4568,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
|
|
|
+ return //xzw add 拖拽不停止
|
|
|
+
|
|
|
return /* e === u.WALK && ( */this.interrupt(g.NONE),
|
|
|
this.pauseWalkingSection(),
|
|
|
this.player.fastForwardActivePanoFlight(),
|
|
|
@@ -4575,6 +4577,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.handlePlayerMove = function(e) {
|
|
|
+ return //xzw add 拖拽不停止
|
|
|
this.transitionStage === y.Interlude && this.interrupt(g.NONE),
|
|
|
this.emit("update.controls")
|
|
|
}
|
|
|
@@ -4590,6 +4593,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.handlePlayerInputStart = function(e) {
|
|
|
+ return //xzw add 拖拽不停止
|
|
|
this.transitionStage === y.Interlude && this.interrupt(g.NONE)
|
|
|
}
|
|
|
,
|
|
|
@@ -4916,7 +4920,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
var dis = pano.position.distanceTo(this.player.currentPano.position)
|
|
|
|
|
|
if(dis<result.dis){
|
|
|
- result.item = item, result.dis = dis, result.location = location
|
|
|
+ result.item = item, result.dis = dis, result.location = location, result.angle = null
|
|
|
}else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
|
|
|
|
|
|
|
|
|
@@ -5118,9 +5122,40 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.emit(p.TourEnd)
|
|
|
}
|
|
|
,
|
|
|
+
|
|
|
n.prototype.goToHighlight = function(e) {
|
|
|
- this.highlightItem = e //add
|
|
|
- if (this.wouldInterrupt()){
|
|
|
+ //if(player.isWarping() )return //add
|
|
|
+
|
|
|
+ //this.highlightItem = e //add
|
|
|
+
|
|
|
+ if(this.waitHighlight)return this.waitHighlight = e //继续等待
|
|
|
+ if(player.flying){
|
|
|
+ this.waitHighlight = e
|
|
|
+ return player.once("flying.ended",()=>{
|
|
|
+ let e = this.waitHighlight
|
|
|
+ this.waitHighlight = null
|
|
|
+ this.goToHighlight(e)
|
|
|
+ })
|
|
|
+ }else if(player.isWarping()){
|
|
|
+ this.waitHighlight = e
|
|
|
+ return this.once("warp.end",()=>{
|
|
|
+ setTimeout(()=>{
|
|
|
+ let e = this.waitHighlight
|
|
|
+ this.waitHighlight = null
|
|
|
+ this.goToHighlight(e)
|
|
|
+ },200)
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ /* return setTimeout(()=>{
|
|
|
+ this.once("warp.end",()=>{
|
|
|
+ this.goToHighlight(e)
|
|
|
+ })
|
|
|
+ },100) */
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /* if (this.wouldInterrupt()){
|
|
|
let soon
|
|
|
if(this.itemCompare(this.destinationItem,e,'equal') ){
|
|
|
this.interrupt()
|
|
|
@@ -5140,7 +5175,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
|
|
|
|
|
|
- }else {
|
|
|
+ }else { */
|
|
|
if (A.debug("<tour.goto " + e + ">"),
|
|
|
this.isInterrupted())
|
|
|
return;
|
|
|
@@ -5154,7 +5189,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.once('warp.end',()=>{
|
|
|
this.highlightItem = null //add
|
|
|
})
|
|
|
- }
|
|
|
+ //}
|
|
|
}
|
|
|
,
|
|
|
n.prototype.prevHighlight = function() {
|
|
|
@@ -20473,6 +20508,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.popInCpm = function() {
|
|
|
+ return //xzw add 否则点击导览item会在底下显示红色标记
|
|
|
c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
|
|
|
}
|
|
|
,
|
|
|
@@ -20608,7 +20644,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.warpDestPano
|
|
|
}
|
|
|
,
|
|
|
- n.prototype.brushToWarpPano = function(e, t) {
|
|
|
+ n.prototype.brushToWarpPano = function(e, t) {
|
|
|
if (this.discardPathObject(),
|
|
|
!this.setWarpDestPano())
|
|
|
return !1;
|
|
|
@@ -22066,7 +22102,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.updateModel()
|
|
|
|
|
|
this.guider2 = new PanTransGuide(this)
|
|
|
-
|
|
|
+ this.guider3 = new UserGuide(this)
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -24523,6 +24559,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.tourInterlude = function(e, t) {
|
|
|
+ return //xzw add
|
|
|
+
|
|
|
this.history.invalidate();
|
|
|
this.path.discardSlow();
|
|
|
//xzw:
|
|
|
@@ -59517,13 +59555,131 @@ window.tourPlayCtl = {
|
|
|
}else{
|
|
|
director.goPrev(director.currentItem)
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class UserGuide{
|
|
|
+ constructor(player){
|
|
|
+ let lastCurItem
|
|
|
+ this.player = player
|
|
|
+ this.pausedByBtn = true
|
|
|
|
|
|
+ SoundManager.list.find(e=>e.name == 'tour').audio.addEventListener('ended', ()=>{
|
|
|
+ player.director.tourIsPlaying && this.go(1) //下一个点
|
|
|
+ });
|
|
|
+ player.on("flying.ended",(a,b,pano,d)=>{
|
|
|
+ //更新导览进度条 导览片段的选中与当前点位所属片段对应。
|
|
|
+ player.director.setCurrentItem( player.director.findNearestItem(true,true) )
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ player.director.on("update.controls", ()=>{ //更新了currentItem的话
|
|
|
+ if(player.director.itemCompare(lastCurItem, player.director.currentItem,'equal' )) return
|
|
|
+ lastCurItem = player.director.currentItem?.slice()
|
|
|
+
|
|
|
+ if(!player.director.tourIsPlaying){
|
|
|
+ if(this.pausedByBtn) return
|
|
|
+ else this.play()
|
|
|
+ }
|
|
|
+ /* let folder = player.model.heroLocations[player.director.currentItem[0]]
|
|
|
+ let items = folder.heroLocations ? folder.heroLocations : [folder]
|
|
|
+ if(items.some(e=>e.panoId == player.currentPano.id)){ */
|
|
|
+ let curItem = player.model.getHeroDescriptorByIndex(player.director.currentItem)
|
|
|
+ if(player.currentPano.id == curItem.panoId){
|
|
|
+ this.setMusic()
|
|
|
+ }else{//走到了导览以外的区域
|
|
|
+ this.pause(false)//SoundManager.pause('tour')
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ player.director.playTourNearBy = this.play.bind(this)
|
|
|
+ player.director.stopTour = this.pause.bind(this)
|
|
|
+ }
|
|
|
+
|
|
|
+ play(){
|
|
|
+ //从当前index开始播放,如果在导览区域,就在当前点播音乐,如果不是就跳到当前导览区域第一个点
|
|
|
+ //假定导览都在漫游模式 //假设不同导览区域不存在相同漫游点
|
|
|
|
|
|
+ let curItem = player.model.getHeroDescriptorByIndex(player.director.currentItem || [0,0])
|
|
|
+ let playMusic = ()=>{
|
|
|
+ this.setMusic()
|
|
|
+ }
|
|
|
+ if(player.currentPano.id != curItem.panoId){
|
|
|
+ player.flyToPano({pano: player.model.panos.get(curItem.panoId), quaternion:curItem.quaternion},()=>{
|
|
|
+ playMusic()
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ playMusic()
|
|
|
+ }
|
|
|
+ player.director.tourInProgress = player.director.tourIsPlaying = true
|
|
|
+ player.director.emit("update.controls")
|
|
|
}
|
|
|
+ pause(byBtn=true){
|
|
|
+ SoundManager.pause('tour')
|
|
|
+ player.director.tourInProgress = player.director.tourIsPlaying = false
|
|
|
+ player.director.emit("update.controls")
|
|
|
+ this.pausedByBtn = byBtn
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ go(axis){
|
|
|
+ let length = player.model.heroLocations.length
|
|
|
+ let cur = player.director.currentItem
|
|
|
+ let next = [(cur[0]+axis) % length, 0]
|
|
|
+ let nextItem = player.model.getHeroDescriptorByIndex(next)
|
|
|
+
|
|
|
+ player.flyToPano({pano: player.model.panos.get(nextItem.panoId), quaternion:nextItem.quaternion},()=>{
|
|
|
+ this.setMusic()
|
|
|
+ })
|
|
|
+ Hot.closePopup();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ setMusic(){
|
|
|
+ var musicInfo = player.model.heroLocations[player.director.currentItem[0]].musicInfo
|
|
|
+
|
|
|
+ if(!settings.tourSoundUnable && musicInfo && musicInfo.music ){
|
|
|
+
|
|
|
+ let musicType = localStorage.getItem('xunirole') || 'male'
|
|
|
+
|
|
|
+ let isMale = musicType.indexOf('female') < 0
|
|
|
+
|
|
|
+ let fixMusic = isMale?musicInfo.music:(musicInfo.fmusic||musicInfo.music)
|
|
|
+ let src = fixMusic
|
|
|
+ let audioObj = SoundManager.list.find(e=>e.name == 'tour')
|
|
|
+ let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
|
|
|
+ let audioSrc2 = common.getFileNameFromUrl(src)
|
|
|
+
|
|
|
+ if(audioSrc1 == audioSrc2){//应该是继续播放该folder
|
|
|
+ /* if(player.director.currentItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
|
|
|
+ SoundManager.play('tour',null,0) // currentTime = 0;
|
|
|
+ }else*/ if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
|
|
|
+ SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
|
|
|
+ }
|
|
|
+ }else{//很可能是该folder的起始 */
|
|
|
+ SoundManager.play('tour', manage.dealURL(src))
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
- */
|
|
|
+
|
|
|
+
|
|
|
+window.tourPlayCtl = {
|
|
|
+ go(axis){
|
|
|
+ player.guider3.go(axis)
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
/*
|
|
|
warpTravel_BLACK =
|