Created
July 7, 2018 06:32
-
-
Save Gaelan/3bcc486557520e8ec116b4e858727227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics.CodeAnalysis; | |
using Harmony; | |
using HugsLib; | |
using JetBrains.Annotations; | |
using RimWorld; | |
using Verse; | |
namespace MorePawns | |
{ | |
[UsedImplicitly] | |
public class Mod : ModBase | |
{ | |
public override string ModIdentifier { get; } = "MorePawns"; | |
[ThreadStatic] internal static bool InConfigureStartingPawns; | |
} | |
[HarmonyPatch(typeof(Widgets), "TextFieldNumeric")] | |
internal static class TextFieldNumericPatch | |
{ | |
[HarmonyPrefix] | |
public static void ReplaceMax(ref float max) | |
{ | |
if (Mod.InConfigureStartingPawns) | |
{ | |
max = 1E+09f; | |
} | |
} | |
} | |
[HarmonyPatch(typeof(ScenPart_ConfigPage_ConfigureStartingPawns), "DoEditInterface")] | |
[UsedImplicitly] | |
internal static class ScenPartPatch | |
{ | |
[HarmonyPrefix] | |
[UsedImplicitly] | |
public static void Prefix() => Mod.InConfigureStartingPawns = true; | |
[HarmonyPostfix] | |
[UsedImplicitly] | |
public static void Postfix() => Mod.InConfigureStartingPawns = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment