Feat: 允许切换不同形态的道理

This commit is contained in:
2025-09-09 20:46:03 +08:00
parent 2fea99a7e2
commit 27c65820e6
7 changed files with 223 additions and 65 deletions

View File

@ -10,6 +10,11 @@ contextBridge.exposeInMainWorld('electronAPI', {
},
getSoundPath: (soundFile) => ipcRenderer.invoke('get-sound-path', soundFile),
getSoundFiles: () => ipcRenderer.invoke('get-sound-files'),
getPetSelection: () => ipcRenderer.invoke('get-pet-selection'),
setPetSelection: (petAsset) => ipcRenderer.invoke('set-pet-selection', petAsset),
onPetSelectionChanged: (callback) => {
ipcRenderer.on('pet-selection-changed', (_, fileName) => callback(fileName));
},
showTooltip: (text) => ipcRenderer.send('show-tooltip', text),
onUpdatePosition: (callback) => {
ipcRenderer.on('update-position', (_, position) => callback(position))