This commit is contained in:
StanislausCichocki
2025-06-30 11:18:49 +02:00
parent 83e6d7b559
commit 35e730fc4b
5 changed files with 222 additions and 0 deletions

View File

@ -0,0 +1,21 @@
using HarmonyLib;
namespace MyFirstMod.Patches;
[HarmonyPatch(typeof(TVScript))]
public class ExampleTVPatch
{
[HarmonyPatch("SwitchTVLocalClient")]
[HarmonyPrefix]
private static void SwitchTVPrefix(TVScript __instance)
{
/*
* When the method is called, the TV will be turning off when we want to
* turn the lights on and vice-versa. At that time, the TV's tvOn field
* will be the opposite of what it's doing, ie it'll be on when turning off.
* So, we want to set the lights to what the tv's state was
* when this method is called.
*/
StartOfRound.Instance.shipRoomLights.SetShipLightsBoolean(__instance.tvOn);
}
}