-
Notifications
You must be signed in to change notification settings - Fork 1
/
Start_Warning_Patch.cs
31 lines (30 loc) · 989 Bytes
/
Start_Warning_Patch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tweaks_Fixes
{
internal class Start_Warning_Patch
{
[HarmonyPatch(typeof(FlashingLightsDisclaimer))]
class FlashingLightsDisclaimer_CanShow_Patch
{
[HarmonyPrefix]
[HarmonyPatch("TryToShow")]
static bool TryToShowPrefix(FlashingLightsDisclaimer __instance)
{
bool noText = String.IsNullOrEmpty(ConfigToEdit.gameStartWarningText.Value);
return !noText;
}
[HarmonyPrefix]
[HarmonyPatch("SetText")]
static bool SetTextPrefix(FlashingLightsDisclaimer __instance)
{
__instance.text.text = Language.main.Get(ConfigToEdit.gameStartWarningText.Value);
//Main.logger.LogDebug("FlashingLightsDisclaimer SetText ");
return false;
}
}
}
}