feat: launch ArborFlow behavior tree studio

This commit is contained in:
TuxMonkey
2026-07-21 20:09:00 +08:00
commit cb6ca3d24b
32 changed files with 9869 additions and 0 deletions

20
scripts/render-icon.cjs Normal file
View File

@@ -0,0 +1,20 @@
const { app, BrowserWindow } = require('electron')
const fs = require('node:fs/promises')
const path = require('node:path')
app.whenReady().then(async () => {
const svg = await fs.readFile(path.join(__dirname, '..', 'public', 'arborflow.svg'), 'utf8')
const window = new BrowserWindow({
width: 512,
height: 512,
show: false,
transparent: true,
frame: false,
webPreferences: { offscreen: true },
})
await window.loadURL(`data:image/svg+xml;base64,${Buffer.from(svg).toString('base64')}`)
const image = await window.webContents.capturePage({ x: 0, y: 0, width: 512, height: 512 })
await fs.writeFile(path.join(__dirname, '..', 'build', 'icon.png'), image.toPNG())
window.destroy()
app.quit()
})