mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-15 11:24:31 +08:00
refactor: 迁移旧ui至新ui系统
This commit is contained in:
1 parent
9a97a470f1
commit
8fcc570e5d
29 files changed
+219
-320
No files matched your search
@@ -715,10 +715,11 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
||||
start = curr;
|
||||
}
|
||||
if (i++ >= 10000) {
|
||||
throw new Error(
|
||||
console.warn(
|
||||
`Unexpected endless loop in calculating critical.` +
|
||||
`Enemy Id: ${this.id}. Loc: ${this.x},${this.y}. Floor: ${this.floorId}`
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +113,10 @@ function getRealStatus(
|
||||
|
||||
declare global {
|
||||
interface PluginDeclaration {
|
||||
getHeroStatusOf: typeof getHeroStatusOf;
|
||||
getHeroStatusOn: typeof getHeroStatusOn;
|
||||
hero: {
|
||||
getHeroStatusOf: typeof getHeroStatusOf;
|
||||
getHeroStatusOn: typeof getHeroStatusOn;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ export function getSkillConsume(skill) {
|
||||
|
||||
export function openTree() {
|
||||
if (main.replayChecking) return;
|
||||
mota.plugin.ui.skillTreeOpened.value = true;
|
||||
mota.ui.main.open('skillTree');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+9
-10
@@ -11,8 +11,9 @@ export {};
|
||||
|
||||
function openItemShop(itemShopId) {
|
||||
if (!core.isReplaying()) {
|
||||
core.plugin.openedShopId = itemShopId;
|
||||
mota.plugin.ui.shopOpened.value = true;
|
||||
mota.ui.main.open('shop', void 0, {
|
||||
shopId: itemShopId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,22 +25,19 @@ export {};
|
||||
}
|
||||
|
||||
ui.prototype.drawBook = function () {
|
||||
if (!core.isReplaying())
|
||||
return (mota.plugin.ui.bookOpened.value = true);
|
||||
if (!core.isReplaying()) return mota.ui.main.open('book');
|
||||
};
|
||||
|
||||
ui.prototype._drawToolbox = function () {
|
||||
if (!core.isReplaying())
|
||||
return (mota.plugin.ui.toolOpened.value = true);
|
||||
if (!core.isReplaying()) return mota.ui.main.open('toolbox');
|
||||
};
|
||||
|
||||
ui.prototype._drawEquipbox = function () {
|
||||
if (!core.isReplaying())
|
||||
return (mota.plugin.ui.equipOpened.value = true);
|
||||
if (!core.isReplaying()) return mota.ui.main.open('equipbox');
|
||||
};
|
||||
|
||||
ui.prototype.drawFly = function () {
|
||||
if (!core.isReplaying()) return (mota.plugin.ui.flyOpened.value = true);
|
||||
if (!core.isReplaying()) return mota.ui.main.open('fly');
|
||||
};
|
||||
|
||||
control.prototype.updateStatusBar_update = function () {
|
||||
@@ -54,6 +52,7 @@ export {};
|
||||
updateVueStatusBar();
|
||||
};
|
||||
|
||||
// todo: 多个状态栏分离与控制
|
||||
control.prototype.showStatusBar = function () {
|
||||
if (main.mode == 'editor') return;
|
||||
core.removeFlag('hideStatusBar');
|
||||
@@ -93,7 +92,7 @@ export {};
|
||||
|
||||
function openSkill() {
|
||||
if (core.isReplaying()) return;
|
||||
mota.plugin.ui.skillOpened.value = true;
|
||||
mota.ui.main.open('skill');
|
||||
}
|
||||
|
||||
core.plugin.gameUi = {
|
||||
|
||||
Reference in new issue
Block a user