mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Fix all scrolling issues (i think)
This commit is contained in:
1 parent
e0c1038658
commit
1933bb73bd
3 files changed
+9
-7
No files matched your search
@@ -30,7 +30,7 @@ public static class GameOptionsMenuPatch
|
||||
|
||||
foreach (IModdedOptionGroup group in filteredGroups)
|
||||
{
|
||||
var filteredOpts = ModdedOptionsManager.Groups[group].Where(x=>x.Visible.Invoke()).ToList();
|
||||
var filteredOpts = ModdedOptionsManager.Groups[group].Where(x => x.Visible.Invoke()).ToList();
|
||||
if (filteredOpts.Count == 0)
|
||||
{
|
||||
continue;
|
||||
@@ -83,7 +83,6 @@ public static class GameOptionsMenuPatch
|
||||
}
|
||||
|
||||
__instance.scrollBar.SetYBoundsMax(-num - 1.65f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,12 +116,14 @@ public static class GameSettingMenuPatches
|
||||
roleChance.gameObject.DestroyImmediate();
|
||||
}
|
||||
|
||||
|
||||
roles.roleChances.Clear();
|
||||
roles.roleChances = null;
|
||||
roles.AdvancedRolesSettings.gameObject.SetActive(false);
|
||||
roles.RoleChancesSettings.gameObject.SetActive(true);
|
||||
roles.SetQuotaTab();
|
||||
|
||||
roles.scrollBar.CalculateAndSetYBounds(roles.roleChances.Count + 3, 1f, 6f, 0.43f);
|
||||
roles.scrollBar.ScrollToTop();
|
||||
}
|
||||
|
||||
if (settings?.Children != null)
|
||||
@@ -150,6 +152,7 @@ public static class GameSettingMenuPatches
|
||||
settings.Children = null;
|
||||
|
||||
settings.Initialize();
|
||||
settings.scrollBar.ScrollToTop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using HarmonyLib;
|
||||
using MiraAPI.Networking;
|
||||
using MiraAPI.Roles;
|
||||
using MiraAPI.Utilities;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using Reactor.Networking.Rpc;
|
||||
using Reactor.Utilities;
|
||||
using Reactor.Utilities.Extensions;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using MiraAPI.Networking;
|
||||
using Reactor.Networking.Rpc;
|
||||
using Reactor.Utilities;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
@@ -207,7 +207,7 @@ public static class RoleSettingMenuPatches
|
||||
{
|
||||
ICustomRole customRole = role as ICustomRole;
|
||||
__instance.roleDescriptionText.text = customRole.RoleLongDescription;
|
||||
__instance.roleTitleText.text = DestroyableSingleton<TranslationController>.Instance.GetString(role.StringName, []);
|
||||
__instance.roleTitleText.text = DestroyableSingleton<TranslationController>.Instance.GetString(role.StringName, Array.Empty<Il2CppSystem.Object>());
|
||||
__instance.roleScreenshot.sprite = Sprite.Create(customRole.OptionsScreenshot.LoadAsset().texture, new Rect(0, 0, 370, 230), Vector2.one / 2, 100);
|
||||
__instance.roleScreenshot.drawMode = SpriteDrawMode.Sliced;
|
||||
__instance.roleHeaderSprite.color = customRole.RoleColor;
|
||||
|
||||
Reference in new issue
Block a user