Skip to content

Commit

Permalink
Just throw nautilus back to the top
Browse files Browse the repository at this point in the history
Probably not ideal but I don't feel like rummaging through the attributes code to grab a reference to the ModOptions manually, and this only runs once per session anyway so who cares
  • Loading branch information
EldritchCarMaker committed Dec 29, 2024
1 parent 40dfdb5 commit 8422105
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Nautilus/Patchers/OptionsPanelPatcher.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using HarmonyLib;
using Nautilus.Handlers;
Expand Down Expand Up @@ -87,8 +88,15 @@ internal static void AddTabs_Postfix(uGUI_OptionsPanel __instance)
modsTab = optionsPanel.AddTab("Mods");
}

var optionsToAdd = new List<ModOptions>(modOptions.Values);

var nautilusOptions = optionsToAdd.FirstOrDefault(options => options.Name == "Nautilus");
optionsToAdd.Remove(nautilusOptions);

nautilusOptions.AddOptionsToPanel(optionsPanel, modsTab);

// adding all other options here
modOptions.Values.ForEach(options => options.AddOptionsToPanel(optionsPanel, modsTab));
optionsToAdd.ForEach(options => options.AddOptionsToPanel(optionsPanel, modsTab));
}

// Class for collapsing/expanding options in 'Mods' tab
Expand Down

0 comments on commit 8422105

Please sign in to comment.