小井盖改为自绘 GM 窗口(WebView2)+ 背包可见 + 启动器互斥
- 90CN.dll:新增 90CN_gm_window.cpp,自绘标题栏/边框的置顶窗口,内嵌 WebView2 承载 gmweb 页面 - 点小井盖时隐藏游戏内嵌 IE 面板、弹出控制台;关掉后还原,独占全屏压不住时可选 minimize_game - 窗口每轮确认置顶,避免游戏抢窗口栈后消失 - gmweb:新增背包页,发放后自动跳转并高亮新入包的行(GET /local/dnf-gm/inventory/list) - 启动器:新增 /console-status,控制台运行时置灰 GM 工具入口并阻止进入 - 服务端指纹回绑新 DLL(1258496 / 7A179B1B…)
This commit is contained in:
1 parent
e9a3952a9d
commit
b22579658e
10 files changed
+1246
-97
No files matched your search
+47
-1
@@ -11,6 +11,11 @@
|
||||
|
||||
function shellGo(page) {
|
||||
if (!pages.includes(page)) page = 'start';
|
||||
// 控制台在跑时不允许进 GM(除了点按钮,开始页等地方也可能跳过去)
|
||||
if (page === 'gm' && window.shellConsoleBusy && window.shellConsoleBusy()) {
|
||||
shellTip('游戏内简易 GM 控制台正在运行,先关掉它再用完整 GM 工具', 'err');
|
||||
return;
|
||||
}
|
||||
document.querySelectorAll('.shell-page').forEach(el => el.classList.toggle('active', el.id === 'page-' + page));
|
||||
document.querySelectorAll('.shell-nav-item').forEach(el => el.classList.toggle('active', el.dataset.shellPage === page));
|
||||
$('shellCrumb').textContent = crumb[page] || page;
|
||||
@@ -51,9 +56,50 @@
|
||||
window.shellExitGm = shellExitGm;
|
||||
|
||||
document.querySelectorAll('.shell-nav-item').forEach(el => {
|
||||
el.addEventListener('click', () => shellGo(el.dataset.shellPage));
|
||||
el.addEventListener('click', () => {
|
||||
if (el.classList.contains('nav-disabled')) {
|
||||
shellTip(el.getAttribute('title') || '暂时不可用', 'err');
|
||||
return;
|
||||
}
|
||||
shellGo(el.dataset.shellPage);
|
||||
});
|
||||
});
|
||||
|
||||
// 简易 GM 控制台(游戏内那个自绘窗口)在运行时,锁掉完整 GM 工具入口:
|
||||
// 两边改的是同一份角色数据,同时开会互相覆盖。控制台是精简版,优先保它。
|
||||
let consoleBusy = false;
|
||||
function shellTip(msg, type) {
|
||||
if (typeof gmToast === 'function') { gmToast(msg, type || 'info'); return; }
|
||||
alert(msg);
|
||||
}
|
||||
function applyConsoleBusy(busy) {
|
||||
const btn = document.querySelector('.shell-nav-item[data-shell-page="gm"]');
|
||||
if (!btn) return;
|
||||
btn.classList.toggle('nav-disabled', busy);
|
||||
btn.setAttribute('title', busy
|
||||
? '游戏内简易 GM 控制台正在运行,先关掉它再用完整 GM 工具'
|
||||
: '');
|
||||
if (busy && document.body.classList.contains('gm-fullscreen')) {
|
||||
shellExitGm();
|
||||
shellTip('简易 GM 控制台已启动,完整 GM 工具已自动退出', 'info');
|
||||
}
|
||||
}
|
||||
function pollConsoleStatus() {
|
||||
fetch('/console-status', { cache: 'no-store' })
|
||||
.then(r => r.json())
|
||||
.then(d => {
|
||||
const busy = !!(d && d.running);
|
||||
if (busy !== consoleBusy) {
|
||||
consoleBusy = busy;
|
||||
applyConsoleBusy(busy);
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
window.shellConsoleBusy = () => consoleBusy;
|
||||
setInterval(pollConsoleStatus, 1500);
|
||||
setTimeout(pollConsoleStatus, 300);
|
||||
|
||||
// 顶部窗口按钮
|
||||
const win = () => (window.pywebview && window.pywebview.api) || null;
|
||||
const bMin = $('shellWinMin'); if (bMin) bMin.addEventListener('click', () => { const w = win(); if (w && w.minimize) w.minimize(); });
|
||||
|
||||
Reference in new issue
Block a user