コード例 #1
0
        public override void Entry(IModHelper helper)
        {
            ModInstance = this;

            helper.Events.Input.ButtonPressed   += Input_ButtonPressed;
            helper.Events.Display.RenderedWorld += Display_RenderedWorld;
            helper.Events.Input.CursorMoved     += Input_CursorMoved;

            LoadUserConfig();

            DelayHelpers.Entry(helper);
            ModDataPersistenceHelper.Entry(helper, ModDataQuantityKey, ModDataOutputModifiedKey);
            PatchesHandler.Entry(helper);
        }
コード例 #2
0
        public override void Entry(IModHelper helper)
        {
            ModInstance = this;

            IsAutomateModInstalled = helper.ModRegistry.IsLoaded("Pathoschild.Automate");

            helper.Events.Input.ButtonPressed   += Input_ButtonPressed;
            helper.Events.Display.RenderedWorld += Display_RenderedWorld;
            helper.Events.Input.CursorMoved     += Input_CursorMoved;

            string CommandName = "combine_machines_reload_config";
            string CommandHelp = "Reloads settings from the config.json file without requiring you to restart the game.";

            helper.ConsoleCommands.Add(CommandName, CommandHelp, (string Name, string[] Args) => {
                LoadUserConfig();
                Logger.Log(string.Format("Configuration settings successfully reloaded. (Some settings may still require a full restart, such as {0}.", nameof(UserConfig.AllowCombiningScarecrows)), LogLevel.Info);
            });

            LoadUserConfig();

            DelayHelpers.Entry(helper);
            ModDataPersistenceHelper.Entry(helper, ModDataQuantityKey, ModDataOutputModifiedKey);
            PatchesHandler.Entry(helper);
        }