private void Run_Awake(On.RoR2.Run.orig_Awake orig, Run self) { CleanUpLeftovers(); orig.Invoke(self); //Dont know wheter or not I am allow to hook everything down here but hey if (!RoR2Application.isInSinglePlayer) { Chat.AddMessage("<color=blue>Command Artifact NOT Loaded</color>"); Chat.AddMessage("Command Artifact is currently not supported in multiplayer. Hope you still enjoy it tho ♥"); On.EntityStates.Barrel.Opening.OnEnter -= Opening_OnEnter; On.RoR2.PurchaseInteraction.OnInteractionBegin -= PurchaseInteraction_OnInteractionBegin; On.RoR2.Run.Update -= Run_Update; hooked = false; return; } else { if (!hooked) { On.EntityStates.Barrel.Opening.OnEnter += Opening_OnEnter; On.RoR2.PurchaseInteraction.OnInteractionBegin += PurchaseInteraction_OnInteractionBegin; On.RoR2.Run.Update += Run_Update; hooked = true; } } //SetGlobalTimeScaleV2(config.TimeScaleDefault); Chat.AddMessage("<color=blue>Command Artifact Loaded</color>"); init = false; }
private void Run_Awake(On.RoR2.Run.orig_Awake orig, Run self) { orig.Invoke(self); //Readd the hook On.RoR2.Run.Update += Run_Update; }
private void Run_Awake(On.RoR2.Run.orig_Awake orig, RoR2.Run self) { orig.Invoke(self); RoR2.Chat.AddMessage("<color=blue>Command Artifact Loaded</color>"); //Unhook non host related stuff //Had issues when everyone hooked them ... On.EntityStates.Barrel.Opening.OnEnter -= Opening_OnEnter; On.RoR2.PurchaseInteraction.OnInteractionBegin -= PurchaseInteraction_OnInteractionBegin; //Makes sure the Update Function is hooked at the start! On.RoR2.Run.Update += Run_Update; }