From decd64d775f72f55506d5b8ad315f64ce1b9b4de Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Thu, 8 Dec 2022 22:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E4=B8=BAAll=E5=88=86=E7=BB=84=E7=9A=84=E6=97=B6=E5=80=99=20?= =?UTF-8?q?=E4=BC=9A=E5=88=B7=E6=96=B0=E4=B8=A4=E6=AC=A1=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tools/ModManager/ModManager.xaml | 2 +- Tools/ModManager/ModManager.xaml.cs | 31 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Tools/ModManager/ModManager.xaml b/Tools/ModManager/ModManager.xaml index d635ba2..4cbe74e 100644 --- a/Tools/ModManager/ModManager.xaml +++ b/Tools/ModManager/ModManager.xaml @@ -80,7 +80,7 @@ - + diff --git a/Tools/ModManager/ModManager.xaml.cs b/Tools/ModManager/ModManager.xaml.cs index 2aa736a..e9dba8b 100644 --- a/Tools/ModManager/ModManager.xaml.cs +++ b/Tools/ModManager/ModManager.xaml.cs @@ -81,7 +81,7 @@ public partial class ModManager : Page bool groupMenuOpen = false; bool showModInfo = false; string? nowSelectedMod = null; - string nowGroup = ModGroupType.All; + string nowGroup = string.Empty; Thread remindSaveThread = null!; ListBoxItem? nowSelectedListBoxItem = null; HashSet allEnabledModsId = new(); @@ -271,10 +271,10 @@ private void ListBox_ModsGroupMenu_SelectionChanged(object sender, SelectionChan { if (listBox.Name == ListBox_ModsGroupMenu.Name) { - ListBox_GroupType.SelectedIndex = -1; + ListBox_ModTypeGroup.SelectedIndex = -1; ListBox_UserGroup.SelectedIndex = -1; } - else if (listBox.Name == ListBox_GroupType.Name) + else if (listBox.Name == ListBox_ModTypeGroup.Name) { ListBox_ModsGroupMenu.SelectedIndex = -1; ListBox_UserGroup.SelectedIndex = -1; @@ -282,18 +282,21 @@ private void ListBox_ModsGroupMenu_SelectionChanged(object sender, SelectionChan else if (listBox.Name == ListBox_UserGroup.Name) { ListBox_ModsGroupMenu.SelectedIndex = -1; - ListBox_GroupType.SelectedIndex = -1; + ListBox_ModTypeGroup.SelectedIndex = -1; + } + if (item != nowSelectedListBoxItem) + { + nowSelectedListBoxItem = item; + if (allUserGroups.ContainsKey(item.ToolTip.ToString()!)) + Expander_RandomEnable.Visibility = Visibility.Visible; + else + Expander_RandomEnable.Visibility = Visibility.Collapsed; + nowGroup = item.Tag.ToString()!; + SearchMods(TextBox_SearchMods.Text); + ClearDataGridSelected(); + CloseModInfo(); + GC.Collect(); } - nowSelectedListBoxItem = item; - if (allUserGroups.ContainsKey(item.ToolTip.ToString()!)) - Expander_RandomEnable.Visibility = Visibility.Visible; - else - Expander_RandomEnable.Visibility = Visibility.Collapsed; - nowGroup = item.Tag.ToString()!; - ClearDataGridSelected(); - SearchMods(TextBox_SearchMods.Text); - CloseModInfo(); - GC.Collect(); } } private void DataGridItem_Selected(object sender, RoutedEventArgs e)