poi-plugin-thief-akashi 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +23 -0
  2. package/index.js +12 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -0,0 +1,23 @@
1
+ # 明石小偷
2
+
3
+ poi 插件,提供明石/野崎独立计时窗口,可调整字号和分别显示两种计时。
4
+
5
+ ## 0.3.4 退出修复
6
+
7
+ 关闭或重新加载 poi 主窗口时,自动关闭计时弹窗并清理订阅;停用插件仍走相同的清理流程。修复此前主窗口关闭后弹窗残留、阻止程序退出的问题。
8
+
9
+ 已通过 54 项自动化测试,并在 Electron 38.3.0 的独立宿主中使用真实窗口验证:旧版关闭主窗口后残留 1 个弹窗,修复版剩余窗口为 0,进程正常退出。此验证未操作实际游戏会话。
10
+
11
+ ## poi 版本兼容
12
+
13
+ 0.3.3 使用 poi 11 和 12 共有的 `views/env-parts/config` 配置入口,修复 0.3.2 在 poi 11 上初始化失败、无法打开窗口的问题。设置的存储键保持不变。
14
+
15
+ 已核对 poi 11.1.0 源码和本机 poi 12.0.1 的配置接口,并通过模拟宿主的加载、配置读取、游戏事件、弹窗及卸载/重载测试。尚未完成两版客户端内的实际游戏验证。
16
+
17
+ ## 开发验证
18
+
19
+ ```sh
20
+ npm ci
21
+ npm run check
22
+ npm test
23
+ ```
package/index.js CHANGED
@@ -9,16 +9,22 @@ const { createPopup } = require('./lib/popup');
9
9
  const settings = createSettings();
10
10
  let popup = null;
11
11
 
12
+ function stop() {
13
+ window.removeEventListener('unload', stop);
14
+ popup?.close();
15
+ popup = null;
16
+ runtime.stop();
17
+ }
18
+
12
19
  // handleClick without reactClass is poi's window-only plugin interface.
13
20
  exports.settingsClass = createSettingsView(React, settings);
14
21
  exports.handleClick = () => popup.open();
15
22
  exports.pluginDidLoad = () => {
16
- settings.start(require('views/env').config);
23
+ // This config module is shared by poi 11 and 12.
24
+ settings.start(require('views/env-parts/config').config);
17
25
  runtime.start(window);
18
26
  popup = createPopup(runtime, settings, require('@electron/remote').BrowserWindow);
27
+ // Closing/reloading poi's main window does not call pluginWillUnload.
28
+ window.addEventListener('unload', stop);
19
29
  };
20
- exports.pluginWillUnload = () => {
21
- popup?.close();
22
- popup = null;
23
- runtime.stop();
24
- };
30
+ exports.pluginWillUnload = stop;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-thief-akashi",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "编队白嫖明石/野崎计时工具",
5
5
  "main": "index.js",
6
6
  "files": [