You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Harmony;
- using RobocraftX;
- using Svelto.ECS;
-
- using GamecraftModdingAPI.Utility;
-
- namespace GamecraftModdingAPI.Events
- {
- /// <summary>
- /// Patch of RobocraftX.FullGameCompositionRoot.ActivateMenu()
- /// </summary>
- [HarmonyPatch(typeof(FullGameCompositionRoot), "ActivateMenu")]
- class MenuActivatedPatch
- {
-
- private static bool firstLoad = true;
- public static void Postfix(ref EnginesRoot ____frontEndEnginesRoot)
- {
- // A new EnginesRoot is always created when ActivateMenu is called
- // so all event emitters and handlers must be re-registered.
- Manager.RegisterEngines(____frontEndEnginesRoot);
- if (firstLoad)
- {
- firstLoad = false;
- Logging.Log("Dispatching App Init event");
- Manager.GetEventEmitter("GamecraftModdingAPIApplicationInitializedEventEmitter").Emit();
- }
- Logging.Log("Dispatching Menu Activated event");
- Manager.GetEventEmitter("GamecraftModdingAPIMenuActivatedEventEmitter").Emit();
- }
- }
- }
|