private void Awake() { Logger = base.Logger; cardHeight = Config.Bind(new ConfigDefinition("H Scene", "Height from card"), true, new ConfigDescription("Set players height according to the value in the card")); customHeight = Config.Bind(new ConfigDefinition("H Scene", "Custom height"), 75, new ConfigDescription("If 'Height from card' is off, use this value instead'", new AcceptableValueRange <int>(-100, 200))); cardHeight2nd = Config.Bind(new ConfigDefinition("H Scene", "Height from card 2nd"), true, new ConfigDescription("Set players height according to the value in the card for 2nd male")); customHeight2nd = Config.Bind(new ConfigDefinition("H Scene", "Custom height 2nd"), 75, new ConfigDescription("If 'Height from card' is off, use this value instead for 2nd male", new AcceptableValueRange <int>(-100, 200))); var harmony = new HarmonyLib.Harmony("HS2_UnlockPlayerHeight"); harmony.PatchAll(typeof(CoreHooks)); if (Application.productName != "HoneySelect2") { return; } cardHeight.SettingChanged += delegate { ApplySettings(false); }; customHeight.SettingChanged += delegate { ApplySettings(false); }; cardHeight2nd.SettingChanged += delegate { ApplySettings(true); }; customHeight2nd.SettingChanged += delegate { ApplySettings(true); }; harmony.PatchAll(typeof(GameHooks)); }
private void Awake() { instance = this; Logger = base.Logger; alignCamera = Config.Bind(new ConfigDefinition("Camera", "Align camera to player height"), true, new ConfigDescription("Aligns camera position according to player height")); lookAtOffset = Config.Bind(new ConfigDefinition("Camera", "Camera y offset"), 0f, new ConfigDescription("Camera lookAt y offset", new AcceptableValueRange <float>(-10f, 10f))); lookAtPOVOffset = Config.Bind(new ConfigDefinition("Camera", "Camera POV y offset"), 0f, new ConfigDescription("Camera lookAtPOV y offset", new AcceptableValueRange <float>(-10f, 10f))); cardHeight = Config.Bind(new ConfigDefinition("Free Roam & Events", "Height from card"), true, new ConfigDescription("Set players height according to the value in the card")); customHeight = Config.Bind(new ConfigDefinition("Free Roam & Events", "Custom height"), 75, new ConfigDescription("If 'Height from card' is off, use this value instead", new AcceptableValueRange <int>(-100, 200))); cardHeightDuringH = Config.Bind(new ConfigDefinition("H Scene", "Height from card (H)"), false, new ConfigDescription("Set players height according to the value in the card")); customHeightDuringH = Config.Bind(new ConfigDefinition("H Scene", "Custom height (H)"), 75, new ConfigDescription("If 'Height from card' is off, use this value instead", new AcceptableValueRange <int>(-100, 200))); var harmony = new HarmonyLib.Harmony("HS2_UnlockPlayerHeight"); harmony.PatchAll(typeof(CoreHooks)); if (Application.productName != "AI-Syoujyo" && Application.productName != "AI-Shoujo") { return; } alignCamera.SettingChanged += delegate { ApplySettings(actor); }; lookAtOffset.SettingChanged += delegate { ApplySettings(actor); }; cardHeight.SettingChanged += delegate { ApplySettings(actor); }; customHeight.SettingChanged += delegate { ApplySettings(actor); }; cardHeightDuringH.SettingChanged += delegate { ApplySettings(actor); }; customHeightDuringH.SettingChanged += delegate { ApplySettings(actor); }; harmony.PatchAll(typeof(GameHooks)); }
public override void OnEnabled() { try { Instance = this; NPCPlugin = (NPCS.Plugin)Exiled.Loader.Loader.Plugins.Where(p => p.Name == "CustomNPCs").FirstOrDefault(); if (NPCPlugin == null) { Log.Error("Failed to load Stalky106 compat module addon: CustomNPCs not found!"); return; } if (Exiled.Loader.Loader.Plugins.Where(p => p.Prefix == "ST106").FirstOrDefault() == null) { Log.Error("Failed to load Stalky106 compat module addon: Stalky106 not found!"); return; } Harmony = new HarmonyLib.Harmony("gamehunt.compat.stalky106"); Harmony.PatchAll(); Log.Info($"Stalky106 compat module loaded. @gamehunt"); } catch (Exception e) { //This try catch is redundant, as EXILED will throw an error before this block can, but is here as an example of how to handle exceptions/errors Log.Error($"There was an error loading the plugin: {e}"); } }
static Boot() { if (Initialized) { return; } try { LoadAll(); Initialized = true; HarmonyLib.Harmony harmony = new HarmonyLib.Harmony("QTRHacker.Patches"); harmony.PatchAll(); List <GameInterfaceLayer> layers = typeof(Main).GetField("_gameInterfaceLayers", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(Main.instance) as List <GameInterfaceLayer>; int index = layers.FindIndex(t => t.Name == "Vanilla: Mouse Text"); layers.Insert(index, new LegacyGameInterfaceLayer("QTRHacker: Game", delegate { try { OnGameDraw?.Invoke(Main.spriteBatch); } catch (Exception e) { File.AppendAllText("./QTRHacker.Patches.Exceptions.log", $"{e.GetType()}:{e.Message}\n{e.StackTrace}\n"); } return(true); }, InterfaceScaleType.Game)); } catch (Exception e) { File.WriteAllText("./QTRHacker.Patches.boot.log", $"{e.GetType()}:{e.Message}\n{e.StackTrace}\n"); } }
public async void OnApplicationStart() { // Harmony Harmony = new HarmonyLib.Harmony(HarmonyId); Harmony.PatchAll(Assembly.GetExecutingAssembly()); // Assets Sprites.Initialize(); // HTTP client HttpClient = new HttpClient(); HttpClient.DefaultRequestHeaders.Add("User-Agent", Plugin.UserAgent); HttpClient.DefaultRequestHeaders.Add("X-BSSB", "✔"); // BS Events BSEvents.lateMenuSceneLoadedFresh += OnLateMenuSceneLoadedFresh; // Start update timer UpdateTimer.Start(); // Detect platform // Note - currently (will be fixed in BS utils soon!): if the health warning is skipped (like in fpfc mode), // this await will hang until a song is played, so the platform will be stuck on "unknown" til then await DetectPlatform(); }
public void OnApplicationStart() { SongCore.Collections.RegisterCapability("GameSaber"); var harmony = new HarmonyLib.Harmony("GameSaber"); harmony.PatchAll(); }
public Mod(ModContentPack content) : base(content) { #if HARMONY_1_2 var harmony = Harmony.HarmonyInstance.Create("likeafox.rimworld.haulexplicitly"); #elif HARMONY_2_0 var harmony = new HarmonyLib.Harmony("likeafox.rimworld.haulexplicitly"); #endif harmony.PatchAll(Assembly.GetExecutingAssembly()); }
public void OnApplicationStart() { var harmony = new HarmonyLib.Harmony("com.kyle1413.beatsaber.diffreducer"); harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly()); BeatSaberMarkupLanguage.GameplaySetup.GameplaySetup.instance.AddTab("DiffReducer", "DiffReducer.UI.modifierUI.bsml", UI.ModifierUI.instance, BeatSaberMarkupLanguage.GameplaySetup.MenuType.Solo); BS_Utils.Utilities.BSEvents.lateMenuSceneLoadedFresh += BSEvents_lateMenuSceneLoadedFresh; Config.Read(); }
public Mod(ModContentPack content) : base(content) { Settings = GetSettings <Settings>(); ModName = content.Name; var harmony = new HarmonyLib.Harmony("FrontierDevelopments.Shields"); harmony.PatchAll(Assembly.GetExecutingAssembly()); }
////////////////////// // VRChat Methods // ////////////////////// public override void OnApplicationStart() { ExpansionKitApi.OnUiManagerInit += OnUiManagerInit; videoList = new List <ModVideo>(); MelonCoroutines.Start(InitializeLibrary()); MelonCoroutines.Start(LoadMenu()); hInstance = new HarmonyLib.Harmony("com.StonedCode.VRCVideoLibrary"); hInstance.PatchAll(); }
static bool Load(UnityModManager.ModEntry modEntry) { //modEntry.OnToggle = OnToggle; harmony = new HarmonyLib.Harmony(modEntry.Info.Id); harmony.PatchAll(Assembly.GetExecutingAssembly()); return(true); }
static PatchLoader() { var instance = new HarmonyLib.Harmony("pawn.education"); instance.PatchAll(Assembly.GetExecutingAssembly()); var message = "pawn.education : patched DoListingItems"; ModSettings.ReadModSettings(ref message); Log.Message(message); }
public Module(ModContentPack content) : base(content) { var harmony = new HarmonyLib.Harmony("FrontierDevelopments.Shields1.2"); harmony.PatchAll(Assembly.GetExecutingAssembly()); Harmony_Verb.BlacklistType(typeof(Verb_Bombardment)); // support for Cargo Pod transport Harmony_Skyfaller.WhitelistDef("HelicopterIncoming"); Harmony_Skyfaller.WhitelistDef("HelicopterLeaving"); }
internal static void ApplyHarmonyPatches() { try { Plugin.Log?.Debug("Applying Harmony patches."); harmony.PatchAll(Assembly.GetExecutingAssembly()); } catch (Exception ex) { Plugin.Log?.Error("Error applying Harmony patches: " + ex.Message); Plugin.Log?.Debug(ex); } }
public Base(ModContentPack content) : base(content) { var harm = new HarmonyLib.Harmony("legodude17.mvcf"); harm.PatchAll(Assembly.GetExecutingAssembly()); SearchLabel = harm.Id + Rand.Value; Prepatcher = ModLister.HasActiveModWithName("Prepatcher"); if (Prepatcher) { Log.Message("[MVCF] Prepatcher installed, switching"); } Compat.ApplyCompat(harm); }
public override void OnEnabled() { if (Config.IsEnabled) { instance = new HarmonyLib.Harmony($"abastien.seedmaker.{++counter}"); instance.PatchAll(); } else { Data.isRandom.Reset(); Data.currentSeed.Reset(); } }
static bool Load(UnityModManager.ModEntry modEntry) { try { logger = modEntry.Logger; harmony = new HarmonyLib.Harmony(modEntry.Info.Id); harmony.PatchAll(Assembly.GetExecutingAssembly()); } catch (Exception ex) { DebugError(ex); throw ex; } return(true); }
public static bool Load(UnityModManager.ModEntry modEntry) { Logger = modEntry.Logger; Settings = Settings.Load <Settings>(modEntry); modEntry.OnGUI = new Action <UnityModManager.ModEntry>(Main.OnGUI); modEntry.OnSaveGUI = new Action <UnityModManager.ModEntry>(Main.OnSaveGUI); modEntry.OnToggle = new Func <UnityModManager.ModEntry, bool, bool>(Main.OnToggle); modEntry.OnUnload = new Func <UnityModManager.ModEntry, bool>(Main.OnUnload); WeaponFocus.Init(modEntry.Path); HarmonyInstance = new HarmonyLib.Harmony(modEntry.Info.Id); HarmonyInstance.PatchAll(typeof(Main).Assembly); return(true); }
internal void Awake() { try { var harmony = new HarmonyLib.Harmony(ID); harmony.PatchAll(); CustomKeybindings.AddAction("QuickSave", KeybindingsCategory.CustomKeybindings, ControlType.Keyboard); //CustomKeybindings.AddAction("QuickLoad", KeybindingsCategory.Actions, ControlType.Both, 5); MyLogger.LogDebug("Awaken"); } catch (Exception ex) { MyLogger.LogError(ex.Message); } }
static PatchLoader() { var rimHudPatched = false; var instance = new HarmonyLib.Harmony("banish.animals"); ModContentPack rimHUD = LoadedModManager.RunningMods.FirstOrDefault((ModContentPack mod) => mod.Name.Contains("RimHUD")); if (rimHUD != null) { rimHudPatched = RimHUD_Compatibility.LoadRimHUDCompatibility(instance, rimHUD); } if (!rimHudPatched) { instance.PatchAll(Assembly.GetExecutingAssembly()); Log.Message("banish.animals : patched DoInspectPaneButtons", false); } }
public void OnApplicationStart() { //Harmony Harmony = new HarmonyLib.Harmony(HarmonyId); Harmony.PatchAll(Assembly.GetExecutingAssembly()); ControllersHelper.Init(); new GameObject("MicMuterController").AddComponent <MicMuterController>(); //Gameplay events to mute/unmute EventMute.Setup(); //Register mod settings menu button BSMLSettings.instance.AddSettingsMenu("MicMuter", "MicMuter.UI.ConfigView.bsml", ConfigView.instance); //Microphone device setup MicDeviceUtils.Setup(); }
public override void OnEnabled() { foreach (MethodBase bas in Evs.Events.Instance.Harmony.GetPatchedMethods()) { if (bas.Name.Equals("TransmitData")) { Exiled.Events.Events.DisabledPatchesHashSet.Add(bas); } } Evs.Events.Instance.ReloadDisabledPatches(); pluginDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "EXILED", "Plugins", "PlayerRecorder"); if (!Directory.Exists(pluginDir)) { Directory.CreateDirectory(pluginDir); } singleton = this; core = CustomNetworkManager.singleton.gameObject.AddComponent <RecorderCore>(); eventHandlers = new EventHandlers(core); core.handler = eventHandlers; HarmonyLib.Harmony hrm = new HarmonyLib.Harmony("Patcher.recorder"); hrm.PatchAll(); base.OnEnabled(); }
public void OnEnable() => Harmony.PatchAll(Assembly.GetExecutingAssembly());
static Main() { var harmony = new HarmonyLib.Harmony($"MadaraUchiha.{nameof(UndraftAfterTucking)}"); harmony.PatchAll(); }
// Token: 0x06000050 RID: 80 RVA: 0x00004290 File Offset: 0x00002490 static Harmony() { var harmonyInstance = new HarmonyLib.Harmony("rimworld.lanilor.rimgacha"); harmonyInstance.PatchAll(Assembly.GetExecutingAssembly()); }
public override void OnEnabled() { try { Log.Info("Started plugin initialization..."); Instance = this; Random = new Random(); foreach (MethodBase bas in Evs.Events.Instance.Harmony.GetPatchedMethods()) { if (bas.Name.Equals("TransmitData")) { Exiled.Events.Events.DisabledPatchesHashSet.Add(bas); } else if (bas.DeclaringType.Name.Equals("RoundSummary") && bas.Name.Equals("Start")) { Exiled.Events.Events.DisabledPatchesHashSet.Add(bas); } else if (bas.Name.Equals("BanUser")) { Exiled.Events.Events.DisabledPatchesHashSet.Add(bas); } else if (bas.Name.Equals("CallCmdShoot")) { Exiled.Events.Events.DisabledPatchesHashSet.Add(bas); } } Evs.Events.Instance.ReloadDisabledPatches(); Harmony = new HarmonyLib.Harmony($"gamehunt.cnpcs.{reloads}"); reloads++; Harmony.PatchAll(); EventHandlers = new EventHandlers(); Handlers.Server.RoundStarted += EventHandlers.OnRoundStart; Handlers.Server.RoundEnded += EventHandlers.OnRoundEnd; Handlers.Server.WaitingForPlayers += EventHandlers.OnWaitingForPlayers; Handlers.Server.RespawningTeam += EventHandlers.OnTeamRespawning; Handlers.Player.Dying += EventHandlers.OnDying; Handlers.Player.EnteringPocketDimension += EventHandlers.OnEnteringPocketDim; Handlers.Player.Hurting += EventHandlers.OnHurt; Handlers.Map.ExplodingGrenade += EventHandlers.OnGrenadeExplosion; Handlers.Map.Decontaminating += EventHandlers.OnDecontamination; Handlers.Warhead.Starting += EventHandlers.OnWarheadStart; if (!Directory.Exists(Config.NPCs_root_path)) { Directory.CreateDirectory(Config.NPCs_root_path); } if (!Directory.Exists(Config.NPCs_nodes_path)) { Directory.CreateDirectory(Config.NPCs_nodes_path); } if (!Directory.Exists(Config.NPCs_mappings_path)) { Directory.CreateDirectory(Config.NPCs_mappings_path); } if (!File.Exists(Config.NPCs_nav_mappings_path)) { StreamWriter sw = File.CreateText(Config.NPCs_nav_mappings_path); sw.Write(Config.DefaultNavMappings); sw.Close(); } if (!File.Exists(Path.Combine(Config.NPCs_nodes_path, "default_node.yml"))) { StreamWriter sw = File.CreateText(Path.Combine(Config.NPCs_nodes_path, "default_node.yml")); sw.Write(Config.DefaultNodeContents); sw.Close(); } if (!File.Exists(Path.Combine(Config.NPCs_root_path, "default_npc.yml"))) { StreamWriter sw = File.CreateText(Path.Combine(Config.NPCs_root_path, "default_npc.yml")); sw.Write(Config.DefaultNPCContents); sw.Close(); } Log.Info("Registering conditions..."); NodeCondition.Register(new RoleCondition()); NodeCondition.Register(new HasItemCondition()); NodeCondition.Register(new HasntItemCondition()); NodeCondition.Register(new HealthCondition()); NodeCondition.Register(new ArtificalHealthCondition()); NodeCondition.Register(new HasEffectCondition()); NodeCondition.Register(new HasntEffectCondition()); NodeCondition.Register(new PermissionCondition()); NodeCondition.Register(new RoundTimeCondition()); NodeCondition.Register(new NukeStateCondition()); NodeCondition.Register(new HeldItemCondition()); NodeCondition.Register(new RoleExistsCondition()); NodeCondition.Register(new RoleNotExistsCondition()); NodeCondition.Register(new RandomCondition()); Log.Info("Registering actions..."); NodeAction.Register(new Actions.DieAction()); NodeAction.Register(new Actions.GiveItemAction()); NodeAction.Register(new Actions.RetrieveItemAction()); NodeAction.Register(new Actions.GiveHealthAction()); NodeAction.Register(new Actions.ConsumeHealthAction()); NodeAction.Register(new Actions.EnableEffectAction()); NodeAction.Register(new Actions.DisableEffectAction()); NodeAction.Register(new Actions.BroadcastAction()); NodeAction.Register(new Actions.HeldItemAction()); NodeAction.Register(new Actions.BlackoutAction()); NodeAction.Register(new Actions.ChangeRoleAction()); NodeAction.Register(new Actions.ChangeSelfRoleAction()); NodeAction.Register(new Actions.NukeStartAction()); NodeAction.Register(new Actions.NukeStopAction()); NodeAction.Register(new Actions.StartDecontaminationAction()); NodeAction.Register(new Actions.SwitchGodAction()); NodeAction.Register(new Actions.MoveAction()); NodeAction.Register(new Actions.RotationAction()); NodeAction.Register(new Actions.RoundEndAction()); NodeAction.Register(new Actions.CassieAction()); NodeAction.Register(new Actions.RoomTeleportAction()); NodeAction.Register(new Actions.RoomSelfTeleportAction()); NodeAction.Register(new Actions.DropItemAction()); NodeAction.Register(new Actions.NavEnqueueAction()); NodeAction.Register(new Actions.NavClearAction()); NodeAction.Register(new Actions.FollowAction()); NodeAction.Register(new Actions.StopFollowAction()); NodeAction.Register(new Actions.FireEventAction()); NodeAction.Register(new Actions.ShootAction()); NodeAction.Register(new Actions.GoToRoomAction()); NodeAction.Register(new Actions.ControlDoorAction()); NodeAction.Register(new Actions.ToggleAIAction()); Log.Info("Registering AI targets..."); AITarget.Register(new AITestTarget()); AITarget.Register(new AIFindPlayerTarget()); AITarget.Register(new AIAttackTarget()); AITarget.Register(new AINavigateToRoom()); AITarget.Register(new AIFollowTarget()); AITarget.Register(new AIFindItemTarget()); AITarget.Register(new AIConditionalJump()); //AITarget.Register(new AIRunAwayTarget()); //AITarget.Register(new AIFindAmmoTarget()); AITarget.Register(new AIStop()); Log.Info("Registering targets filters..."); TargetFilter.Register(new CommonTargetFilter()); TargetFilter.Register(new Scp939TargetFilter()); TargetFilter.Register(new Scp096TargetFilter()); Log.Info($"CustomNPCs plugin loaded. @gamehunt"); } catch (Exception e) { Log.Error($"There was an error loading the plugin: {e}"); } }
public Module(ModContentPack content) : base(content) { var harmony = new HarmonyLib.Harmony("FrontierDevelopments.Shields.SrtsExpanded"); harmony.PatchAll(Assembly.GetExecutingAssembly()); }
public static void Awake() { HarmonyInstance.PatchAll(Assembly.GetExecutingAssembly()); }
static MinorChangesModStartup() { var harmony = new HarmonyLib.Harmony("net.littlewhitemouse.RimWorld.MinorChanges"); harmony.PatchAll(); }
public Mod(ModContentPack content) : base(content) { var harmony = new HarmonyLib.Harmony("FrontierDevelopments.Core"); harmony.PatchAll(Assembly.GetExecutingAssembly()); }