mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-10-31 12:12:58 +08:00 
			
		
		
		
	fix: box拖动 & 漏怪显示
This commit is contained in:
		
							parent
							
								
									fef9950542
								
							
						
					
					
						commit
						3be0fe50ff
					
				
							
								
								
									
										2
									
								
								idea.md
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								idea.md
									
									
									
									
									
								
							| @ -67,7 +67,7 @@ dam4.png ---- 存档 59 | |||||||
| [] 宝物目标设定 | [] 宝物目标设定 | ||||||
| [] 每个怪物加一个怪物说明 | [] 每个怪物加一个怪物说明 | ||||||
| [] 歌词展示系统 | [] 歌词展示系统 | ||||||
| [] 小地图显示框,可以选择是否显示剩余怪物数量等 | [x] 小地图显示框,可以选择是否显示剩余怪物数量等 | ||||||
| [x] 怪物死亡特效 | [x] 怪物死亡特效 | ||||||
| [] 区域名称显示特效,3D 粒子特效 | [] 区域名称显示特效,3D 粒子特效 | ||||||
| [x] 单独的工具栏,可以自定义按键 | [x] 单独的工具栏,可以自定义按键 | ||||||
|  | |||||||
| @ -506,7 +506,7 @@ export class MinimapDrawer { | |||||||
|         y: number |         y: number | ||||||
|     ) { |     ) { | ||||||
|         if ( |         if ( | ||||||
|             this.scale * this.innerRatio > 10 && |             this.scale * this.innerRatio > 2 && | ||||||
|             this.scale * this.innerRatio < 40 && |             this.scale * this.innerRatio < 40 && | ||||||
|             !this.downloadMode && |             !this.downloadMode && | ||||||
|             this.showInfo |             this.showInfo | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ checkMobile(); | |||||||
| function checkMobile() { | function checkMobile() { | ||||||
|     if (isMobile && !alerted) { |     if (isMobile && !alerted) { | ||||||
|         alert( |         alert( | ||||||
|             '手机端建议使用自带的浏览器进行游玩,并在进入游戏后开启游戏内的全屏设置游玩' |             '手机端建议使用新版APP或者自带的浏览器进行游玩,并在进入游戏后开启游戏内的全屏设置游玩' | ||||||
|         ); |         ); | ||||||
|         alerted = true; |         alerted = true; | ||||||
|     } |     } | ||||||
| @ -39,7 +39,7 @@ function checkMobile() { | |||||||
| /** | /** | ||||||
|  * 向一个元素添加拖拽事件 |  * 向一个元素添加拖拽事件 | ||||||
|  * @param ele 目标元素,当为全局拖拽时,传入数组表示所有元素共用一个全局拖拽函数 |  * @param ele 目标元素,当为全局拖拽时,传入数组表示所有元素共用一个全局拖拽函数 | ||||||
|  * @param fn 推拽时触发的函数,传入x y和鼠标事件或点击事件 |  * @param fn 拖拽时触发的函数,传入x y和鼠标事件或点击事件 | ||||||
|  * @param ondown 鼠标按下时执行的函数 |  * @param ondown 鼠标按下时执行的函数 | ||||||
|  * @param global 是否全局拖拽,即拖拽后鼠标或手指离开元素后是否依然视为正在拖拽 |  * @param global 是否全局拖拽,即拖拽后鼠标或手指离开元素后是否依然视为正在拖拽 | ||||||
|  */ |  */ | ||||||
| @ -66,6 +66,14 @@ export function useDrag( | |||||||
|         onup && onup(e); |         onup && onup(e); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|  |     const touchUp = (e: TouchEvent) => { | ||||||
|  |         const ele = global ? document : e.target; | ||||||
|  |         if (ele) { | ||||||
|  |             (ele as HTMLElement).removeEventListener('touchmove', touchFn); | ||||||
|  |         } | ||||||
|  |         onup && onup(e); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|     const md = (e: MouseEvent) => { |     const md = (e: MouseEvent) => { | ||||||
|         const ele = global ? document : e.target; |         const ele = global ? document : e.target; | ||||||
|         if (ele) { |         if (ele) { | ||||||
| @ -93,10 +101,6 @@ export function useDrag( | |||||||
| 
 | 
 | ||||||
|     const target = global ? document : ele; |     const target = global ? document : ele; | ||||||
| 
 | 
 | ||||||
|     const touchUp = (e: TouchEvent) => { |  | ||||||
|         onup && onup(e); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     if (target instanceof Array) { |     if (target instanceof Array) { | ||||||
|         target.forEach(v => { |         target.forEach(v => { | ||||||
|             v.addEventListener('mouseup', mouseUp); |             v.addEventListener('mouseup', mouseUp); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user