From 1976dd1d5ce40c9ab0589c6fa83d962cd715211a Mon Sep 17 00:00:00 2001 From: bigjakk Date: Sat, 4 Apr 2026 13:11:25 -0700 Subject: [PATCH] fix: auto-create swap subdirs, add folder buttons, fix CSS theme injection --- src/main/index.ts | 24 +++++++++++++++++++++--- src/preload/index.ts | 16 ++++++++++++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/main/index.ts b/src/main/index.ts index cb759b7..20ee21d 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -229,6 +229,12 @@ async function launchApp(): Promise { // ── Resource swapper ── const swapperConfig = config.get('swapper'); const swapDir = swapperConfig.path || join(app.getPath('userData'), 'Krunker Civilian Client', 'swapper'); + // Ensure swap subdirectories exist (themes/, backgrounds/) + for (const sub of ['themes', 'backgrounds']) { + const dir = join(swapDir, sub); + if (!existsSync(dir)) mkdirSync(dir, { recursive: true }); + } + const swapper = swapperConfig.enabled ? new ResourceSwapper(swapDir) : null; electronLog.log(`[KCC] Resource swapper: ${swapper ? 'enabled' : 'disabled'} (${swapDir})`); @@ -510,10 +516,20 @@ async function launchApp(): Promise { win.webContents.insertCSS(ALL_CLIENT_CSS), ]; - // Inject user CSS theme + // Inject user CSS theme via