private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e) { if (e.KeyPressed == Keys.F5) { this.Config = this.Helper.ReadConfig <MovementConfig>(); this.SprintKey = this.Config.GetSprintKey(this.Monitor); this.Monitor.Log("Config reloaded", LogLevel.Info); } }
/********* ** Public methods *********/ /// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files.</param> public override void Entry(IModHelper helper) { this.Config = helper.ReadConfig <MovementConfig>(); this.SprintKey = this.Config.GetSprintKey(this.Monitor); GameEvents.UpdateTick += this.GameEvents_UpdateTick; ControlEvents.KeyPressed += this.ControlEvents_KeyPressed; this.Monitor.Log("Initialized (press F5 to reload config)"); }
public override void Entry(params object[] objects) { ModConfig = new MovementConfig().InitializeConfig(BaseConfigPath); SprintKey = KeyFromString(); GameEvents.UpdateTick += GameEventsOnUpdateTick; ControlEvents.KeyPressed += ControlEvents_KeyPressed; Log.Info(GetType().Name + " by Zoryn => Initialized (Press F5 To Reload Config)"); }