mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
Merge branch 'dev' into no-boxing
This commit is contained in:
3 files changed
+33
-1
No files matched your search
@@ -18,7 +18,7 @@ public class DummyVoteEvent(DummyBehaviour dummy) : MiraCancelableEvent
|
||||
/// <summary>
|
||||
/// Gets the instance of the dummy's <see cref="PlayerVoteData"/>.
|
||||
/// </summary>
|
||||
public PlayerVoteData VoteData => dummy.myPlayer.GetVoteData();
|
||||
public PlayerVoteData VoteData { get; } = dummy.myPlayer.GetVoteData();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the dummy can vote to skip the meeting.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace MiraAPI.Patches.Hud;
|
||||
|
||||
/// <summary>
|
||||
/// Preloads the Mira wiki/role guide panels when a game starts so opening the guide
|
||||
/// in-game does not cause a noticeable hitch.
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.Awake))]
|
||||
public static class MatchInfoGuidePreloadPatch
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
if (!MatchInfoGuide.Instance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Warning("Preloading Match Info Guide...");
|
||||
RoleGuidePatches.TriggerPreload(MatchInfoGuide.Instance);
|
||||
}
|
||||
}
|
||||
@@ -216,6 +216,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))
|
||||
|
||||
Reference in new issue
Block a user