diff --git a/.vs/PortiaMods/DesignTimeBuild/.dtbcache.v2 b/.vs/PortiaMods/DesignTimeBuild/.dtbcache.v2 index b31d6e0..c07fde5 100644 Binary files a/.vs/PortiaMods/DesignTimeBuild/.dtbcache.v2 and b/.vs/PortiaMods/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/PortiaMods/FileContentIndex/0ac2ebf3-1264-4c2e-97d5-c62ed5c646b0.vsidx b/.vs/PortiaMods/FileContentIndex/0ac2ebf3-1264-4c2e-97d5-c62ed5c646b0.vsidx new file mode 100644 index 0000000..84bf8a8 Binary files /dev/null and b/.vs/PortiaMods/FileContentIndex/0ac2ebf3-1264-4c2e-97d5-c62ed5c646b0.vsidx differ diff --git a/.vs/PortiaMods/FileContentIndex/read.lock b/.vs/PortiaMods/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/PortiaMods/v16/.suo b/.vs/PortiaMods/v16/.suo index bf74ee8..869b08b 100644 Binary files a/.vs/PortiaMods/v16/.suo and b/.vs/PortiaMods/v16/.suo differ diff --git a/.vs/PortiaMods/v17/.suo b/.vs/PortiaMods/v17/.suo new file mode 100644 index 0000000..869b08b Binary files /dev/null and b/.vs/PortiaMods/v17/.suo differ diff --git a/PostProcessing/PostProcessing.csproj b/PostProcessing/PostProcessing.csproj index 85d11b9..ce7e193 100644 --- a/PostProcessing/PostProcessing.csproj +++ b/PostProcessing/PostProcessing.csproj @@ -1,96 +1,10 @@ - - - + - Debug - AnyCPU - {5AD3331E-8F85-4E91-96F0-C65972137ADA} - Library - Properties - PostProcessing - PostProcessing - v3.5 - 512 - true + 1.0.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityModManager\0Harmony12.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\Assembly-CSharp.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\Assembly-CSharp-firstpass.dll - - - - - - - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.AnimationModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.AudioModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.CoreModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.IMGUIModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.ParticleSystemModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UI.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UIModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UnityWebRequestModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll - - - H:\tmp\ga\MTAP\Portia_Data\Managed\UnityModManager\UnityModManager.dll - - + + - - - - + - - - call $(SolutionDir)copyDll.bat PostProcessing - \ No newline at end of file diff --git a/PostProcessing/PostProcessing.csproj.user b/PostProcessing/PostProcessing.csproj.user new file mode 100644 index 0000000..9b86104 --- /dev/null +++ b/PostProcessing/PostProcessing.csproj.user @@ -0,0 +1,6 @@ + + + + ShowAllFiles + + \ No newline at end of file diff --git a/YourTime/Main.cs b/YourTime/Main.cs index b2f6e48..0a827a9 100644 --- a/YourTime/Main.cs +++ b/YourTime/Main.cs @@ -50,6 +50,18 @@ private static void OnGUI(UnityModManager.ModEntry modEntry) GUILayout.Label(string.Format("Key to Go Forward One Hour"), new GUILayoutOption[0]); settings.AdvanceTimeKey = GUILayout.TextField(settings.AdvanceTimeKey, new GUILayoutOption[0]); GUILayout.Space(20); + GUILayout.Label(string.Format("Mod Key for quicker time speed adjustment"), new GUILayoutOption[0]); + settings.SpeedModKey = GUILayout.TextField(settings.SpeedModKey, new GUILayoutOption[0]); + GUILayout.Space(20); + GUILayout.Label(string.Format("Mod Key to switch to days"), new GUILayoutOption[0]); + settings.DayModKey = GUILayout.TextField(settings.DayModKey, new GUILayoutOption[0]); + GUILayout.Space(20); + GUILayout.Label(string.Format("Mod Key to switch to months"), new GUILayoutOption[0]); + settings.MonthModKey = GUILayout.TextField(settings.MonthModKey, new GUILayoutOption[0]); + GUILayout.Space(20); + GUILayout.Label(string.Format("Mod Key to switch to years"), new GUILayoutOption[0]); + settings.YearModKey = GUILayout.TextField(settings.YearModKey, new GUILayoutOption[0]); + GUILayout.Space(20); } @@ -71,6 +83,17 @@ static bool KeyDown(string key) } } + static bool KeyHeld(string key) + { + try + { + return (Input.GetKey(key)); + } + catch{ + return false; + } + } + private static string TimeSpeedString() { var speed = "normal"; diff --git a/YourTime/Patches.cs b/YourTime/Patches.cs index 18a8a76..a5f0870 100644 --- a/YourTime/Patches.cs +++ b/YourTime/Patches.cs @@ -61,19 +61,33 @@ static void Postfix() } else if (KeyDown(settings.SubtractTimeKey)) { - GameDateTime dt = TimeManager.Self.DateTime.AddSeconds(-60 * 60); - GameTimeSpan t = dt - TimeManager.Self.DateTime; + GameDateTime dt; + if (KeyHeld(settings.DayModKey)) + dt = TimeManager.Self.DateTime.AddDays(-1); + else if (KeyHeld(settings.MonthModKey)) + dt = TimeManager.Self.DateTime.AddMonths(-1); + else if (KeyHeld(settings.YearModKey)) + dt = TimeManager.Self.DateTime.AddYears(-1); + else + dt = TimeManager.Self.DateTime.AddSeconds(-60 * 60); TimeManager.Self.SetDateTime(dt, true, TimeManager.JumpingType.Max); } else if (KeyDown(settings.AdvanceTimeKey)) { - TimeManager.Self.JumpTimeByGameTime(60 * 60); + if (KeyHeld(settings.DayModKey)) + TimeManager.Self.JumpTimeByGameTime(60 * 60 * 24); + else if (KeyHeld(settings.MonthModKey)) + TimeManager.Self.JumpTimeByGameTime(60 * 60 * 24 * 28); + else if (KeyHeld(settings.YearModKey)) + TimeManager.Self.JumpTimeByGameTime(60 * 60 * 24 * 28 * 4); + else + TimeManager.Self.JumpTimeByGameTime(60 * 60); } else if (KeyDown(settings.SlowTimeKey)) { if (settings.TimeScaleModifier > 0.1f) { - if (Input.GetKey("left shift")) + if (KeyHeld(settings.SpeedModKey)) { settings.TimeScaleModifier = Math.Max(0.1f,(float)Math.Round(settings.TimeScaleModifier - 1f)); } @@ -93,7 +107,7 @@ static void Postfix() { if (settings.TimeScaleModifier < 10.0f) { - if (Input.GetKey("left shift")) + if (KeyHeld(settings.SpeedModKey)) { settings.TimeScaleModifier = Math.Min(10f, (float)Math.Round(settings.TimeScaleModifier + 1f)); } diff --git a/YourTime/Settings.cs b/YourTime/Settings.cs index 3b418b3..0303376 100644 --- a/YourTime/Settings.cs +++ b/YourTime/Settings.cs @@ -5,6 +5,10 @@ namespace YourTime public class Settings : UnityModManager.ModSettings { public float TimeScaleModifier { get; set; } = 0.5f; + public string SpeedModKey { get; set; } = "left shift"; + public string DayModKey { get; set; } = "left shift"; + public string MonthModKey { get; set; } = "left ctrl"; + public string YearModKey { get; set; } = "left alt"; public string StopTimeKey { get; set; } = "\\"; public string SubtractTimeKey { get; set; } = "-"; public string AdvanceTimeKey { get; set; } = "=";