Skip to content

Commit 09e865f

Browse files
T.claude
authored andcommitted
Sync game state to tray menu & bump version to 0.6.0
- Add IPC handler for game state updates in main.js - ArenaScene now sends level/xp/weapon/wave to Electron tray - Tray menu shows real-time game stats instead of defaults - Version bump to 0.6.0 for desktop app release Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c604d08 commit 09e865f

4 files changed

Lines changed: 36 additions & 8 deletions

File tree

electron/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { app, BrowserWindow, globalShortcut, ipcMain } from 'electron';
22
import { fileURLToPath } from 'url';
33
import path from 'path';
4-
import { createTray, updateTrayMenu } from './tray.js';
4+
import { createTray, updateTrayMenu, updateGameState } from './tray.js';
55
import { createSettingsStore } from './settings.js';
66
import { applyWindowMode, cycleWindowMode, getWindowModeConfig } from './windows.js';
77
import { startServer, stopServer, getServerState, setXPEventCallback } from './server.js';
@@ -194,6 +194,12 @@ function setupIPC() {
194194
// Server IPC
195195
ipcMain.handle('server:getState', () => getServerState());
196196
ipcMain.on('server:toggle', () => toggleServerMode());
197+
198+
// Game state IPC - update tray menu with game stats
199+
ipcMain.on('game:state', (_, state) => {
200+
updateGameState(state);
201+
updateTrayMenu(tray, mainWindow, settings, quitApp);
202+
});
197203
}
198204

199205
app.whenReady().then(() => {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vibe-coder",
3-
"version": "0.1.0",
3+
"version": "0.6.0",
44
"description": "Vampire Survivors-style idle game powered by your Claude Code activity",
55
"type": "module",
66
"main": "electron/main.js",
@@ -60,11 +60,15 @@
6060
"target": [
6161
{
6262
"target": "dmg",
63-
"arch": ["universal"]
63+
"arch": [
64+
"universal"
65+
]
6466
},
6567
{
6668
"target": "zip",
67-
"arch": ["universal"]
69+
"arch": [
70+
"universal"
71+
]
6872
}
6973
],
7074
"darkModeSupport": true,
@@ -93,7 +97,10 @@
9397
},
9498
"win": {
9599
"icon": "build/icon.png",
96-
"target": ["nsis", "portable"]
100+
"target": [
101+
"nsis",
102+
"portable"
103+
]
97104
},
98105
"nsis": {
99106
"oneClick": false,
@@ -104,7 +111,10 @@
104111
"linux": {
105112
"icon": "build/icon.png",
106113
"category": "Game",
107-
"target": ["AppImage", "deb"]
114+
"target": [
115+
"AppImage",
116+
"deb"
117+
]
108118
}
109119
}
110120
}

src/scenes/ArenaScene.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,18 @@ export default class ArenaScene extends Phaser.Scene {
11781178
this.bossHealthBar.setVisible(false);
11791179
this.bossNameText.setVisible(false);
11801180
}
1181+
1182+
// Sync game state to Electron tray (if running in desktop app)
1183+
if (window.electronAPI?.updateGameState) {
1184+
window.electronAPI.updateGameState({
1185+
level: state.level,
1186+
xp: state.xp,
1187+
xpToNext: xpNeeded,
1188+
weapon: weaponLabel,
1189+
wave: this.waveNumber,
1190+
isPlaying: true
1191+
});
1192+
}
11811193
}
11821194

11831195
showXPPopup(amount) {

0 commit comments

Comments
 (0)