Skip to content

Commit 5a48325

Browse files
2 parents 6d7d724 + cb715b1 commit 5a48325

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

Menu/Main.cs

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,19 +1060,20 @@ public static void Prefix()
10601060

10611061
if (currentCategoryName == "Enabled Mods")
10621062
{
1063-
List<string> enabledMods = new List<string>() { "Exit Enabled Mods" };
1063+
List<ButtonInfo> enabledMods = new List<ButtonInfo>() { };
10641064
int categoryIndex = 0;
10651065
foreach (ButtonInfo[] buttonlist in Buttons.buttons)
10661066
{
10671067
foreach (ButtonInfo v in buttonlist)
10681068
{
1069-
if (v.enabled && (!hideSettings || (hideSettings && !Buttons.categoryNames[categoryIndex].Contains("Settings"))))
1070-
enabledMods.Add(v.buttonText);
1069+
if (v.enabled && (!hideSettings || !Buttons.categoryNames[categoryIndex].Contains("Settings")))
1070+
enabledMods.Add(v);
10711071
}
10721072
categoryIndex++;
10731073
}
1074-
enabledMods = Alphabetize(enabledMods.ToArray()).ToList();
1075-
toSortOf = StringsToInfos(enabledMods.ToArray());
1074+
enabledMods = enabledMods.OrderBy(v => v.buttonText).ToList();
1075+
enabledMods.Insert(0, GetIndex("Exit Enabled Mods"));
1076+
toSortOf = enabledMods.ToArray();
10761077
}
10771078

10781079
Text watchTextText = watchText.GetComponent<Text>();
@@ -2705,8 +2706,19 @@ public static void Draw()
27052706
}
27062707
else if (currentCategoryName == "Enabled Mods")
27072708
{
2708-
List<ButtonInfo> enabledMods = new List<ButtonInfo>() { GetIndex("Exit Enabled Mods") };
2709-
enabledMods.AddRange(Buttons.buttons.SelectMany(buttonlist => buttonlist).Where(v => v.enabled));
2709+
List<ButtonInfo> enabledMods = new List<ButtonInfo>() { };
2710+
int categoryIndex = 0;
2711+
foreach (ButtonInfo[] buttonlist in Buttons.buttons)
2712+
{
2713+
foreach (ButtonInfo v in buttonlist)
2714+
{
2715+
if (v.enabled && (!hideSettings || !Buttons.categoryNames[categoryIndex].Contains("Settings")))
2716+
enabledMods.Add(v);
2717+
}
2718+
categoryIndex++;
2719+
}
2720+
enabledMods = enabledMods.OrderBy(v => v.buttonText).ToList();
2721+
enabledMods.Insert(0, GetIndex("Exit Enabled Mods"));
27102722

27112723
renderButtons = enabledMods.ToArray();
27122724
}
@@ -5573,13 +5585,15 @@ public static void Toggle(string buttonText, bool fromMenu = false, bool ignoreF
55735585
if (currentCategoryName == "Enabled Mods")
55745586
{
55755587
List<string> enabledMods = new List<string>() { "Exit Enabled Mods" };
5588+
int categoryIndex = 0;
55765589
foreach (ButtonInfo[] buttonlist in Buttons.buttons)
55775590
{
55785591
foreach (ButtonInfo v in buttonlist)
55795592
{
5580-
if (v.enabled)
5593+
if (v.enabled && (!hideSettings || !Buttons.categoryNames[categoryIndex].Contains("Settings")))
55815594
enabledMods.Add(v.buttonText);
55825595
}
5596+
categoryIndex++;
55835597
}
55845598
lastPage = ((enabledMods.Count + pageSize - 1) / pageSize) - 1;
55855599
}

0 commit comments

Comments
 (0)