Merge branch 'Pandraghon-fix/version_shower' into main

This commit is contained in:
Brybry committed 2021-04-06 13:49:13 +02:00
commit 2af248eeed
2 files changed
+8 -22

No files matched your search

+8
View File
@@ -3,6 +3,7 @@ using BepInEx.IL2CPP;
using BepInEx.Logging;
using HarmonyLib;
using Reactor;
using Reactor.Patches;
namespace BetterPolus
{
@@ -22,6 +23,13 @@ namespace BetterPolus
log = Log;
log.LogMessage("BetterPolus Mod loaded");
ReactorVersionShower.TextUpdated += (text) =>
{
int index = text.Text.LastIndexOf('\n');
text.Text = text.Text.Insert(index == -1 ? text.Text.Length - 1 : index,
"\nLoaded [5E4CA6FF]BetterPolus v1.1.2-R []by Brybry");
};
Harmony.PatchAll();
}
-22
View File
@@ -1,22 +0,0 @@
using BepInEx.IL2CPP;
using HarmonyLib;
using UnityEngine;
namespace BetterPolus
{
[HarmonyPatch(typeof(VersionShower), nameof(VersionShower.Start))]
public class VersionShowerPatch
{
[HarmonyPostfix]
[HarmonyPatch]
[HarmonyPriority(Priority.First)]
public static void Postfix(VersionShower __instance)
{
var reactorVS = GameObject.Find("ReactorVersion");
GameObject.Destroy(reactorVS);
TextRenderer text = __instance.text;
text.Text += "\nLoaded [5E4CA6FF]BetterPolus v1.1.2-R []by Brybry";
}
}
}