Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed Jun 24, 2022
1 parent cb098ba commit 4c4cfdf
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 96 deletions.
Binary file modified .vs/PortiaMods/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Empty file.
Binary file modified .vs/PortiaMods/v16/.suo
Binary file not shown.
Binary file added .vs/PortiaMods/v17/.suo
Binary file not shown.
96 changes: 5 additions & 91 deletions PostProcessing/PostProcessing.csproj
Original file line number Diff line number Diff line change
@@ -1,96 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5AD3331E-8F85-4E91-96F0-C65972137ADA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PostProcessing</RootNamespace>
<AssemblyName>PostProcessing</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<Version>1.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony12">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityModManager\0Harmony12.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UnityWebRequestModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
</Reference>
<Reference Include="UnityModManager">
<HintPath>H:\tmp\ga\MTAP\Portia_Data\Managed\UnityModManager\UnityModManager.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(SolutionDir)\solution_private.targets" />
<Import Project="$(SolutionDir)\solution.targets" />
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="Patches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
<Compile Include="..\AedenthornUtils\AedenthornUtils.cs" Link="AedenthornUtils.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>call $(SolutionDir)copyDll.bat PostProcessing</PostBuildEvent>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions PostProcessing/PostProcessing.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
23 changes: 23 additions & 0 deletions YourTime/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand All @@ -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";
Expand Down
24 changes: 19 additions & 5 deletions YourTime/Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand All @@ -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));
}
Expand Down
4 changes: 4 additions & 0 deletions YourTime/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; } = "=";
Expand Down

0 comments on commit 4c4cfdf

Please sign in to comment.