mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Fix advanced role settings being unscrollable
This commit is contained in:
1 parent
55a2161876
commit
b919c55ef1
1 file changed
+11
-2
@@ -381,7 +381,7 @@ public static class RoleSettingMenuPatches
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetScrollBounds(this Scroller scroller, RolesSettingsMenu roleMenu)
|
private static void SetScrollBounds(this Scroller scroller, RolesSettingsMenu roleMenu, bool isRolesConfig = false)
|
||||||
{
|
{
|
||||||
if (MenuState.Instance.CurrentModIdx == 0)
|
if (MenuState.Instance.CurrentModIdx == 0)
|
||||||
{
|
{
|
||||||
@@ -389,6 +389,15 @@ public static class RoleSettingMenuPatches
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isRolesConfig)
|
||||||
|
{
|
||||||
|
scroller.Inner = roleMenu.AdvancedRolesSettings.transform;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scroller.Inner = MenuState.Instance.CurrentContainer.transform;
|
||||||
|
}
|
||||||
|
|
||||||
scroller.SetYBoundsMax(-ScrollerNum - 2);
|
scroller.SetYBoundsMax(-ScrollerNum - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +411,6 @@ public static class RoleSettingMenuPatches
|
|||||||
|
|
||||||
var hasImage = CurrentRole.RoleScreenshot != null;
|
var hasImage = CurrentRole.RoleScreenshot != null;
|
||||||
var num = hasImage ? -0.872f : -1;
|
var num = hasImage ? -0.872f : -1;
|
||||||
|
|
||||||
foreach (var opt in CurrentRoleOptions)
|
foreach (var opt in CurrentRoleOptions)
|
||||||
{
|
{
|
||||||
if (opt.OptionBehaviour == null) continue;
|
if (opt.OptionBehaviour == null) continue;
|
||||||
@@ -616,6 +624,7 @@ public static class RoleSettingMenuPatches
|
|||||||
|
|
||||||
__instance.RoleChancesSettings.SetActive(false);
|
__instance.RoleChancesSettings.SetActive(false);
|
||||||
__instance.AdvancedRolesSettings.SetActive(true);
|
__instance.AdvancedRolesSettings.SetActive(true);
|
||||||
|
__instance.scrollBar.SetScrollBounds(__instance, true);
|
||||||
__instance.RefreshChildren();
|
__instance.RefreshChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user