mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-18 11:59:26 +08:00
修复自动缩放失效的bug
This commit is contained in:
parent
0ad9158bd2
commit
5e3f143db9
@ -328,7 +328,7 @@ main.prototype.init = async function (mode, callback) {
|
||||
].forEach(function (t) {
|
||||
coreData[t] = main[t];
|
||||
});
|
||||
core.init(coreData, callback);
|
||||
await core.init(coreData, callback);
|
||||
core.resize();
|
||||
|
||||
main.core = core;
|
||||
|
@ -44,6 +44,7 @@ let shopOpened = false;
|
||||
let openedShopId = '';
|
||||
core.registerReplayAction('openShop', name => {
|
||||
if (!name.startsWith('openShop:')) return false;
|
||||
if (shopOpened) return false;
|
||||
openedShopId = name.slice(9);
|
||||
shopOpened = true;
|
||||
core.replay();
|
||||
|
2
src/types/core.d.ts
vendored
2
src/types/core.d.ts
vendored
@ -1070,7 +1070,7 @@ interface Core extends Pick<Main, CoreDataFromMain> {
|
||||
* @param coreData 初始化信息
|
||||
* @param callback 初始化完成后的回调函数
|
||||
*/
|
||||
init(coreData: MainData, callback?: () => void): void;
|
||||
init(coreData: MainData, callback?: () => void): Promise<void>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
|
@ -175,10 +175,6 @@ import { isMobile } from '../plugin/use';
|
||||
import BoxAnimate from '../components/boxAnimate.vue';
|
||||
import { KeyCode } from '../plugin/keyCodes';
|
||||
import { sleep } from 'mutate-animate';
|
||||
import {
|
||||
completeAchievement,
|
||||
hasCompletedAchievement
|
||||
} from '../plugin/ui/achievement';
|
||||
|
||||
const id = core.plugin.openedShopId;
|
||||
const shop = core.status.shops[core.plugin.openedShopId] as ItemShopEvent;
|
||||
@ -201,8 +197,6 @@ const count = ref(0);
|
||||
const nowMoney = ref(core.status.hero.money);
|
||||
const update = ref(false);
|
||||
|
||||
let achiN = 0;
|
||||
|
||||
let bought = false;
|
||||
|
||||
watch(count, n => {
|
||||
@ -248,10 +242,8 @@ function confirm() {
|
||||
if (count.value === 0) {
|
||||
return;
|
||||
}
|
||||
achiN = 0;
|
||||
const money = core.status.hero.money;
|
||||
bought = true;
|
||||
core.status.route.push(`openShop:${id}`);
|
||||
if (mode.value === 'buy') {
|
||||
if (cost.value <= money) {
|
||||
core.getItem(item.value.id, count.value);
|
||||
@ -319,6 +311,7 @@ onMounted(async () => {
|
||||
if (core.plugin.transition.value) await sleep(600);
|
||||
document.addEventListener('keyup', keyup);
|
||||
document.addEventListener('keydown', keydown);
|
||||
core.status.route.push(`openShop:${id}`);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user