mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Fix LobbyViewPane inlining
This commit is contained in:
1 parent
1298beb517
commit
35be381a77
1 file changed
+16
-5
@@ -113,14 +113,16 @@ public static class LobbyViewPanePatches
|
||||
menu.scrollBar.ScrollToTop();
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(LobbyViewSettingsPane.SetTab))]
|
||||
public static bool SetTabPatch(LobbyViewSettingsPane __instance)
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(nameof(LobbyViewSettingsPane.ChangeTab))]
|
||||
[HarmonyPatch(nameof(LobbyViewSettingsPane.RefreshTab))]
|
||||
// CHANGED BECAUSE OF INLINING
|
||||
public static void SetTabPatch(LobbyViewSettingsPane __instance)
|
||||
{
|
||||
if (__instance.currentTab != ModifiersTabName || SelectedMod == null)
|
||||
{
|
||||
ModifiersTabButton?.SelectButton(false);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
__instance.taskTabButton.SelectButton(false);
|
||||
@@ -130,7 +132,6 @@ public static class LobbyViewPanePatches
|
||||
var filteredGroups = SelectedMod.OptionGroups
|
||||
.Where(x => x.GroupVisible() && (x.ShowInModifiersMenu || x.OptionableType?.IsAssignableTo(typeof(BaseModifier)) == true));
|
||||
DrawOptions(__instance, filteredGroups);
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
@@ -142,6 +143,11 @@ public static class LobbyViewPanePatches
|
||||
return true;
|
||||
}
|
||||
|
||||
if (__instance.currentTab == ModifiersTabName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var filteredGroups = SelectedMod.OptionGroups
|
||||
.Where(x => x is { ShowInModifiersMenu: false, OptionableType: null } && x.GroupVisible.Invoke());
|
||||
DrawOptions(__instance, filteredGroups);
|
||||
@@ -157,6 +163,11 @@ public static class LobbyViewPanePatches
|
||||
return true;
|
||||
}
|
||||
|
||||
if (__instance.currentTab == ModifiersTabName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
DrawRolesTab(__instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user