From dada07262430f6a9650edd9c39aeb2f8a44f039f Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Sat, 5 Apr 2025 11:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=B7=E6=96=B0=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E7=9A=84=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/inject-view/app.vue | 16 +++++++++++++++- src/scripts/inject-view/shortkeys.vue | 5 +++++ src/scripts/inject-view/store.ts | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/scripts/inject-view/app.vue b/src/scripts/inject-view/app.vue index 677dca8..326bc37 100644 --- a/src/scripts/inject-view/app.vue +++ b/src/scripts/inject-view/app.vue @@ -283,7 +283,7 @@ export default defineComponent({ const picking = ref(false); const keydownFunc = (e: KeyboardEvent) => { - const { shortKeyPick, shortKeyGameStep, shortKeyGamePauseResume } = config.value; + const { shortKeyPick, shortKeyGameFresh, shortKeyGameStep, shortKeyGamePauseResume } = config.value; switch (e.code) { case shortKeyPick: { if (picking.value === false) { @@ -304,6 +304,20 @@ export default defineComponent({ showGameTip.value = !!cc.game.isPaused(); break; } + case shortKeyGameFresh: { + const url = new URL(window.location.href); + const port = Number(url.port) || 7456; + fetch(`http://localhost:${port}/asset-db/refresh`) + .then((res) => { + res.text().then((a: string) => { + if (a === "success") { + window.location.reload(); + } + }); + }) + .then((data) => {}); + break; + } } }; /**是否显示游戏暂停的提示 */ diff --git a/src/scripts/inject-view/shortkeys.vue b/src/scripts/inject-view/shortkeys.vue index 7cf2ba4..eeb22e3 100644 --- a/src/scripts/inject-view/shortkeys.vue +++ b/src/scripts/inject-view/shortkeys.vue @@ -3,6 +3,7 @@ +