feat: deprecate api

This commit is contained in:
unanmed 2024-09-27 12:42:07 +08:00
parent f407b5cb74
commit 80f154694a
9 changed files with 182 additions and 1 deletions

View File

@ -457,6 +457,7 @@ interface Control {
): void;
/**
* @deprecated
* n格的横坐标
* @example core.closeDoor(core.nextX(), core.nextY(), 'yellowDoor', core.turnHero); // 在主角面前关上一扇黄门然后主角顺时针旋转90°
* @param n 01
@ -464,6 +465,7 @@ interface Control {
nextX(n?: number): number;
/**
* @deprecated
* n格的纵坐标
* @example core.jumpHero(core.nextX(2), core.nextY(2)); // 主角向前跃过一格,即跳跃靴道具的使用效果
* @param n 01
@ -471,6 +473,7 @@ interface Control {
nextY(n?: number): number;
/**
* @deprecated
* 齿()
* @example core.nearHero(6, 6, 6); // 判定主角是否身处点66的半径为6的锯齿领域
* @param x
@ -492,6 +495,7 @@ interface Control {
updateFollowers(): void;
/**
* @deprecated
*
*/
checkBlock(): void;
@ -664,6 +668,7 @@ interface Control {
removeSave(index: number, callback?: () => void): void;
/**
* @deprecated
*
* @example core.setStatus('loc', {x : 0, y : 0, direction : 'up'}); // 设置主角位置为地图左上角,脸朝上
* @param name
@ -672,6 +677,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
@ -683,6 +689,7 @@ interface Control {
): void;
/**
* @deprecated
*
* @example core.getStatus('loc'); // 读取主角的坐标和朝向
* @param name
@ -691,6 +698,7 @@ interface Control {
getStatus<K extends keyof HeroStatus>(name: K): HeroStatus[K];
/**
* @deprecated
* status中获得属性
* @param status
* @param name
@ -701,6 +709,7 @@ interface Control {
): HeroStatus[K];
/**
* @deprecated
*
* @example core.getRealStatus('atk'); // 计算主角的攻击力,包括百分比修正。战斗使用的就是这个值
* @param name
@ -708,6 +717,7 @@ interface Control {
getRealStatus<K extends keyof NumbericHeroStatus>(name: K): number;
/**
* @deprecated
* status中获得增幅后的属性
* @param status
* @param name
@ -718,12 +728,14 @@ interface Control {
): number;
/**
* @deprecated
*
* @param name
*/
getNakedStatus(name?: keyof NumbericHeroStatus): number;
/**
* @deprecated
* 1
* flag: `__${name}_${buff}__`
* @example core.setBuff('atk', 0.5); // 主角能发挥出的攻击力减半
@ -733,6 +745,7 @@ interface Control {
setBuff<K extends keyof NumbericHeroStatus>(name: K, value?: number): void;
/**
* @deprecated
* core.setBuff(name, core.getBuff(name) + value)
* @example core.addBuff('atk', -0.1); // 主角获得一层“攻击力减一成”的负面效果
* @param name
@ -741,6 +754,7 @@ interface Control {
addBuff<K extends keyof NumbericHeroStatus>(name: K, value: number): void;
/**
* @deprecated
* 1
* @example core.getBuff('atk'); // 主角当前能发挥出多大比例的攻击力
* @param name
@ -748,6 +762,7 @@ interface Control {
getBuff(name: keyof NumbericHeroStatus): number;
/**
* @deprecated
*
* 使使
* core.clearMap('hero'); core.drawHero();
@ -760,6 +775,7 @@ interface Control {
setHeroLoc(name: 'direction', value: Dir, noGather?: boolean): void;
/**
* @deprecated
*
* @example core.getHeroLoc(); // 获取主角的位置和朝向
* @param name
@ -768,6 +784,7 @@ interface Control {
getHeroLoc<K extends keyof DiredLoc>(name: K): DiredLoc[K];
/**
* @deprecated
*
* @example core.getLvName(); // 获取主角当前级别的名称,如“下级佣兵”
* @param lv
@ -776,6 +793,7 @@ interface Control {
getLvName(lv?: number): string;
/**
* @deprecated
*
*
* null
@ -783,6 +801,7 @@ interface Control {
getNextLvUpNeed(): number | null;
/**
* @deprecated
* flag变量
* @example core.setFlag('poison', true); // 令主角中毒
* @param name 西
@ -791,6 +810,7 @@ interface Control {
setFlag(name: string, value?: any): void;
/**
* @deprecated
* flag变量 core.setFlag(name, core.getFlag(name, 0) + value)
* @example core.addFlag('hatred', 1); // 增加1点仇恨值
* @param name
@ -799,6 +819,7 @@ interface Control {
addFlag(name: string, value: number | string): void;
/**
* @deprecated
* flag变量
* @param name 西
* @param defaultValue 0
@ -807,6 +828,7 @@ interface Control {
getFlag<T>(name: string, defaultValue?: T): T;
/**
* @deprecated
* flag变量是否不为falsy
* @example core.hasFlag('poison'); // 判断主角当前是否中毒
* @param name 西
@ -814,12 +836,14 @@ interface Control {
hasFlag(name: string): boolean;
/**
* @deprecated
* flag
* @param name
*/
removeFlag(name: string): void;
/**
* @deprecated
*
* @param x
* @param y
@ -836,6 +860,7 @@ interface Control {
): void;
/**
* @deprecated
*
* @param x
* @param y
@ -852,6 +877,7 @@ interface Control {
): T;
/**
* @deprecated
*
* @param x
* @param y
@ -868,6 +894,7 @@ interface Control {
): void;
/**
* @deprecated
*
* @param x
* @param y
@ -882,6 +909,7 @@ interface Control {
): boolean;
/**
* @deprecated
*
* @param x
* @param y
@ -927,6 +955,7 @@ interface Control {
getMappedName<K extends keyof NameMap>(name: K): NameMap[K];
/**
* @deprecated
* 使core.events._action_setWeather()
* @example core.setWeather('fog', 10); // 设置十级大雾天
* @param type
@ -935,6 +964,7 @@ interface Control {
setWeather(type?: string, level?: WeatherLevel): void;
/**
* @deprecated
*
* @param name
* @param initFunc
@ -947,6 +977,7 @@ interface Control {
): void;
/**
* @deprecated
*
* @param name
*/
@ -1054,17 +1085,20 @@ interface Control {
checkBgm(): void;
/**
* @deprecated
*
* @param delta
*/
setDisplayScale(delta: number): void;
/**
* @deprecated
*
*/
clearStatusBar(): void;
/**
* @deprecated
*
* @param doNotCheckAutoEvents
* @param immediate
@ -1072,17 +1106,20 @@ interface Control {
updateStatusBar(doNotCheckAutoEvents?: boolean, immediate?: boolean): void;
/**
* @deprecated
*
*/
showStatusBar(): void;
/**
* @deprecated
*
* @param showToolbox
*/
hideStatusBar(showToolbox?: boolean): void;
/**
* @deprecated
* 1-8
* @param useButton 1-8
*/

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

@ -1181,6 +1181,7 @@ interface Main extends MainData {
readonly savePages: number;
/**
* @deprecated
*
*/
readonly criticalUseLoop: number;
@ -1325,6 +1326,7 @@ interface Main extends MainData {
log(e: string | Error, error?: boolean): void;
/**
* @deprecated
* keyframes
*/
createOnChoiceAnimation(): void;

View File

@ -216,6 +216,7 @@ interface Enemys {
};
/**
* @deprecated
*
*/
getEnemys(): {
@ -223,6 +224,7 @@ interface Enemys {
};
/**
* @deprecated
*
* @example core.canBattle('greenSlime',0,0,'MT0') // 能否打败主塔0层左上角的绿头怪假设有
* @param enemy id或敌人对象

56
src/types/event.d.ts vendored
View File

@ -18,16 +18,19 @@ interface Events extends EventData {
eventdata: EventData;
/**
* @deprecated
*
*/
commonEvent: Record<EventDeclaration, MotaEvent>;
/**
* @deprecated
*
*/
systemEvent: Record<string, SystemEventFunc>;
/**
* @deprecated
*
*/
actions: Record<string, EventFunc>;
@ -67,6 +70,7 @@ interface Events extends EventData {
confirmRestart(): void;
/**
* @deprecated
*
* @param type
* @param func (data,callback)
@ -74,12 +78,14 @@ interface Events extends EventData {
registerSystemEvent(type: string, func: SystemEventFunc): void;
/**
* @deprecated
*
* @param type
*/
unregisterSystemEvent(type: string): void;
/**
* @deprecated
*
* @param type
* @param data
@ -115,6 +121,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example core.getItem('book'); // 获得敌人手册并提示
* @param id id
@ -132,6 +139,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param noRoute true则不计入录像
*/
@ -178,6 +186,7 @@ interface Events extends EventData {
onSki(number?: number): boolean;
/**
* @deprecated
*
* @param type
* @param func (data, x, y, prefix)
@ -186,12 +195,14 @@ interface Events extends EventData {
registerEvent(type: string, func: EventFunc): void;
/**
* @deprecated
*
* @param type
*/
unregisterEvent(type: string): void;
/**
* @deprecated
*
* @param data
* @param x
@ -201,6 +212,7 @@ interface Events extends EventData {
doEvent(data: any, x?: number, y?: number, prefix?: string): void;
/**
* @deprecated
*
* @param list
* @param x
@ -215,6 +227,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param list
* @param x
@ -229,6 +242,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example
* // 事件中的原生脚本,配合勾选“不自动执行下一个事件”来达到此改变色调只持续到下次场景切换的效果
@ -237,6 +251,7 @@ interface Events extends EventData {
doAction(): void;
/**
* @deprecated
* core.insertCommonEvent
* @example core.insertAction('一段文字'); // 插入一个显示文章
* @param action
@ -254,6 +269,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example core.insertCommonEvent('加点事件', [3]);
* @param name
@ -273,23 +289,27 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param name
*/
getCommonEvent(name: EventDeclaration): any;
/**
* @deprecated
*
* @param data
*/
recoverEvents(data?: any): boolean;
/**
* @deprecated
*
*/
checkAutoEvents(): void;
/**
* @deprecated
*
* @param symbol
* @param value
@ -297,6 +317,7 @@ interface Events extends EventData {
autoEventExecuting(symbol?: string, value?: any): boolean;
/**
* @deprecated
*
* @param symbol
* @param value
@ -304,94 +325,113 @@ interface Events extends EventData {
autoEventExecuted(symbol?: string, value?: any): boolean;
/**
* @deprecated
*
*/
pushEventLoc(x: number, y: number, floorId?: FloorIds): void;
/**
* @deprecated
*
*/
popEventLoc(): void;
/**
* @deprecated
*
* @param data
*/
precompile(data?: any): any;
/**
* @deprecated
*
* @param fromUserAction
*/
openBook(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
useFly(fromUserAction?: boolean): void;
/** 点击装备栏时的打开操作 */
/**
* @deprecated
*
*/
openEquipbox(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
openToolbox(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
openQuickShop(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
openKeyBoard(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
save(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
load(fromUserAction?: boolean): void;
/**
* @deprecated
*
* @param fromUserAction
*/
openSettings(fromUserAction?: boolean): void;
/**
* @deprecated
*
*/
hasAsync(): boolean;
/**
* @deprecated
*
*/
stopAsync(): void;
/**
* @deprecated
*
*/
hasAsyncAnimate(): boolean;
/**
* @deprecated
*
* @param name 4x4的行走图名称
*/
follow(name: ImageIds | NameMapIn<ImageIds>): void;
/**
* @deprecated
*
* @param name
*/
@ -525,6 +565,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param name
* @param value
@ -532,11 +573,13 @@ interface Events extends EventData {
setNameMap(name: string, value?: SourceIds): void;
/**
* @deprecated
*
*/
setTextAttribute(data: Partial<TextAttribute>): void;
/**
* @deprecated
*
* @param code
* @param loc
@ -555,6 +598,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param code
* @param callback
@ -577,6 +621,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example
* // 裁剪winskin.png的最左边128×128px放大到铺满整个视野1秒内淡入到50%透明编号为1
@ -600,6 +645,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example core.hideImage(1, 1000, core.jumpHero); // 1秒内淡出1号图片然后主角原地跳跃半秒
* @param code
@ -609,6 +655,7 @@ interface Events extends EventData {
hideImage(code: number, time?: number, callback?: () => void): void;
/**
* @deprecated
* /
* @example core.moveImage(1, null, 0.5); // 1秒内把1号图片变为50%透明
* @param code
@ -628,6 +675,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param code
* @param center
@ -646,6 +694,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @param code
* @param center
@ -664,6 +713,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example core.showGif(); // 擦除所有动图
* @param name
@ -679,6 +729,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
* bgm的音量
* @example core.setVolume(0, 100, core.jumpHero); // 0.1秒内淡出bgm然后主角原地跳跃半秒
* @param value 01
@ -688,6 +739,7 @@ interface Events extends EventData {
setVolume(value: number, time?: number, callback?: () => void): void;
/**
* @deprecated
*
* @example core.vibrate(); // 视野左右抖动1秒
* @param direction
@ -705,6 +757,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
* 退
* @example core.eventMoveHero(['forward'], 125, core.jumpHero); // 主角强制前进一步用时1/8秒然后主角原地跳跃半秒
* @param steps 退
@ -730,6 +783,7 @@ interface Events extends EventData {
): void;
/**
* @deprecated
*
* @example core.setHeroIcon('npc48.png', true); // 把主角从阳光变成样板0层左下角的小姐姐但不立即刷新
* @param name core.status.hero.image

21
src/types/item.d.ts vendored
View File

@ -99,6 +99,7 @@ interface Equip extends EquipBase {
*/
interface Items {
/**
* @deprecated
*
*/
getItems(): {
@ -106,6 +107,7 @@ interface Items {
};
/**
* @deprecated
*
* @example core.getItemEffect('redPotion', 10) // 执行获得10瓶红血的效果
* @param itemId id
@ -114,6 +116,7 @@ interface Items {
getItemEffect(itemId: AllIdsOf<'items'>, itemNum?: number): void;
/**
* @deprecated
*
* @example core.getItemEffectTip(redPotion) // (获得 红血瓶)',生命+100'
* @param itemId id
@ -122,6 +125,7 @@ interface Items {
getItemEffectTip(itemId: AllIdsOf<'items'>): string;
/**
* @deprecated
* 使
* @example core.useItem('pickaxe', true) // 使用破墙镐,不计入录像,无回调
* @param itemId id
@ -135,6 +139,7 @@ interface Items {
): void;
/**
* @deprecated
* 使
* @example core.canUseItem('pickaxe') // 能否使用破墙镐
* @param itemId id
@ -143,6 +148,7 @@ interface Items {
canUseItem(itemId: AllIdsOf<'items'>): boolean;
/**
* @deprecated
*
* @example core.itemCount('yellowKey') // 持有多少把黄钥匙
* @param itemId id
@ -151,6 +157,7 @@ interface Items {
itemCount(itemId: AllIdsOf<'items'>): number;
/**
* @deprecated
* (穿)
* @example core.hasItem('yellowKey') // 主角是否持有黄钥匙
* @param itemId id
@ -159,6 +166,7 @@ interface Items {
hasItem(itemId: AllIdsOf<'items'>): boolean;
/**
* @deprecated
* 穿
* @example core.hasEquip('sword5') // 主角是否装备了神圣剑
* @param itemId id
@ -167,6 +175,7 @@ interface Items {
hasEquip(itemId: ItemIdOf<'equips'>): boolean;
/**
* @deprecated
*
* @example core.getEquip(1) // 主角目前装备了什么盾牌
* @param equipType
@ -175,6 +184,7 @@ interface Items {
getEquip(equipType: number): ItemIdOf<'equips'> | null;
/**
* @deprecated
*
* @example core.setItem('yellowKey', 3) // 设置黄钥匙为3把
* @param itemId id
@ -183,6 +193,7 @@ interface Items {
setItem(itemId: AllIdsOf<'items'>, itemNum?: number): void;
/**
* @deprecated
*
* @example core.addItem('yellowKey', -2) // 没收两把黄钥匙
* @param itemId id
@ -199,12 +210,14 @@ interface Items {
removeItem(itemId?: AllIdsOf<'items'>, itemNum?: number): void;
/**
* @deprecated
*
* @param equipId
*/
getEquipTypeByName(name?: ItemIdOf<'equips'>): number;
/**
* @deprecated
*
* @example core.getEquipTypeById('shield5') // 1盾牌
* @param equipId id
@ -213,6 +226,7 @@ interface Items {
getEquipTypeById(equipId: ItemIdOf<'equips'>): number;
/**
* @deprecated
* 穿
* @example core.canEquip('sword5', true) // 主角可以装备神圣剑吗,如果不能会有提示
* @param equipId id
@ -222,6 +236,7 @@ interface Items {
canEquip(equipId: ItemIdOf<'equips'>, hint?: boolean): boolean;
/**
* @deprecated
* 穿
* @example core.loadEquip('sword5') // 尝试装备上背包里的神圣剑,无回调
* @param equipId id
@ -230,6 +245,7 @@ interface Items {
loadEquip(equipId: ItemIdOf<'equips'>, callback?: () => void): void;
/**
* @deprecated
*
* @example core.unloadEquip(1) // 卸下盾牌,无回调
* @param equipType
@ -238,6 +254,7 @@ interface Items {
unloadEquip(equipType: number, callback?: () => void): void;
/**
* @deprecated
*
* @example core.compareEquipment('sword5', 'shield5') // 比较神圣剑和神圣盾的优劣
* @param compareEquipId id
@ -250,6 +267,7 @@ interface Items {
): EquipBase;
/**
* @deprecated
*
* @example core.quickSaveEquip(1) // 将当前套装保存为1号套装
* @param index
@ -257,6 +275,7 @@ interface Items {
quickSaveEquip(index: number): void;
/**
* @deprecated
*
* @example core.quickLoadEquip(1) // 快速换上1号套装
* @param index
@ -264,6 +283,7 @@ interface Items {
quickLoadEquip(index: number): void;
/**
* @deprecated
*
* @example core.setEquip('sword1', 'value', 'atk', 300, '+='); // 设置铁剑的攻击力数值再加300
* @param equipId id
@ -283,6 +303,7 @@ interface Items {
): void;
/**
* @deprecated
* 穿
* @param type
* @param loadId

14
src/types/map.d.ts vendored
View File

@ -996,6 +996,7 @@ interface Maps {
): Cls | null;
/**
* @deprecated
*
* @param x
* @param y
@ -1010,6 +1011,7 @@ interface Maps {
): number | null;
/**
* @deprecated
*
* @param x
* @param y
@ -1123,6 +1125,7 @@ interface Maps {
removeBlockByIndexes(indexes: number[], floorId?: FloorIds): void;
/**
* @deprecated
* /
* @param name
* @param loc
@ -1137,6 +1140,7 @@ interface Maps {
): void;
/**
* @deprecated
* /
* @param name
* @param loc
@ -1151,6 +1155,7 @@ interface Maps {
): void;
/**
* @deprecated
*
* @param loc
* @param floorId id
@ -1163,6 +1168,7 @@ interface Maps {
): void;
/**
* @deprecated
*
* @param loc
* @param floorId id
@ -1192,6 +1198,7 @@ interface Maps {
): void;
/**
* @deprecated
*
* @param number id
* @param x
@ -1210,6 +1217,7 @@ interface Maps {
): void;
/**
* @deprecated
*
* @param number id
* @param locs
@ -1318,6 +1326,7 @@ interface Maps {
): void;
/**
* @deprecated
* /
* @param loc
* @param type
@ -1332,16 +1341,19 @@ interface Maps {
): void;
/**
* @deprecated
*
* @param block
*/
addGlobalAnimate(block?: Block): void;
/**
* @deprecated
*
*/
removeGlobalAnimate(): void;
/**
* @deprecated
*
* @param x
* @param y
@ -1349,6 +1361,7 @@ interface Maps {
removeGlobalAnimate(x?: number, y?: number): void;
/**
* @deprecated
* UI层的box动画
*/
drawBoxAnimate(): void;
@ -1385,6 +1398,7 @@ interface Maps {
): void;
/**
* @deprecated
* id列表
* @param name
*/

18
src/types/status.d.ts vendored
View File

@ -618,6 +618,7 @@ interface InitGameStatus {
mapBlockObjs: Record<FloorIds, Record<LocString, Block>>;
/**
* @deprecated
*
*/
damage: DamageStatus;
@ -634,6 +635,7 @@ interface InitGameStatus {
heroMoving: number;
/**
* @deprecated
*
*/
heroStop: boolean;
@ -689,11 +691,13 @@ interface InitGameStatus {
globalAttribute: GlobalAttribute;
/**
* @deprecated
*
*/
curtainColor: Color;
/**
* @deprecated
*
*/
globalAnimateObjs: Block<
@ -701,26 +705,31 @@ interface InitGameStatus {
>[];
/**
* @deprecated
*
*/
floorAnimateObjs: FloorAnimate[];
/**
* @deprecated
* BoxAnimate信息
*/
boxAnimateObjs: (BoxAnimate | BigImageBoxAnimate)[];
/**
* @deprecated
*
*/
autotileAnimateObjs: Block<IdToNumber[AllIdsOf<'autotile'>]>[];
/**
* @deprecated
* 便
*/
globalAnimateStatus: number;
/**
* @deprecated
*
*/
animateObjs: AnimateObj[];
@ -731,6 +740,7 @@ interface InitGameStatus {
hard: string;
/**
* @deprecated
*
*/
heroCenter: Record<'px' | 'py', number>;
@ -753,6 +763,7 @@ interface InitGameStatus {
};
/**
* @deprecated
*
*/
preview: ActionsPreview;
@ -778,6 +789,7 @@ interface GameStatus extends InitGameStatus {
thisMap: Floor;
/**
* @deprecated
*
*/
checkBlock: Readonly<CheckBlockStatus>;
@ -947,18 +959,24 @@ interface HeroStatus {
loc: DiredLoc;
/**
* @deprecated
*
*/
flags: Flags;
/**
* @deprecated
*
*/
followers: Follower[];
/**
* @deprecated
*/
statistics: HeroStatistics;
/**
* @deprecated
*
*/
items: {

19
src/types/ui.d.ts vendored
View File

@ -622,6 +622,7 @@ interface Ui {
): void;
/**
* @deprecated
* canvas上绘制一个图标
* @param frame
*/
@ -641,11 +642,13 @@ interface Ui {
closePanel(): void;
/**
* @deprecated
* UI层内容
*/
clearUI(): void;
/**
* @deprecated
*
* @param text
* @param id ID
@ -654,11 +657,13 @@ interface Ui {
drawTip(text: string, id?: AllIds, frame?: number): void;
/**
* @deprecated
*
*/
drawText(contents?: string, callback?: () => void): void;
/**
* @deprecated
*
*/
drawUIEventSelector(
@ -672,12 +677,14 @@ interface Ui {
): void;
/**
* @deprecated
*
* @param code
*/
clearUIEventSelector(code?: number | number[]): void;
/**
* @deprecated
* WindowSkin
* @param direction
*/
@ -694,6 +701,7 @@ interface Ui {
): void;
/**
* @deprecated
* winskin或纯色背景
*/
drawBackground(
@ -705,6 +713,7 @@ interface Ui {
): void;
/**
* @deprecated
*
* @param ctx
* @param content \n, \r[...], \i[...], \c[...], \d, \e
@ -718,6 +727,7 @@ interface Ui {
): ReturnedTextContentConfig;
/**
* @deprecated
*
*/
getTextContentHeight(
@ -726,11 +736,13 @@ interface Ui {
): number;
/**
* @deprecated
*
*/
drawTextBox(content: string, config?: TextBoxConfig): void;
/**
* @deprecated
*
*/
drawScrollText(
@ -741,11 +753,13 @@ interface Ui {
): void;
/**
* @deprecated
*
*/
textImage(content: string, lineHeight?: number): HTMLCanvasElement;
/**
* @deprecated
*
*/
drawChoices(
@ -756,6 +770,7 @@ interface Ui {
): void;
/**
* @deprecated
*
*/
drawConfirmBox(
@ -766,16 +781,19 @@ interface Ui {
): void;
/**
* @deprecated
*
*/
drawWaiting(text: string): void;
/**
* @deprecated
*
*/
drawPagination(page: number, totalPage: number, y?: number): void;
/**
* @deprecated
*
*/
drawBook(index: number): void;
@ -860,6 +878,7 @@ interface Ui {
deleteAllCanvas(): void;
/**
* @deprecated
*
*/
_drawViewMaps(): void;

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

@ -11,6 +11,7 @@ interface Utils {
readonly scan2: DeepReadonly<Scan2>;
/**
* @deprecated
* ${}
* @example
* // 把主角的生命值和持有的黄钥匙数量代入这句话
@ -22,6 +23,7 @@ interface Utils {
replaceText(text: string, prefix?: string): string;
/**
* @deprecated
* 如status:xxx等
*
* @example
@ -33,6 +35,7 @@ interface Utils {
replaceValue(value: string): string;
/**
* @deprecated
* 支持status:xxx等的计算
* @example core.calValue('status:hp + status:def'); // 计算主角的生命值加防御力
* @param value
@ -193,6 +196,7 @@ interface Utils {
cloneArray<T extends any[]>(data: T): T;
/**
* @deprecated
*
* @example core.splitImage(core.material.images.images['npc48.png'], 32, 48); // 把npc48.png切分成若干32×48px的小人
* @param image []
@ -265,6 +269,7 @@ interface Utils {
applyEasing(mode?: EaseMode): (x: number) => number;
/**
* @deprecated
*
* @example core.arrayToRGB([102, 204, 255]); // "#66ccff",加载画面的宣传色
* @param color 255
@ -273,6 +278,7 @@ interface Utils {
arrayToRGB(color: RGBArray): _RGBA;
/**
* @deprecated
*
* @example core.arrayToRGBA([102, 204, 255]); // "rgba(102,204,255,1)"
* @param color 255
@ -308,6 +314,7 @@ interface Utils {
isset(v?: any): boolean;
/**
* @deprecated
*
* @example core.subarray(['ad', '米库', '小精灵', '小破草', '小艾'], ['ad', '米库', '小精灵']); // ['小破草', '小艾']
* @param a b短将返回null
@ -326,6 +333,7 @@ interface Utils {
inArray(array?: any, element?: any): boolean;
/**
* @deprecated
* x限定在[a,b]a和b可交换
* @example core.clamp(1200, 1, 1000); // 1000
* @param x !x为true时x一律视为0
@ -364,6 +372,7 @@ interface Utils {
strlen(str: string): number;
/**
* @deprecated
*
* @param turn
* @param direction
@ -371,6 +380,7 @@ interface Utils {
turnDirection(turn: HeroTurnDir, direction?: Dir): string;
/**
* @deprecated
*
* @example core.playSound(core.matchWildcard('*Key', itemId) ? 'item.mp3' : 'door.mp3'); // 判断捡到的是钥匙还是别的道具,从而播放不同的音效
* @param pattern 0
@ -380,6 +390,7 @@ interface Utils {
matchWildcard(pattern: string, string: string): boolean;
/**
* @deprecated
* /RegExp/.test(str)
* @param pattern
* @param string
@ -457,6 +468,7 @@ interface Utils {
copy(data: string): void;
/**
* @deprecated
* core.drawConfirmBox()
* @example core.myconfirm('重启游戏?', core.restart); // 弹窗询问玩家是否重启游戏
* @param hint
@ -470,6 +482,7 @@ interface Utils {
): void;
/**
* @deprecated
*
*/
myprompt(
@ -510,6 +523,7 @@ interface Utils {
hashCode(obj: any): number;
/**
* @deprecated
* ,
* @example core.same(['1', 2], ['1', 2]); // true
*/