mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Guard EnsurePanel and expose TriggerPreload
This commit is contained in:
1 parent
317fd243b1
commit
d3bce25ef6
1 file changed
+22
-3
@@ -168,6 +168,16 @@ public static class RoleGuidePatches
|
||||
Coroutines.Start(CoPreload(__instance));
|
||||
}
|
||||
|
||||
public static void TriggerPreload(MatchInfoGuide instance)
|
||||
{
|
||||
if (!instance || _populate != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Coroutines.Start(CoPreload(instance));
|
||||
}
|
||||
|
||||
private static IEnumerator CoPreload(MatchInfoGuide instance)
|
||||
{
|
||||
while (instance && (!HudManager.InstanceExists || !GameManager.Instance))
|
||||
@@ -801,9 +811,18 @@ public static class RoleGuidePatches
|
||||
return;
|
||||
}
|
||||
|
||||
var panel = Object.Instantiate(
|
||||
_guide!.MatchInfoRolePanelPrefab,
|
||||
entry.Modifier != null ? _modifiersScroller.Inner : _rolesScroller.Inner);
|
||||
if (!_guide || !_guide!.MatchInfoRolePanelPrefab)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = entry.Modifier != null ? _modifiersScroller?.Inner : _rolesScroller?.Inner;
|
||||
if (parent == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var panel = Object.Instantiate(_guide!.MatchInfoRolePanelPrefab, parent);
|
||||
if (entry.Modifier != null)
|
||||
{
|
||||
panel.SetModifierPanel(entry.Modifier, entry.Amount, entry.Chance);
|
||||
|
||||
Reference in new issue
Block a user