poi-plugin-thief-akashi 0.3.3 → 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 +6 -0
  2. package/index.js +10 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  poi 插件,提供明石/野崎独立计时窗口,可调整字号和分别显示两种计时。
4
4
 
5
+ ## 0.3.4 退出修复
6
+
7
+ 关闭或重新加载 poi 主窗口时,自动关闭计时弹窗并清理订阅;停用插件仍走相同的清理流程。修复此前主窗口关闭后弹窗残留、阻止程序退出的问题。
8
+
9
+ 已通过 54 项自动化测试,并在 Electron 38.3.0 的独立宿主中使用真实窗口验证:旧版关闭主窗口后残留 1 个弹窗,修复版剩余窗口为 0,进程正常退出。此验证未操作实际游戏会话。
10
+
5
11
  ## poi 版本兼容
6
12
 
7
13
  0.3.3 使用 poi 11 和 12 共有的 `views/env-parts/config` 配置入口,修复 0.3.2 在 poi 11 上初始化失败、无法打开窗口的问题。设置的存储键保持不变。
package/index.js CHANGED
@@ -9,6 +9,13 @@ 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();
@@ -17,9 +24,7 @@ exports.pluginDidLoad = () => {
17
24
  settings.start(require('views/env-parts/config').config);
18
25
  runtime.start(window);
19
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);
20
29
  };
21
- exports.pluginWillUnload = () => {
22
- popup?.close();
23
- popup = null;
24
- runtime.stop();
25
- };
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.3",
3
+ "version": "0.3.4",
4
4
  "description": "编队白嫖明石/野崎计时工具",
5
5
  "main": "index.js",
6
6
  "files": [