From 6d6b9f39d62e568b27f4d5640744f26619bd8890 Mon Sep 17 00:00:00 2001 From: Ivan Martell Date: Thu, 29 Aug 2024 19:21:50 +0900 Subject: [PATCH] Separate settings for each profile --- LittleWarGameClient/Handlers/SettingsHandler.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LittleWarGameClient/Handlers/SettingsHandler.cs b/LittleWarGameClient/Handlers/SettingsHandler.cs index 6b7e149..3d650d8 100644 --- a/LittleWarGameClient/Handlers/SettingsHandler.cs +++ b/LittleWarGameClient/Handlers/SettingsHandler.cs @@ -5,7 +5,7 @@ namespace LittleWarGameClient.Handlers { internal class SettingsHandler { - private const string fileName = "Settings.ini"; + private readonly string fileName; private const int defaultWidth = 1280; private const int defaultHeight = 720; private const bool defaultFullscreen = false; @@ -22,6 +22,10 @@ internal class SettingsHandler public SettingsHandler() { + var settingsDirectory = "settings"; + if (!Directory.Exists(settingsDirectory)) + Directory.CreateDirectory(settingsDirectory); + fileName = Path.Join(settingsDirectory, $"{GameForm.InstanceName}.ini"); if (!File.Exists(fileName)) settings = CreateDefaultIniFile(); else