using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using LevelGeneration;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("TerminalColor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TerminalColor")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ad2d6448-ef5b-4ee7-8357-ed21f4e9d2a7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GTFOTerminalColor;
[BepInPlugin("TerminalColor", "Terminal Color", "1.0.0")]
public class Plugin : BasePlugin
{
public static Plugin Instance;
public ConfigEntry<float> ConfigRed;
public ConfigEntry<float> ConfigGreen;
public ConfigEntry<float> ConfigBlue;
public ConfigEntry<float> ConfigAlpha;
public override void Load()
{
Instance = this;
ConfigRed = ((BasePlugin)this).Config.Bind<float>("Color Settings", "Red", 0f, "Red channel (0.0 to 1.0)");
ConfigGreen = ((BasePlugin)this).Config.Bind<float>("Color Settings", "Green", 0.4f, "Green channel (0.0 to 1.0)");
ConfigBlue = ((BasePlugin)this).Config.Bind<float>("Color Settings", "Blue", 0f, "Blue channel (0.0 to 1.0)");
ConfigAlpha = ((BasePlugin)this).Config.Bind<float>("Color Settings", "Alpha", 0.1f, "Transparency (0.0 to 1.0)");
Harmony.CreateAndPatchAll(typeof(TerminalPatch), (string)null);
}
}
[HarmonyPatch(typeof(LG_ComputerTerminal), "Setup")]
public class TerminalPatch
{
public static void Postfix(LG_ComputerTerminal __instance)
{
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.m_text == (Object)null))
{
TextMeshPro text = __instance.m_text;
LG_KeepDynamicTextMeshPro component = ((Component)text).gameObject.GetComponent<LG_KeepDynamicTextMeshPro>();
if ((Object)(object)component != (Object)null)
{
((Behaviour)component).enabled = false;
}
float value = Plugin.Instance.ConfigRed.Value;
float value2 = Plugin.Instance.ConfigGreen.Value;
float value3 = Plugin.Instance.ConfigBlue.Value;
float value4 = Plugin.Instance.ConfigAlpha.Value;
((Graphic)text).color = new Color(value, value2, value3, value4);
((TMP_Text)text).alpha = value4;
((TMP_Text)text).ForceMeshUpdate(false, false);
}
}
}