TechbloxModdingAPI/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs

29 lines
779 B
C#
Raw Normal View History

2019-12-14 18:52:24 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2020-05-03 19:31:09 +00:00
using HarmonyLib;
2019-12-14 18:52:24 +00:00
using RobocraftX;
using Svelto.ECS;
using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Events
{
/// <summary>
/// Patch of RobocraftX.FullGameCompositionRoot.SwitchToMenu()
/// </summary>
[HarmonyPatch(typeof(FullGameCompositionRoot), "SwitchToMenu")]
class MenuSwitchedToPatch
{
public static void Postfix()
{
// Event emitters and handlers should already be registered by MenuActivated event
Logging.Log("Dispatching Menu Switched To event");
2019-12-15 07:20:20 +00:00
EventManager.GetEventEmitter("GamecraftModdingAPIMenuSwitchedToEventEmitter").Emit();
2019-12-14 18:52:24 +00:00
}
}
}