From ccdc99ab8e5414fbcae117aae0aabe191f212597 Mon Sep 17 00:00:00 2001 From: Joshua Navarro Date: Mon, 24 Dec 2018 13:00:33 -0800 Subject: [PATCH] Added some comments and a way to disable DarkerNight. --- .../Framework/Environment/DarkerNight.cs | 30 ++++++++++++++++++- .../Environment/DarkerNightConfig.cs | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/GeneralMods/Revitalize/Framework/Environment/DarkerNight.cs b/GeneralMods/Revitalize/Framework/Environment/DarkerNight.cs index c2e86615..ea5739e2 100644 --- a/GeneralMods/Revitalize/Framework/Environment/DarkerNight.cs +++ b/GeneralMods/Revitalize/Framework/Environment/DarkerNight.cs @@ -10,17 +10,38 @@ using Microsoft.Xna.Framework; namespace Revitalize.Framework.Environment { + /// + /// Deals with making night time darker in Stardew. + /// public class DarkerNight { + /// + /// Darkness intensity. + /// public static float IncrediblyDark = 0.9f; + /// + /// Darkness intensity. + /// public static float VeryDark = 0.75f; + /// + /// Darkness intensity. + /// public static float SomewhatDark = 0.50f; + /// + /// The config file. + /// public static DarkerNightConfig Config; + /// + /// The calculated night color. + /// private static Color CalculatedColor; + /// + /// Initializes the config for DarkerNight. + /// public static void InitializeConfig() { if (File.Exists(Path.Combine(Revitalize.ModCore.ModHelper.DirectoryPath, "Configs", "DarkerNightConfig.json"))) @@ -34,17 +55,24 @@ namespace Revitalize.Framework.Environment } } + /// + /// Sets the color of darkness at night. + /// public static void SetDarkerColor() { + if (Config.Enabled == false) return; if (Game1.player.currentLocation.IsOutdoors && Game1.timeOfDay >= Game1.getStartingToGetDarkTime()) { Game1.outdoorLight = CalculatedColor; } } - + /// + /// Calculates how dark it should be a night. + /// public static void CalculateDarkerNightColor() { + if (Config.Enabled == false) return; if (Game1.player == null) return; //Calculate original lighting. diff --git a/GeneralMods/Revitalize/Framework/Environment/DarkerNightConfig.cs b/GeneralMods/Revitalize/Framework/Environment/DarkerNightConfig.cs index 4724f88c..6d2c4b93 100644 --- a/GeneralMods/Revitalize/Framework/Environment/DarkerNightConfig.cs +++ b/GeneralMods/Revitalize/Framework/Environment/DarkerNightConfig.cs @@ -9,9 +9,11 @@ namespace Revitalize.Framework.Environment { public class DarkerNightConfig { + public bool Enabled; public float DarknessIntensity; public DarkerNightConfig() { + this.Enabled = true; this.DarknessIntensity = .9f; }