fix: bugs & deprecate

This commit is contained in:
unanmed 2024-03-02 10:30:36 +08:00
parent ba4a52e4ab
commit de64c8e2bd
7 changed files with 45 additions and 9 deletions

View File

@ -400,10 +400,9 @@
<select id="selectFloor" style="margin-bottom: 5px;"></select>
<input type="button" value="选层" id='selectFloorBtn' />
<input type="button" value="保存地图" id='saveFloor' />
<input type="button" value="后退" id="undoFloor" style="display: none;" />
<input type="button" style="display: none;" value="帮助文档" id="openDoc" />
<input type="button" style="display: none;" value="前往游戏"
onclick="window.open('./index.html', '_blank')" />
<input type="button" value="后退" id="undoFloor" />
<input type="button" value="帮助文档" id="openDoc" />
<input type="button" value="前往游戏" onclick="window.open('./index.html', '_blank')" />
</div>
</div>
<div id="mid2">
@ -512,7 +511,7 @@
editor.mode_listen();
editor.mobile_listen();
});
//main.listen();
//main.listen();
</script>
<!-- hightlight textarea -->

View File

@ -1684,7 +1684,9 @@ actions.prototype._clickSL = function (x, y) {
if (x >= this.LAST - 2 && y === core._HEIGHT_ - 1) {
core.playSound('取消');
if (core.events.recoverEvents(core.status.event.interval)) return;
core.ui.closePanel();
setTimeout(() => {
core.ui.closePanel();
}, 0);
delete core.status.tempRoute;
if (!core.isPlaying()) document.getElementById('start').style.top = '0';
return;
@ -2345,7 +2347,9 @@ actions.prototype._clickSettings = function (x, y) {
return core.confirmRestart();
case 7:
core.playSound('取消');
core.ui.closePanel();
setTimeout(() => {
core.ui.closePanel();
}, 0);
break;
}
}
@ -2356,7 +2360,9 @@ actions.prototype._clickSettings = function (x, y) {
actions.prototype._keyUpSettings = function (keycode) {
if (keycode == 27 || keycode == 88) {
core.playSound('取消');
core.ui.closePanel();
setTimeout(() => {
core.ui.closePanel();
}, 0);
return;
}
this._selectChoices(

View File

@ -388,7 +388,7 @@ interface Control {
/**
*
* @param canvasId ts的说法应该只能填数字
* @param canvasId ts的说法应该只能填数字
*
* @param x
* @param y
@ -407,11 +407,13 @@ interface Control {
addGameCanvasTranslate(x: number, y: number): void;
/**
* @deprecated
*
*/
updateViewport(): void;
/**
* @deprecated
*
* @param px
* @param py
@ -419,6 +421,7 @@ interface Control {
setViewport(px?: number, py?: number): void;
/**
* @deprecated
* 西... + setViewport就完事了
* @param x
* @param y
@ -639,6 +642,7 @@ interface Control {
removeSave(index: number, callback?: () => void): void;
/**
* @deprecated
*
* @example core.setStatus('loc', {x : 0, y : 0, direction : 'up'}); // 设置主角位置为地图左上角,脸朝上
* @param name
@ -647,6 +651,7 @@ interface Control {
setStatus<K extends keyof HeroStatus>(name: K, value: HeroStatus[K]): void;
/**
* @deprecated
* core.setStatus(name, core.getStatus(name) + value)
* @example core.addStatus('name', '酱'); // 在主角的名字后加一个“酱”字
* @param name
@ -658,6 +663,7 @@ interface Control {
): void;
/**
* @deprecated
*
* @example core.getStatus('loc'); // 读取主角的坐标和朝向
* @param name
@ -666,6 +672,7 @@ interface Control {
getStatus<K extends keyof HeroStatus>(name: K): HeroStatus[K];
/**
* @deprecated
* status中获得属性
* @param status
* @param name
@ -676,6 +683,7 @@ interface Control {
): HeroStatus[K];
/**
* @deprecated
*
* @example core.getRealStatus('atk'); // 计算主角的攻击力,包括百分比修正。战斗使用的就是这个值
* @param name
@ -683,6 +691,7 @@ interface Control {
getRealStatus<K extends keyof NumbericHeroStatus>(name: K): number;
/**
* @deprecated
* status中获得增幅后的属性
* @param status
* @param name
@ -693,6 +702,7 @@ interface Control {
): number;
/**
* @deprecated
*
* @param name
*/
@ -960,6 +970,7 @@ interface Control {
): void;
/**
* @deprecated
* flags.__bgm__
* @example core.playBgm('bgm.mp3', 30); // 播放bgm.mp3并跳过前半分钟
* @param bgm
@ -968,26 +979,31 @@ interface Control {
playBgm(bgm: BgmIds | NameMapIn<BgmIds>, startTime?: number): void;
/**
* @deprecated
*
*/
pauseBgm(): void;
/**
* @deprecated
*
*/
resumeBgm(resumeTime?: number): void;
/**
* @deprecated
*
*/
setMusicBtn(): void;
/**
* @deprecated
*
*/
triggerBgm(): void;
/**
* @deprecated
*
* @param sound
* @param pitch 100
@ -1001,18 +1017,21 @@ interface Control {
): number;
/**
* @deprecated
*
* @param id
*/
stopSound(id?: number): void;
/**
* @deprecated
* id列表
* @param name
*/
getPlayingSounds(name?: SoundIds | NameMapIn<SoundIds>): number[];
/**
* @deprecated
* bgm状态
*/
checkBgm(): void;

1
src/types/core.d.ts vendored
View File

@ -948,6 +948,7 @@ interface Core extends Pick<Main, CoreDataFromMain> {
readonly animateFrame: AnimateFrame;
/**
* @deprecated
*
*/
readonly musicStatus: Readonly<MusicStatus>;

View File

@ -428,6 +428,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example core.setEnemy('greenSlime', 'def', 0); // 把绿头怪的防御设为0
* @param id id
@ -447,6 +448,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param x
* @param y
@ -469,6 +471,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param x
* @param y
@ -483,6 +486,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param fromX
* @param fromY

View File

@ -1,5 +1,6 @@
interface ActionData {
/**
* @deprecated
*
* @param keyCode keyCode
* @param altKey alt键

6
src/types/util.d.ts vendored
View File

@ -68,6 +68,7 @@ interface Utils {
decompress(value: string): any;
/**
* @deprecated
*
* @param key
* @param value
@ -75,6 +76,7 @@ interface Utils {
setLocalStorage(key: string, value?: any): void;
/**
* @deprecated
*
* @param key
* @param defaultValue
@ -82,6 +84,7 @@ interface Utils {
getLocalStorage<T>(key: string, defaultValue?: T): T;
/**
* @deprecated
*
* @param key
*/
@ -151,6 +154,7 @@ interface Utils {
): void;
/**
* @deprecated
* 适用于global:xxx
* @example core.setBlobal('一周目已通关', true); // 设置全局存储“一周目已通关”为true方便二周目游戏中的新要素。
* @param key
@ -159,6 +163,7 @@ interface Utils {
setGlobal(key: string, value?: any): void;
/**
* @deprecated
* 适用于global:xxx
* @example if (core.getGlobal('一周目已通关', false) === true) core.getItem('dagger'); // 二周目游戏进行到此处时会获得一把屠龙匕首
* @param key
@ -334,6 +339,7 @@ interface Utils {
getCookie(name: string): string;
/**
* @deprecated
*
* @example
* // 更新状态栏中的主角生命,使用加载画面的宣传色