* 保存悬浮球位置到数据库
()
| 270 | * 保存悬浮球位置到数据库 |
| 271 | */ |
| 272 | private savePosition(): void { |
| 273 | if (!this.ballWindow || this.ballWindow.isDestroyed()) return |
| 274 | |
| 275 | const [x, y] = this.ballWindow.getPosition() |
| 276 | |
| 277 | try { |
| 278 | const data = databaseAPI.dbGet('settings-general') || {} |
| 279 | data.floatingBallPosition = { x, y } |
| 280 | databaseAPI.dbPut('settings-general', data) |
| 281 | console.log('[FloatingBall] 悬浮球位置已保存:', { x, y }) |
| 282 | } catch (error) { |
| 283 | console.error('[FloatingBall] 保存悬浮球位置失败:', error) |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | /** |
| 288 | * 显示右键菜单 |