コード例 #1
0
ファイル: MovementMod.cs プロジェクト: musbah/SMAPI-Mods
 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);
     }
 }
コード例 #2
0
ファイル: MovementMod.cs プロジェクト: musbah/SMAPI-Mods
        /*********
        ** 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)");
        }
コード例 #3
0
ファイル: MovementMod.cs プロジェクト: skkkknnkkk/SMAPI-Mods
        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)");
        }