From 8a6f4f78262b6b440de0ce1f319144455418eef3 Mon Sep 17 00:00:00 2001 From: Raiyan Date: Sat, 18 Jul 2026 07:19:37 +0700 Subject: [PATCH] [GUI] Per-game launch settings + shared SettingRow (#2) (#378) Add per-game launch overrides (log level, import-trace limit, strict dynlib resolution, log-to-file, and SHARPEMU_* environment toggles) with three-tier resolution (per-game override -> global preference -> built-in default), stored one file per game at user/custom_configs/.json. Editable from a new "Game settings..." context-menu dialog. Introduce a shared SettingRow control and adopt it across the Options page and the per-game dialog so the two read as one app. Fully localized (reusing the existing Options.* keys), with the actions pinned in the dialog footer. --- src/SharpEmu.GUI/App.axaml | 24 +++ src/SharpEmu.GUI/Languages/en.json | 8 + src/SharpEmu.GUI/MainWindow.axaml | 245 ++++++++-------------- src/SharpEmu.GUI/MainWindow.axaml.cs | 107 ++++++---- src/SharpEmu.GUI/PerGameSettings.cs | 115 ++++++++++ src/SharpEmu.GUI/PerGameSettingsDialog.cs | 205 ++++++++++++++++++ src/SharpEmu.GUI/SettingRow.cs | 101 +++++++++ 7 files changed, 603 insertions(+), 202 deletions(-) create mode 100644 src/SharpEmu.GUI/PerGameSettings.cs create mode 100644 src/SharpEmu.GUI/PerGameSettingsDialog.cs create mode 100644 src/SharpEmu.GUI/SettingRow.cs diff --git a/src/SharpEmu.GUI/App.axaml b/src/SharpEmu.GUI/App.axaml index e1e3554d..73ad1099 100644 --- a/src/SharpEmu.GUI/App.axaml +++ b/src/SharpEmu.GUI/App.axaml @@ -5,6 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later @@ -32,6 +33,29 @@ SPDX-License-Identifier: GPL-2.0-or-later + + + + + + + + + + + + + + + + + diff --git a/src/SharpEmu.GUI/Languages/en.json b/src/SharpEmu.GUI/Languages/en.json index 727df964..bf85c064 100644 --- a/src/SharpEmu.GUI/Languages/en.json +++ b/src/SharpEmu.GUI/Languages/en.json @@ -15,6 +15,7 @@ "Library.Context.OpenFolder": "Open game folder", "Library.Context.CopyPath": "Copy path", "Library.Context.CopyTitleId": "Copy title ID", + "Library.Context.GameSettings": "Game settings…", "Library.Context.Remove": "Remove from library", "Library.Empty.Title": "Your library is empty", @@ -81,6 +82,13 @@ "Common.On": "On", "Common.Off": "Off", + "Common.Save": "Save", + "Common.Cancel": "Cancel", + + "PerGame.Title": "Per-game settings — {0} ({1})", + "PerGame.InheritNote": "Unchecked rows inherit the global defaults.", + "PerGame.EnvToggles.Label": "Environment toggles", + "PerGame.EnvToggles.Desc": "Override the global set of SHARPEMU_* switches for this game.", "Console.Title": "CONSOLE", "Console.SearchWatermark": "Search...", diff --git a/src/SharpEmu.GUI/MainWindow.axaml b/src/SharpEmu.GUI/MainWindow.axaml index 3a1b92c8..8d6276a7 100644 --- a/src/SharpEmu.GUI/MainWindow.axaml +++ b/src/SharpEmu.GUI/MainWindow.axaml @@ -126,6 +126,13 @@ SPDX-License-Identifier: GPL-2.0-or-later + + + + + + @@ -199,27 +206,19 @@ SPDX-License-Identifier: GPL-2.0-or-later - - - - - - + - + - - - - - - + - + @@ -227,13 +226,9 @@ SPDX-License-Identifier: GPL-2.0-or-later - - - - - - + @@ -242,49 +237,32 @@ SPDX-License-Identifier: GPL-2.0-or-later - + - - - - - - + - + - - - - - - + - + - - - - - -