Skip to content

Commit

Permalink
Manual triggering hotkeys and bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanilor committed Dec 10, 2018
1 parent e33cf6b commit e273296
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 73 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>Progress Renderer</name>
<author>Lanilor</author>
<url>https://github.com/Lanilor/Progress-Renderer</url>
<targetVersion>1.0.0</targetVersion>
<targetVersion>1.0.2096</targetVersion>
<description>
&lt;size=20&gt;Progress Renderer (scheduled map renderings)&lt;/size&gt;

Expand Down
8 changes: 8 additions & 0 deletions About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Manifest>
<identifier>ProgressRenderer</identifier>
<version>1.0.1</version>
<showCrossPromotions>true</showCrossPromotions>
<manifestUri>https://raw.githubusercontent.com/Lanilor/Progress-Renderer/master/About/Manifest.xml</manifestUri>
<downloadUri>https://github.com/Lanilor/Progress-Renderer/releases/latest</downloadUri>
</Manifest>
Binary file modified Assemblies/ProgressRenderer.dll
Binary file not shown.
18 changes: 18 additions & 0 deletions Defs/Misc/KeyBindings/KeyBindings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<!-- Map play -->

<KeyBindingDef ParentName="GameKeyBinding">
<defName>LPR_ManualRendering</defName>
<label>PR: Manual rendering</label>
<defaultKeyCodeA>Alpha9</defaultKeyCodeA>
</KeyBindingDef>

<KeyBindingDef ParentName="GameKeyBinding">
<defName>LPR_ManualRendering_ForceFullMap</defName>
<label>PR: Manual rendering (full map)</label>
<defaultKeyCodeA>Alpha0</defaultKeyCodeA>
</KeyBindingDef>

</Defs>
Binary file removed Progress Renderer 1.0.0.zip
Binary file not shown.
21 changes: 21 additions & 0 deletions Source/DefOf/KeyBindingDefOf.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using RimWorld;
using Verse;

namespace ProgressRenderer
{

[DefOf]
public static class KeyBindingDefOf
{

static KeyBindingDefOf()
{
DefOfHelper.EnsureInitializedInCtor(typeof(KeyBindingDefOf));
}

public static KeyBindingDef LPR_ManualRendering;
public static KeyBindingDef LPR_ManualRendering_ForceFullMap;

}

}
29 changes: 29 additions & 0 deletions Source/Harmony_Patches/Harmony_ScreenshotModeHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Harmony;
using UnityEngine;
using Verse;

namespace ProgressRenderer
{

[HarmonyPatch(typeof(ScreenshotModeHandler))]
[HarmonyPatch("ScreenshotModesOnGUI")]
public class Harmony_ScreenshotModeHandler_ScreenshotModesOnGUI
{

public static void Postfix()
{
if (KeyBindingDefOf.LPR_ManualRendering.KeyDownEvent)
{
MapComponent_RenderManager.TriggerCurrentMapManualRendering();
Event.current.Use();
}
else if (KeyBindingDefOf.LPR_ManualRendering_ForceFullMap.KeyDownEvent)
{
MapComponent_RenderManager.TriggerCurrentMapManualRendering(true);
Event.current.Use();
}
}

}

}
Loading

0 comments on commit e273296

Please sign in to comment.