Ejemplo n.º 1
0
        public override void Entry(IModHelper helper)
        {
            instance = this;

            Log.info("Loading Config");
            ModConfig = Helper.ReadConfig <RushOrdersConfig>();

            GameEvents.UpdateTick += checkCurrentMenu;
            GameEvents.UpdateTick += checkToolUpgradeForRushOrder;
        }
Ejemplo n.º 2
0
        /// <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)
        {
            instance = this;

            Log.info("Loading Config");
            ModConfig = Helper.ReadConfig <RushOrdersConfig>();

            helper.Events.Display.MenuChanged   += onMenuChanged;
            helper.Events.GameLoop.UpdateTicked += onUpdateTicked;
        }
Ejemplo n.º 3
0
        private void onGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            var capi = Helper.ModRegistry.GetApi <GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (capi != null)
            {
                capi.RegisterModConfig(ModManifest, () => ModConfig = new RushOrdersConfig(), () => Helper.WriteConfig(ModConfig));
                capi.RegisterSimpleOption(ModManifest, "Price: Tool - One day", "The price multiplier for a one-day tool upgrade.", () => (float)ModConfig.PriceFactor.Tool.Rush, (float val) => ModConfig.PriceFactor.Tool.Rush = val);
                capi.RegisterSimpleOption(ModManifest, "Price: Tool - Instant", "The price multiplier for an instant upgrade.", () => (float)ModConfig.PriceFactor.Tool.Rush, (float val) => ModConfig.PriceFactor.Tool.Now      = val);
                capi.RegisterSimpleOption(ModManifest, "Price: Building - Accelerate", "The price multiplier to accelerate building construction by one day.", () => (float)ModConfig.PriceFactor.Building.RushOneDay, (float val) => ModConfig.PriceFactor.Building.RushOneDay = val);
            }
        }
Ejemplo n.º 4
0
        /// <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)
        {
            Mod.Instance = this;
            Log.Monitor  = this.Monitor;

            Log.Info("Loading Config");
            Mod.ModConfig = this.Helper.ReadConfig <RushOrdersConfig>();

            helper.Events.GameLoop.GameLaunched += this.OnGameLaunched;
            helper.Events.Display.MenuChanged   += this.OnMenuChanged;
            helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked;
        }