fix: fix some type, add todo
This commit is contained in:
parent
d93bee9865
commit
bf8d4ba43a
@ -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) {
|
utils.prototype.http = function (type, url, formData, success, error, mimeType, responseType, onprogress, timeout) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open(type, url, true);
|
xhr.open(type, url, true);
|
||||||
xhr.timeout = timeout;
|
xhr.timeout = timeout | 1000;
|
||||||
if (mimeType) xhr.overrideMimeType(mimeType);
|
if (mimeType) xhr.overrideMimeType(mimeType);
|
||||||
if (responseType) xhr.responseType = responseType;
|
if (responseType) xhr.responseType = responseType;
|
||||||
xhr.onload = function (e) {
|
xhr.onload = function (e) {
|
||||||
|
|||||||
@ -962,8 +962,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
|
|
||||||
// 设置角色的属性值
|
// 设置角色的属性值
|
||||||
saveList.forEach(function (name) {
|
saveList.forEach(function (name) {
|
||||||
if (name == "floorId");
|
if (name == "items") {
|
||||||
else if (name == "items") {
|
|
||||||
Object.keys(core.status.hero.items).forEach(function (one) {
|
Object.keys(core.status.hero.items).forEach(function (one) {
|
||||||
if (data.items[one]) core.status.hero.items[one] = core.clone(data.items[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;
|
var o = direction == 'backward' ? -1 : 1;
|
||||||
if (direction == 'forward' || direction == 'backward') direction = core.getHeroLoc('direction');
|
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 == 'leftup' || direction == 'leftdown') faceDirection = 'left';
|
||||||
if (direction == 'rightup' || direction == 'rightdown') faceDirection = 'right';
|
if (direction == 'rightup' || direction == 'rightdown') faceDirection = 'right';
|
||||||
core.setHeroLoc('direction', direction);
|
core.setHeroLoc('direction', direction);
|
||||||
@ -1164,8 +1163,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.plugin.aniMap.clear();
|
core.plugin.aniMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
var M = Object.defineProperty;
|
// 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 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);
|
// var o = (n, i, t) => (E(n, typeof i != "symbol" ? i + "" : i, t), t);
|
||||||
let w = [];
|
let w = [];
|
||||||
const k = (n) => {
|
const k = (n) => {
|
||||||
@ -2192,7 +2191,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
let form = new FormData();
|
let form = new FormData();
|
||||||
form.append('type', 1);
|
form.append('type', 1);
|
||||||
form.append('towername', towerName);
|
form.append('towername', towerName);
|
||||||
utils.prototype.http(
|
core.utils.http(
|
||||||
'POST',
|
'POST',
|
||||||
'https://h5mota.com/backend/tower/barrage.php',
|
'https://h5mota.com/backend/tower/barrage.php',
|
||||||
form,
|
form,
|
||||||
@ -2244,7 +2243,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
form.append('towername', towerName);
|
form.append('towername', towerName);
|
||||||
form.append('comment', comment);
|
form.append('comment', comment);
|
||||||
form.append('tags', tags);
|
form.append('tags', tags);
|
||||||
utils.prototype.http(
|
core.utils.http(
|
||||||
'POST',
|
'POST',
|
||||||
'https://h5mota.com/backend/tower/barrage.php',
|
'https://h5mota.com/backend/tower/barrage.php',
|
||||||
form,
|
form,
|
||||||
@ -5092,6 +5091,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
[2, keyBtn], [3, consoleBtn],
|
[2, keyBtn], [3, consoleBtn],
|
||||||
['quit', quit]]);
|
['quit', quit]]);
|
||||||
|
|
||||||
|
core.plugin
|
||||||
// 放缩时重绘整个大menu
|
// 放缩时重绘整个大menu
|
||||||
core.plugin.settingMenu = settingMenu;
|
core.plugin.settingMenu = settingMenu;
|
||||||
// 设置初始时选中的按键为第一个按键
|
// 设置初始时选中的按键为第一个按键
|
||||||
@ -5100,4 +5100,5 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
settingMenu.init();
|
settingMenu.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** @todo 自动存档相关 同步存档到本地/服务器增加存档确认 */
|
||||||
10
runtime.d.ts
vendored
10
runtime.d.ts
vendored
@ -977,6 +977,8 @@ interface events {
|
|||||||
_eventMoveHero_moving(step: number, moveSteps: [direction | 'forward' | 'backward' |
|
_eventMoveHero_moving(step: number, moveSteps: [direction | 'forward' | 'backward' |
|
||||||
'leftup' | 'leftdown' | 'rightup' | 'rightdown', number][]): boolean
|
'leftup' | 'leftdown' | 'rightup' | 'rightdown', number][]): boolean
|
||||||
__action_checkReplaying(): 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 超时时间
|
* @param timeout 超时时间
|
||||||
*/
|
*/
|
||||||
http(type: 'GET' | 'POST', url: string, formData: FormData, success: () => void, error: () => void,
|
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 */
|
/** 获得浏览器唯一的guid */
|
||||||
getGuid(): string
|
getGuid(): string
|
||||||
@ -3003,6 +3006,7 @@ interface icons {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface plugin {
|
interface plugin {
|
||||||
|
// aniMap: Map<any, Function>
|
||||||
|
|
||||||
/** 打开一个道具商店 */
|
/** 打开一个道具商店 */
|
||||||
openItemShop(itemShopId: string): void
|
openItemShop(itemShopId: string): void
|
||||||
@ -3025,7 +3029,7 @@ interface plugin {
|
|||||||
initHeros(): void
|
initHeros(): void
|
||||||
/** 多角色插件,切换到另一角色 */
|
/** 多角色插件,切换到另一角色 */
|
||||||
changeHero(toHeroId?: number): void
|
changeHero(toHeroId?: number): void
|
||||||
|
|
||||||
[x: string]: () => void
|
[x: string]: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3230,7 +3234,7 @@ type CoreMixin = {
|
|||||||
readonly utils: utils
|
readonly utils: utils
|
||||||
readonly icons: icons
|
readonly icons: icons
|
||||||
readonly actions: actions
|
readonly actions: actions
|
||||||
readonly plugin: Record<string, Function>
|
readonly plugin: plugin
|
||||||
readonly statusBar: Main['statusBar']
|
readonly statusBar: Main['statusBar']
|
||||||
} & control & events & loader & enemys & items & maps & ui & utils & icons & actions & plugin
|
} & control & events & loader & enemys & items & maps & ui & utils & icons & actions & plugin
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user