fix: box拖动 & 漏怪显示

This commit is contained in:
unanmed 2024-04-21 18:30:19 +08:00
parent fef9950542
commit 3be0fe50ff
3 changed files with 12 additions and 8 deletions

View File

@ -67,7 +67,7 @@ dam4.png ---- 存档 59
[] 宝物目标设定 [] 宝物目标设定
[] 每个怪物加一个怪物说明 [] 每个怪物加一个怪物说明
[] 歌词展示系统 [] 歌词展示系统
[] 小地图显示框,可以选择是否显示剩余怪物数量等 [x] 小地图显示框,可以选择是否显示剩余怪物数量等
[x] 怪物死亡特效 [x] 怪物死亡特效
[] 区域名称显示特效3D 粒子特效 [] 区域名称显示特效3D 粒子特效
[x] 单独的工具栏,可以自定义按键 [x] 单独的工具栏,可以自定义按键

View File

@ -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

View File

@ -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);