From 2a598bda6592c76fd92e9e52db2e45605ff4d7f1 Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:47:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=AF=B9=20gui.json=20=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Helper/ConfigurationHelper.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/MaaWpfGui/Helper/ConfigurationHelper.cs b/src/MaaWpfGui/Helper/ConfigurationHelper.cs index 68e3bca0e5..a4ee4b9270 100644 --- a/src/MaaWpfGui/Helper/ConfigurationHelper.cs +++ b/src/MaaWpfGui/Helper/ConfigurationHelper.cs @@ -277,12 +277,17 @@ namespace MaaWpfGui.Helper try { + var sortedKvsMap = new SortedDictionary>( + _kvsMap.ToDictionary( + kvp => kvp.Key, + kvp => new SortedDictionary(kvp.Value))); + var jsonStr = JsonConvert.SerializeObject( - new Dictionary + new SortedDictionary { - { ConfigurationKeys.ConfigurationMap, _kvsMap }, + { ConfigurationKeys.ConfigurationMap, sortedKvsMap }, { ConfigurationKeys.CurrentConfiguration, _current }, - { ConfigurationKeys.GlobalConfiguration, _globalKvs }, + { ConfigurationKeys.GlobalConfiguration, new SortedDictionary(_globalKvs) }, }, Formatting.Indented);