Changes to Module, Core, and throughout to support module filtering by game mode. Also tweaks to CareerStatus.formatDelta.
[VOID.git] / Tools / VOID_Tools.cs
blob:a/Tools/VOID_Tools.cs -> blob:b/Tools/VOID_Tools.cs
--- a/Tools/VOID_Tools.cs
+++ b/Tools/VOID_Tools.cs
@@ -316,6 +316,7 @@
 		}
 		#endregion
 
+		#region WINDOW_UTILS
 		private static Dictionary<int, GUI.WindowFunction> functionCache;
 		public static UnityEngine.GUI.WindowFunction GetWindowHandler(Action<int> func)
 		{
@@ -365,6 +366,21 @@
 			return functionCache[hashCode];
 		}
 
+		public static void UncacheWindow(Action<int> func)
+		{
+			if (functionCache != null)
+			{
+				int hashCode = func.GetHashCode();
+
+				if (functionCache.ContainsKey(hashCode))
+				{
+					functionCache.Remove(hashCode);
+				}
+			}
+		}
+		#endregion
+
+		#region TIME_UTILS
 		/// <summary>
 		/// Formats the interval given in seconds as a human-friendly
 		/// time period in [[[[years, ]days, ]hours, ]minutes, and ]seconds.
@@ -518,7 +534,7 @@
 			{
 				string format = "Y{0:#0}, D{1:#0} {2:00}:{3:00}:{4:00.0}s";
 
-				return string.Format(format, years + 1, days, hours, minutes, seconds);
+				return string.Format(format, years + 1, days + 1, hours, minutes, seconds);
 			}
 
 			public UnpackedTime(int years, int days, int hours, int minutes, double seconds)
@@ -532,6 +548,7 @@
 
 			public UnpackedTime() : this(0, 0, 0, 0, 0d) {}
 		}
+		#endregion
 
 		public static string UppercaseFirst(string s)
 		{