mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +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));
|
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)
|
private static IEnumerator CoPreload(MatchInfoGuide instance)
|
||||||
{
|
{
|
||||||
while (instance && (!HudManager.InstanceExists || !GameManager.Instance))
|
while (instance && (!HudManager.InstanceExists || !GameManager.Instance))
|
||||||
@@ -801,9 +811,18 @@ public static class RoleGuidePatches
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var panel = Object.Instantiate(
|
if (!_guide || !_guide!.MatchInfoRolePanelPrefab)
|
||||||
_guide!.MatchInfoRolePanelPrefab,
|
{
|
||||||
entry.Modifier != null ? _modifiersScroller.Inner : _rolesScroller.Inner);
|
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)
|
if (entry.Modifier != null)
|
||||||
{
|
{
|
||||||
panel.SetModifierPanel(entry.Modifier, entry.Amount, entry.Chance);
|
panel.SetModifierPanel(entry.Modifier, entry.Amount, entry.Chance);
|
||||||
|
|||||||
Reference in new issue
Block a user