From 102c532686dec83d126bd1bb9e110faf51075a45 Mon Sep 17 00:00:00 2001 From: Brian Allred Date: Mon, 15 Jun 2026 21:16:43 -0500 Subject: [PATCH] Add launcher reset to File menu --- src/main/config.ts | 16 ++++++++++++++++ src/main/menu.ts | 12 ++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/config.ts b/src/main/config.ts index 905bf7e..cb7333f 100644 --- a/src/main/config.ts +++ b/src/main/config.ts @@ -33,6 +33,22 @@ export default class Config { fs.writeFileSync(Config.configFilePath(), JSON.stringify(config)); } + static resetConfig() { + const configPath = Config.configFilePath(); + if (!fs.existsSync(configPath)) { + return; + } + + let backupPath = `${configPath}.bak`; + let index = 1; + while (fs.existsSync(backupPath)) { + backupPath = `${configPath}.bak${index}`; + index += 1; + } + + fs.renameSync(configPath, backupPath); + } + static getRyuPath() { const config = Config.readFile(); return config.ryuPath; diff --git a/src/main/menu.ts b/src/main/menu.ts index c8c5755..9a80374 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -5,6 +5,7 @@ import { BrowserWindow, MenuItemConstructorOptions, } from 'electron'; +import Config from './config'; interface DarwinMenuItemConstructorOptions extends MenuItemConstructorOptions { selector?: string; @@ -198,8 +199,15 @@ export default class MenuBuilder { label: '&File', submenu: [ { - label: '&Open', - accelerator: 'Ctrl+O', + label: '&Reset Launcher Config', + click: () => { + Config.resetConfig(); + app.relaunch(); + app.quit(); + }, + }, + { + type: 'separator', }, { label: '&Close',