fix: bugs

This commit is contained in:
AncTe committed 2024-03-02 00:00:41 +08:00
1 parent d7544b98c8
commit 314cf0626c
14 files changed
+48 -36

No files matched your search

-2
View File
@@ -89,8 +89,6 @@ watch(width, n => emits('update:width', n));
watch(height, n => emits('update:height', n));
async function click() {
console.log(1);
moveSelected.value = true;
moveTimeout = window.setTimeout(() => {
moveSelected.value = false;
+4 -4
View File
@@ -161,7 +161,7 @@ interface IndexedGameUi extends ShowableGameUi {
}
interface HoldOnController {
end(): void;
end(noClosePanel?: boolean): void;
}
export class UiController extends Focus<IndexedGameUi> {
@@ -180,7 +180,7 @@ export class UiController extends Focus<IndexedGameUi> {
v.ui.emit('close');
});
if (this.stack.length === 0) {
if (!this.hold) this.emit('end');
if (!this.hold) this.emit('end', false);
this.hold = false;
}
});
@@ -225,8 +225,8 @@ export class UiController extends Focus<IndexedGameUi> {
this.hold = true;
return {
end: () => {
this.emit('end');
end: (noClosePanel: boolean = false) => {
this.emit('end', noClosePanel);
}
};
}
+6 -4
View File
@@ -41,11 +41,13 @@ hook.once('mounted', () => {
ui.style.display = 'flex';
core.lockControl();
});
mainUi.on('end', () => {
mainUi.on('end', noClosePanel => {
ui.style.display = 'none';
try {
core.closePanel();
} catch {}
if (!noClosePanel) {
try {
core.closePanel();
} catch {}
}
});
fixedUi.on('start', () => {
fixed.style.display = 'block';
+10 -4
View File
@@ -53,13 +53,16 @@ function _convertShop(shop: any) {
// 检测能否访问该商店
{
type: 'if',
condition: "core.isShopVisited('" + shop.id + "')",
condition:
"Mota.Plugin.require('shop_g').isShopVisited('" +
shop.id +
"')",
true: [
// 可以访问,直接插入执行效果
{
type: 'function',
function:
"function() { core.plugin._convertShop_replaceChoices('" +
"function() { Mota.Plugin.require('shop_g')._convertShop_replaceChoices('" +
shop.id +
"', false) }"
}
@@ -84,7 +87,7 @@ function _convertShop(shop: any) {
{
type: 'function',
function:
"function() { core.plugin._convertShop_replaceChoices('" +
"function() { Mota.Plugin.require('shop_g')._convertShop_replaceChoices('" +
shop.id +
"', true) }"
}
@@ -101,7 +104,10 @@ function _convertShop(shop: any) {
];
}
function _convertShop_replaceChoices(shopId: string, previewMode: boolean) {
export function _convertShop_replaceChoices(
shopId: string,
previewMode: boolean
) {
var shop = core.status.shops[shopId] as any;
var choices = (shop.choices || [])
.filter(function (choice: any) {
+7 -6
View File
@@ -23,7 +23,8 @@ export function getAddStatus(equip: Equip) {
{keys.map(v => {
const value = Math.floor(
(equip.value[v] ?? 0) * core.getBuff(v) +
(core.status.hero[v] * (equip.percentage[v] ?? 0)) / 100
(core.status.hero[v] * (equip.percentage?.[v] ?? 0)) /
100
);
return (
@@ -71,12 +72,12 @@ export function getNowStatus(nowEquip?: Equip, onCol: boolean = false) {
let add = 0;
if (has(nowEquip)) {
add += Math.floor(
(nowEquip.value[v] ?? 0) * core.getBuff(v)
(nowEquip.value?.[v] ?? 0) * core.getBuff(v)
);
const per = Math.floor(
(nowEquip.percentage[v] * core.getStatus(v)) / 100
);
add += isNaN(per) ? 0 : per;
// const per = Math.floor(
// (nowEquip.percentage?.[v] * getHeroStatusOn(v)) / 100
// );
// add += isNaN(per) ? 0 : per;
}
if (onCol) add = -add;
+2 -2
View File
@@ -312,10 +312,10 @@ export function getStatusLabel(name: string) {
hpmax: '生命回复',
hp: '生命',
manamax: '魔力上限',
mana: '额外攻击',
mana: '魔力',
atk: '攻击',
def: '防御',
mdef: '智慧',
mdef: '护盾',
money: '金币',
exp: '经验',
point: '加点',
+5 -1
View File
@@ -56,7 +56,7 @@
:type="isMobile ? 'horizontal' : 'vertical'"
></a-divider>
<div id="fly-right">
<canvas id="fly-thumbnail" @click="fly"></canvas>
<canvas id="fly-thumbnail" @click="fly" @wheel="wheel"></canvas>
<div id="fly-tools">
<double-left-outlined
@click="changeFloorByDelta(-10)"
@@ -472,6 +472,10 @@ function click(e: MouseEvent) {
}
}
function wheel(ev: WheelEvent) {
changeFloorByDelta(-Math.sign(ev.deltaY));
}
function changeAreaByFloor(id: FloorIds) {
nowArea.value = Object.keys(area).find(v => area[v].includes(id))!;
}
+1 -1
View File
@@ -184,7 +184,7 @@ function use(id: ShowItemIds) {
nextTick(() => {
core.useItem(id, false, () => {
if (mainUi.stack.length === 0) {
hold.end();
hold.end(core.status.event.id !== 'toolbox');
}
});
});