From 6a2555eeadc12b510ae66c05cbe65609dab4120f Mon Sep 17 00:00:00 2001 From: Conti Date: Mon, 28 Jun 2021 16:17:34 +0200 Subject: [PATCH] small bugfix fixed bug where the last config value would sometimes float below the settings panel --- src/UI.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/UI.cs b/src/UI.cs index c4f5389..7ba0c59 100644 --- a/src/UI.cs +++ b/src/UI.cs @@ -109,6 +109,7 @@ private static void CreateCategoryPage(MelonPreferences_Category category) modMenuOM.scrollable.AddRow(categoryHeader); int buttonIndex = 0; + int totalIndex = 0; Il2CppGeneric.List row = new Il2CppGeneric.List(); foreach (var pref in category.Entries) { @@ -198,6 +199,7 @@ private static void CreateCategoryPage(MelonPreferences_Category category) default: break; } + totalIndex++; if (row.Count == 2) { //This is the dumbest code I've ever wrote. @@ -207,12 +209,12 @@ private static void CreateCategoryPage(MelonPreferences_Category category) modMenuOM.scrollable.AddRow(tempRow); row.Clear(); } - else if (buttonIndex == category.Entries.Count && buttonIndex % 2 == 1) // This might be obsolete + //else if (buttonIndex == category.Entries.Count && buttonIndex % 2 == 1) // This might be obsolete + else if (totalIndex == category.Entries.Count) { modMenuOM.scrollable.AddRow(row[0]); row.Clear(); } - } }