mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 15:09: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) {
|
].forEach(function (t) {
|
||||||
coreData[t] = main[t];
|
coreData[t] = main[t];
|
||||||
});
|
});
|
||||||
core.init(coreData, callback);
|
await core.init(coreData, callback);
|
||||||
core.resize();
|
core.resize();
|
||||||
|
|
||||||
main.core = core;
|
main.core = core;
|
||||||
|
@ -44,6 +44,7 @@ let shopOpened = false;
|
|||||||
let openedShopId = '';
|
let openedShopId = '';
|
||||||
core.registerReplayAction('openShop', name => {
|
core.registerReplayAction('openShop', name => {
|
||||||
if (!name.startsWith('openShop:')) return false;
|
if (!name.startsWith('openShop:')) return false;
|
||||||
|
if (shopOpened) return false;
|
||||||
openedShopId = name.slice(9);
|
openedShopId = name.slice(9);
|
||||||
shopOpened = true;
|
shopOpened = true;
|
||||||
core.replay();
|
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 coreData 初始化信息
|
||||||
* @param callback 初始化完成后的回调函数
|
* @param callback 初始化完成后的回调函数
|
||||||
*/
|
*/
|
||||||
init(coreData: MainData, callback?: () => void): void;
|
init(coreData: MainData, callback?: () => void): Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
|
@ -175,10 +175,6 @@ import { isMobile } from '../plugin/use';
|
|||||||
import BoxAnimate from '../components/boxAnimate.vue';
|
import BoxAnimate from '../components/boxAnimate.vue';
|
||||||
import { KeyCode } from '../plugin/keyCodes';
|
import { KeyCode } from '../plugin/keyCodes';
|
||||||
import { sleep } from 'mutate-animate';
|
import { sleep } from 'mutate-animate';
|
||||||
import {
|
|
||||||
completeAchievement,
|
|
||||||
hasCompletedAchievement
|
|
||||||
} from '../plugin/ui/achievement';
|
|
||||||
|
|
||||||
const id = core.plugin.openedShopId;
|
const id = core.plugin.openedShopId;
|
||||||
const shop = core.status.shops[core.plugin.openedShopId] as ItemShopEvent;
|
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 nowMoney = ref(core.status.hero.money);
|
||||||
const update = ref(false);
|
const update = ref(false);
|
||||||
|
|
||||||
let achiN = 0;
|
|
||||||
|
|
||||||
let bought = false;
|
let bought = false;
|
||||||
|
|
||||||
watch(count, n => {
|
watch(count, n => {
|
||||||
@ -248,10 +242,8 @@ function confirm() {
|
|||||||
if (count.value === 0) {
|
if (count.value === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
achiN = 0;
|
|
||||||
const money = core.status.hero.money;
|
const money = core.status.hero.money;
|
||||||
bought = true;
|
bought = true;
|
||||||
core.status.route.push(`openShop:${id}`);
|
|
||||||
if (mode.value === 'buy') {
|
if (mode.value === 'buy') {
|
||||||
if (cost.value <= money) {
|
if (cost.value <= money) {
|
||||||
core.getItem(item.value.id, count.value);
|
core.getItem(item.value.id, count.value);
|
||||||
@ -319,6 +311,7 @@ onMounted(async () => {
|
|||||||
if (core.plugin.transition.value) await sleep(600);
|
if (core.plugin.transition.value) await sleep(600);
|
||||||
document.addEventListener('keyup', keyup);
|
document.addEventListener('keyup', keyup);
|
||||||
document.addEventListener('keydown', keydown);
|
document.addEventListener('keydown', keydown);
|
||||||
|
core.status.route.push(`openShop:${id}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user