示例#1
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            climatesAPI = SDVUtilities.GetModApi <Integrations.IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.4-beta.12");

            if (climatesAPI != null)
            {
                UseClimates = true;
            }
        }
        private void OnGameLaunched(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
        {
            ClimateAPI = SDVUtilities.GetModApi <Integrations.IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.5.0-beta.14");

            if (ClimateAPI is null)
            {
                Monitor.Log("This mod has encountered a error with the API being missing", LogLevel.Alert);
                DoNothing = true;
            }
        }
示例#3
0
        /// <summary>Raised after the game is launched, right before the first update tick. This happens once per game session (unrelated to loading saves). All mods are loaded and initialised at this point, so this is a good time to set up mod integrations.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnGameLaunched(object sender, GameLaunchedEventArgs e)
        {
            climatesAPI = SDVUtilities.GetModApi <Integrations.IClimatesOfFerngillAPI>(Monitor, Helper, "KoihimeNakamura.ClimatesOfFerngill", "1.5.12", "Climates of Ferngill");

            if (climatesAPI != null)
            {
                UseClimates = true;
            }

            var api = Helper.ModRegistry.GetApi <Integrations.GenericModConfigMenuAPI>("spacechase0.GenericModConfigMenu");

            if (api != null)
            {
                api.RegisterModConfig(ModManifest, () => IllnessConfig = new IllnessConfig(), () => Helper.WriteConfig(IllnessConfig));
                api.RegisterClampedOption(ModManifest, "Stamina Drain", "The drain per 10 minute tick. I wouldn't recommend a too high value.", () => IllnessConfig.StaminaDrain, (int val) => IllnessConfig.StaminaDrain         = val, 0, 65);
                api.RegisterSimpleOption(ModManifest, "Sick More Than Once", "This option controls if you can get sick more than once a day.", () => IllnessConfig.SickMoreThanOnce, (bool val) => IllnessConfig.SickMoreThanOnce = val);
                api.RegisterSimpleOption(ModManifest, "Verbose", "This option controls verbosity in logs.", () => IllnessConfig.Verbose, (bool val) => IllnessConfig.Verbose = val);
                api.RegisterClampedOption(ModManifest, "Chance of Getting Sick", "The chance of getting sick every 10 minute tick.", () => (float)IllnessConfig.ChanceOfGettingSick, (float val) => IllnessConfig.ChanceOfGettingSick = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Percentage Outside", "How long you have to be outside every 10 minutes to be affected by the weather", () => (float)IllnessConfig.PercentageOutside, (float val) => IllnessConfig.PercentageOutside = val, 0f, 1f);
                api.RegisterClampedOption(ModManifest, "Too Cold Inside", "Under this temperature, you will get sick if you don't have the heat on in your house.", () => (float)IllnessConfig.TooColdInside, (float val) => IllnessConfig.TooColdInside    = val, -15f, 10f);
            }
        }