public override void Entry(IModHelper helper) { this.config = helper.ReadConfig <BetterSlingshotsConfig>(); if (this.config.GalaxySlingshotPrice < 0) { this.config.GalaxySlingshotPrice = new BetterSlingshotsConfig().GalaxySlingshotPrice; helper.WriteConfig(this.config); } this.manager = new SlingshotManager(this.config, helper.Reflection); InputEvents.ButtonPressed += this.InputEvents_ButtonPressed; InputEvents.ButtonReleased += this.InputEvents_ButtonReleased; GameEvents.UpdateTick += this.GameEvents_UpdateTick; MenuEvents.MenuChanged += this.MenuEvents_MenuChanged; }
/// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides simplified APIs for writing mods.</param> public override void Entry(IModHelper helper) { this.config = helper.ReadConfig <BetterSlingshotsConfig>(); if (this.config.GalaxySlingshotPrice < 0) { this.config.GalaxySlingshotPrice = new BetterSlingshotsConfig().GalaxySlingshotPrice; helper.WriteConfig(this.config); } this.manager = new SlingshotManager(this.config, helper.Reflection); helper.Events.Input.ButtonPressed += this.OnButtonPressed; helper.Events.Input.ButtonReleased += this.OnButtonReleased; helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked; helper.Events.Display.MenuChanged += this.OnMenuChanged; }