From b3b46708fe5eff0e4b6cc0be96f2837e4cd11766 Mon Sep 17 00:00:00 2001 From: ShakeFlower Date: Thu, 8 May 2025 17:29:19 +0800 Subject: [PATCH] fix: fix some type --- libs/utils.js | 2 +- project/plugins.js | 4 ++-- runtime.d.ts | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/utils.js b/libs/utils.js index 53318aec..898ed736 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -1357,7 +1357,7 @@ utils.prototype._unzip_readEntries = function (entries, success, convertToText) utils.prototype.http = function (type, url, formData, success, error, mimeType, responseType, onprogress, timeout) { var xhr = new XMLHttpRequest(); xhr.open(type, url, true); - xhr.timeout = timeout | 1000; + if (typeof timeout === 'number') xhr.timeout = timeout; // 加载大资源不能有超时值,否则会导致加载不出来 if (mimeType) xhr.overrideMimeType(mimeType); if (responseType) xhr.responseType = responseType; xhr.onload = function (e) { diff --git a/project/plugins.js b/project/plugins.js index a04f605d..bda6119f 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -3932,7 +3932,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = drawContent() { core.createCanvas(this.name, 0, 0, core.__PIXELS__, core.__PIXELS__, 136); - this.drawButtonContent(this.name); + this.drawButtonContent(); } beginListen() { @@ -4118,10 +4118,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = function skipPeformOff() { core.maps.jumpBlock = perform.jumpBlock; - core.maps.jumpHero = perform.jumpHero; core.maps.moveBlock = perform.moveBlock; core.maps.drawAnimate = perform.drawAnimate; core.maps.drawHeroAnimate = perform.drawHeroAnimate; + core.events.jumpHero = perform.jumpHero; core.events.vibrate = perform.vibrate; core.events._action_sleep = perform._action_sleep; core.events.__action_checkReplaying = perform.__action_checkReplaying; diff --git a/runtime.d.ts b/runtime.d.ts index 41affd9d..b66011de 100644 --- a/runtime.d.ts +++ b/runtime.d.ts @@ -396,6 +396,7 @@ interface control { _updateDamage_damage(floorId: string, onMap: boolean): void _updateDamage_extraDamage(floorId: string, onMap: boolean): void _bindRoutePush(): void + __replay_getTimeout(): number /** 物品数据显示 */ getItemDetail(floorId: string): void @@ -1432,6 +1433,8 @@ interface actions { _clickAction(x?: number, y?: number, px?: number, py?: number): number /** 获得点击事件相对左上角的坐标 */ _getClickLoc(x: number, y: number): { x: number, y: number, size: number } + _clickSwitchs_action_moveSpeed(delta: number): void + _clickSwitchs_action_floorChangeTime(delta: number): void /** * 此函数将注册一个用户交互行为。 @@ -3020,7 +3023,7 @@ interface plugin { // aniMap: Map /** 打开一个道具商店 */ - openItemShop(itemShopId: string): void + openItemShop: (itemShopId: string) => void /** 某个全局商店是否被访问过 */ isShopVisited(id: string): boolean @@ -3041,7 +3044,8 @@ interface plugin { /** 多角色插件,切换到另一角色 */ changeHero(toHeroId?: number): void - [x: string]: () => void + // core.plugin.xxx 可能是任意签名和返回值的函数 + [x: string]: Function } type CoreMixin = {