fix: fix some type, add todo

This commit is contained in:
ShakeFlower 2025-04-30 20:14:08 +08:00
parent d93bee9865
commit bf8d4ba43a
3 changed files with 17 additions and 12 deletions

View File

@ -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;
xhr.timeout = timeout | 1000;
if (mimeType) xhr.overrideMimeType(mimeType);
if (responseType) xhr.responseType = responseType;
xhr.onload = function (e) {

View File

@ -962,8 +962,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// 设置角色的属性值
saveList.forEach(function (name) {
if (name == "floorId");
else if (name == "items") {
if (name == "items") {
Object.keys(core.status.hero.items).forEach(function (one) {
if (data.items[one]) core.status.hero.items[one] = core.clone(data.items[one]);
});
@ -1027,7 +1026,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// ------ 前进/后退
var o = direction == 'backward' ? -1 : 1;
if (direction == 'forward' || direction == 'backward') direction = core.getHeroLoc('direction');
/** @type {direction} */var faceDirection = direction;
var faceDirection = direction;
if (direction == 'leftup' || direction == 'leftdown') faceDirection = 'left';
if (direction == 'rightup' || direction == 'rightdown') faceDirection = 'right';
core.setHeroLoc('direction', direction);
@ -1164,8 +1163,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.plugin.aniMap.clear();
}
var M = Object.defineProperty;
var E = (n, i, t) => i in n ? M(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
// var M = Object.defineProperty;
// var E = (n, i, t) => i in n ? M(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
// var o = (n, i, t) => (E(n, typeof i != "symbol" ? i + "" : i, t), t);
let w = [];
const k = (n) => {
@ -2192,7 +2191,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
let form = new FormData();
form.append('type', 1);
form.append('towername', towerName);
utils.prototype.http(
core.utils.http(
'POST',
'https://h5mota.com/backend/tower/barrage.php',
form,
@ -2244,7 +2243,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
form.append('towername', towerName);
form.append('comment', comment);
form.append('tags', tags);
utils.prototype.http(
core.utils.http(
'POST',
'https://h5mota.com/backend/tower/barrage.php',
form,
@ -5092,6 +5091,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
[2, keyBtn], [3, consoleBtn],
['quit', quit]]);
core.plugin
// 放缩时重绘整个大menu
core.plugin.settingMenu = settingMenu;
// 设置初始时选中的按键为第一个按键
@ -5100,4 +5100,5 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
settingMenu.init();
}
}
}
}
/** @todo 自动存档相关 同步存档到本地/服务器增加存档确认 */

10
runtime.d.ts vendored
View File

@ -977,6 +977,8 @@ interface events {
_eventMoveHero_moving(step: number, moveSteps: [direction | 'forward' | 'backward' |
'leftup' | 'leftdown' | 'rightup' | 'rightdown', number][]): boolean
__action_checkReplaying(): boolean
_action_sleep(data: { time: number }, x?: undefined, y?: undefined, prefix?: undefined): void
_startGame_start(hard: string, seed: number, route: string, callback: Function): void
/**
*
@ -2914,7 +2916,8 @@ interface utils {
* @param timeout
*/
http(type: 'GET' | 'POST', url: string, formData: FormData, success: () => void, error: () => void,
mimeType: string, responseType: XMLHttpRequestResponseType, onprogress: boolean, timeout: number): void
mimeType?: string | null, responseType?: XMLHttpRequestResponseType | null,
onprogress?: boolean | null, timeout?: number | null): void
/** 获得浏览器唯一的guid */
getGuid(): string
@ -3003,6 +3006,7 @@ interface icons {
}
interface plugin {
// aniMap: Map<any, Function>
/** 打开一个道具商店 */
openItemShop(itemShopId: string): void
@ -3025,7 +3029,7 @@ interface plugin {
initHeros(): void
/** 多角色插件,切换到另一角色 */
changeHero(toHeroId?: number): void
[x: string]: () => void
}
@ -3230,7 +3234,7 @@ type CoreMixin = {
readonly utils: utils
readonly icons: icons
readonly actions: actions
readonly plugin: Record<string, Function>
readonly plugin: plugin
readonly statusBar: Main['statusBar']
} & control & events & loader & enemys & items & maps & ui & utils & icons & actions & plugin