Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PlayerTweaks v0.4.0
RepoHUDTweaks.dll
Decompiled 2 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Omni.WalkieTalkie; using Photon.Pun; using RepoHUDTweaks.compatibilityPatches; using RepoHUDTweaks.patches; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("RepoHUDTweaks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RepoHUDTweaks")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("537e4ad8-2470-446c-9fa9-0ebfd7b9dd00")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace RepoHUDTweaks { public class Helpers { public static string ToHex(Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return ColorUtility.ToHtmlStringRGB(color); } public static string ToHexAlpha(Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return ColorUtility.ToHtmlStringRGBA(color); } public static Color ToColor(string hex, Color fallback) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); if (ColorUtility.TryParseHtmlString(hex, ref result)) { return result; } return fallback; } public static Color ToColor(string hex, string fallback) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); if (ColorUtility.TryParseHtmlString(hex, ref result)) { return result; } return ToColor(fallback, Color.white); } } [BepInPlugin("Swaggies.PlayerTweaks", "PlayerTweaks", "0.4.0")] public class Plugin : BaseUnityPlugin { private const string _guid = "Swaggies.PlayerTweaks"; private const string _name = "PlayerTweaks"; public const string _ver = "0.4.0"; private readonly Harmony harmony = new Harmony("Swaggies.PlayerTweaks"); public static ManualLogSource loggy; public static ConfigEntry<string> HealthPlusSignColor; public static ConfigEntry<string> HealthColor; public static ConfigEntry<string> HealthMaxColor; public static ConfigEntry<bool> HealthMaxMatchSlash; public static ConfigEntry<bool> HealthPlusSignAsHealthBar; public static ConfigEntry<string> StaminaZapSignColor; public static ConfigEntry<string> StaminaColor; public static ConfigEntry<string> StaminaMaxColor; public static ConfigEntry<bool> StaminaMaxMatchSlash; public static ConfigEntry<bool> StaminaZapSignAsStaminaBar; public static ConfigEntry<int> TumbleUIFrameRate; public static ConfigEntry<int> TumbleUIInSpeed; public static ConfigEntry<int> TumbleUIOutSpeed; public static ConfigEntry<string> TumbleUIColorExitLight; public static ConfigEntry<string> TumbleUIColorExitDark; public static ConfigEntry<string> TumbleUIColorStunnedLight; public static ConfigEntry<string> TumbleUIColorStunnedDark; public static ConfigEntry<string> TumbleWingUIWingColor; public static ConfigEntry<string> TumbleWingUIHolderColor; public static ConfigEntry<string> TumbleWingUIBarColorStart; public static ConfigEntry<string> TumbleWingUIBarColorEnd; public static ConfigEntry<string> HaulUIColor; public static ConfigEntry<string> HaulUIDollarSignColor; public static ConfigEntry<string> HaulUISlashColor; public static ConfigEntry<string> GoalUIColor; public static ConfigEntry<string> GoalUISlashColor; public static ConfigEntry<bool> WASDCancelsTumbleImmediately; public static ConfigEntry<bool> SpaceToExitCrouch; public static ConfigEntry<bool> SprintToExitCrouch; public static ConfigEntry<string> AimColorDefault; public static ConfigEntry<string> AimColorGrabbable; public static ConfigEntry<string> AimColorGrab; public static ConfigEntry<string> AimColorRotate; public static ConfigEntry<string> AimColorClimbable; public static ConfigEntry<string> AimColorClimb; public static ConfigEntry<string> HurtVignetteColor; public static ConfigEntry<bool> HurtVignetteHealthBased; public static ConfigEntry<float> HurtVignetteHealthBasedScaleMax; public static ConfigEntry<float> HurtVignetteHealthBasedScaleMin; public static ConfigEntry<bool> HurtVignetteWhileDead; public static ConfigEntry<bool> HurtVignetteAtMaxHealth; public static ConfigEntry<bool> WorldSpaceValueUIEnablePatch; public static ConfigEntry<string> WorldSpaceValueUIColorMax; public static ConfigEntry<string> WorldSpaceValueUIColorMed; public static ConfigEntry<string> WorldSpaceValueUIColorMin; public static ConfigEntry<string> WorldSpaceValueUIColorCost; public static ConfigEntry<float> WorldSpaceValueUICountUpTime; public static ConfigEntry<float> WorldSpaceValueUICountDownTime; public static ConfigEntry<bool> WSUIVL_EnablePatch; public static ConfigEntry<bool> WSUIVL_AlwaysDisplayWhenPossible; public static ConfigEntry<float> WSUIVL_Scale0; public static ConfigEntry<float> WSUIVL_Scale1000; public static ConfigEntry<float> WSUIVL_Scale5000; public static ConfigEntry<float> WSUIVL_Scale10000; public static ConfigEntry<float> WSUIVL_Scale50000; public static ConfigEntry<float> WSUIVL_Timer0; public static ConfigEntry<float> WSUIVL_Timer1000; public static ConfigEntry<float> WSUIVL_Timer5000; public static ConfigEntry<float> WSUIVL_Timer10000; public static ConfigEntry<float> WSUIVL_Timer50000; public static ConfigEntry<string> WSUIVL_Color0; public static ConfigEntry<string> WSUIVL_Color1000; public static ConfigEntry<string> WSUIVL_Color5000; public static ConfigEntry<string> WSUIVL_Color10000; public static ConfigEntry<string> WSUIVL_Color50000; public static ConfigEntry<bool> WSUIVL_InterpolateScale; public static ConfigEntry<bool> WSUIVL_InterpolateTimer; public static ConfigEntry<bool> WSUIVL_InterpolateColor; public static ConfigEntry<bool> ItemInfoUIShowValuableNames; public static ConfigEntry<string> ItemInfoUIGradStart; public static ConfigEntry<string> ItemInfoUIGradEnd; public static ConfigEntry<string> ItemInfoUIGradEnemyStart; public static ConfigEntry<string> ItemInfoUIGradEnemyEnd; public static ConfigEntry<bool> OverchargeUIShowLegacy; public static ConfigEntry<string> OverchargeUILegacySignColor; public static ConfigEntry<string> OverchargeUILegacyColor; public static ConfigEntry<string> OverchargeUILegacyMaxColor; public static ConfigEntry<bool> OverchargeUILegacyMatchSlash; public static ConfigEntry<bool> OverchargeUILegacySignAsBar; public static ConfigEntry<string> OverchargeUIRoundBarColor; public static ConfigEntry<string> MapObjectValuableColor; public static ConfigEntry<string> MapObjectItemColor; public static ConfigEntry<string> MapObjectDeathHeadColor; public static ConfigEntry<string> MapObjectDoorColor; public static ConfigEntry<string> MapObjectPlayerColor; public static ConfigEntry<string> MapObjectBacktrackColorStart; public static ConfigEntry<string> MapObjectBacktrackColorEnd; public static ConfigEntry<string> MapWallColor; public static ConfigEntry<string> MapFloorColor; public static ConfigEntry<string> MapStairsColor; public static ConfigEntry<string> MapInactiveWallColor; public static ConfigEntry<string> MapInactiveFloorColor; public static ConfigEntry<string> MapTruckWallColor; public static ConfigEntry<string> MapTruckFloorColor; public static ConfigEntry<string> MapUsedWallColor; public static ConfigEntry<string> MapUsedFloorColor; public static ConfigEntry<string> MapUnexploredOutlineColor; public static ConfigEntry<string> MapUnexploredColor; public static ConfigEntry<string> MapUnexploredGraphicColor; private void Awake() { loggy = Logger.CreateLogSource("Swaggies.PlayerTweaks"); loggy.LogMessage((object)"PlayerTweaks's up and runnin' (0.4.0)"); harmony.PatchAll(typeof(AimPatch)); harmony.PatchAll(typeof(EnergyUIPatch)); harmony.PatchAll(typeof(GoalUIPatch)); harmony.PatchAll(typeof(HaulUIPatch)); harmony.PatchAll(typeof(HealthUIPatch)); harmony.PatchAll(typeof(HurtVignettePatch)); harmony.PatchAll(typeof(PlayerControllerPatch)); harmony.PatchAll(typeof(PlayerTumblePatch)); harmony.PatchAll(typeof(TumbleUIPatch)); harmony.PatchAll(typeof(WorldSpaceUIValuePatch)); harmony.PatchAll(typeof(WorldSpaceUIValueLostPatch)); harmony.PatchAll(typeof(PhysGrabObjectImpactDetectorPatch)); harmony.PatchAll(typeof(TumbleWingsUIPatch)); harmony.PatchAll(typeof(PhysGrabberPatch)); harmony.PatchAll(typeof(OverchargeRoundBarUIPatch)); harmony.PatchAll(typeof(ItemInfoUIPatch)); harmony.PatchAll(typeof(MapPatch)); harmony.PatchAll(typeof(DirtFinderPatches)); if (Chainloader.PluginInfos.Keys.Contains("omni.repo.walkietalkie")) { harmony.PatchAll(typeof(WalkieTalkieCompatibilityPatch)); } ConfigHealth(); ConfigStamina(); ConfigTumble(); ConfigTumbleWings(); ConfigHaul(); ConfigGoal(); ConfigControls(); ConfigAim(); ConfigHurtVignette(); ConfigWorldSpaceUIValue(); ConfigWorldSpaceUIValueLost(); ConfigItemInfoUI(); ConfigOverchargeUI(); ConfigMap(); } private void ConfigHealth() { HealthPlusSignColor = ((BaseUnityPlugin)this).Config.Bind<string>("Health UI", "Plus Sign Color", "#56ff6d", "The color of the plus sign"); HealthColor = ((BaseUnityPlugin)this).Config.Bind<string>("Health UI", "Health Color", "#56ff6d", "The color of the current health number"); HealthMaxColor = ((BaseUnityPlugin)this).Config.Bind<string>("Health UI", "Max Health Color", "#008b20", "The color of the max health number"); HealthMaxMatchSlash = ((BaseUnityPlugin)this).Config.Bind<bool>("Health UI", "Use Same Color for Max and Current HP", false, "If the max health number and current health number use the same color (true in vanilla)"); HealthPlusSignAsHealthBar = ((BaseUnityPlugin)this).Config.Bind<bool>("Health UI", "Use Plus Sign as Health Bar", true, "If the plus sign should be used as a health bar"); } private void ConfigStamina() { StaminaZapSignColor = ((BaseUnityPlugin)this).Config.Bind<string>("Stamina UI", "Zap Sign Color", "#fcff00", "The color of the energy sign"); StaminaColor = ((BaseUnityPlugin)this).Config.Bind<string>("Stamina UI", "Stamina Color", "#fcff00", "The color of the current stamina number"); StaminaMaxColor = ((BaseUnityPlugin)this).Config.Bind<string>("Stamina UI", "Max Stamina Color", "#ffa500", "The color of the max stamina number"); StaminaMaxMatchSlash = ((BaseUnityPlugin)this).Config.Bind<bool>("Stamina UI", "Use Same Color for Max and Current Stam", false, "If the max stamina number and current stamina number use the same color (true in vanilla)"); StaminaZapSignAsStaminaBar = ((BaseUnityPlugin)this).Config.Bind<bool>("Stamina UI", "Use Zap Sign as Stamina Bar", true, "If the zap sign should be used as a stamina bar"); } private void ConfigTumble() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown TumbleUIFrameRate = ((BaseUnityPlugin)this).Config.Bind<int>("Tumble UI", "Border Animation Frame Rate", 60, new ConfigDescription("The frame rate of the Tumble UI appearing and disappearing (vanilla default is 12.5)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(10, 120), Array.Empty<object>())); TumbleUIInSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Tumble UI", "Border Fade-In Speed", 8, new ConfigDescription("How quickly the Tumble UI appears when beginning a tumble (affected by frame rate, vanilla default is 30)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 100), Array.Empty<object>())); TumbleUIOutSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Tumble UI", "Border Fade-Out Speed", 10, new ConfigDescription("How quickly the Tumble UI disappears when getting up from a tumble (affected by frame rate, vanilla default is 80)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 100), Array.Empty<object>())); TumbleUIColorExitLight = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble UI", "Border Color Light", "#ffb20050", "The lighter color of the border when you're able to exit a tumble."); TumbleUIColorExitDark = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble UI", "Border Color Dark", "#ffb20032", "The darker color of the border when you're able to exit a tumble."); TumbleUIColorStunnedLight = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble UI", "Border Color Light (Stunned)", "#ff000050", "The lighter color of the border when you're stunned."); TumbleUIColorStunnedDark = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble UI", "Border Color Dark (Stunned)", "#ff000032", "The darker color of the border when you're stunned."); } private void ConfigTumbleWings() { TumbleWingUIWingColor = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble Wings UI", "Wing Color", "#0065ff", "Color of the wings in the UI (does not affect in-world wings)"); TumbleWingUIHolderColor = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble Wings UI", "Bar Holder Color", "#00beff", "Color of the bar holder (edges)"); TumbleWingUIBarColorStart = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble Wings UI", "Bar Color (full)", "#00bbff", "Color of the bar when full"); TumbleWingUIBarColorEnd = ((BaseUnityPlugin)this).Config.Bind<string>("Tumble Wings UI", "Bar Color (empty)", "#00bbff", "Color of the bar when empty"); } private void ConfigHaul() { HaulUIColor = ((BaseUnityPlugin)this).Config.Bind<string>("Haul UI", "Color", "#c9e9e6", "Color for haul UI"); HaulUIDollarSignColor = ((BaseUnityPlugin)this).Config.Bind<string>("Haul UI", "Dollar Sign Color", "#558b2f", "Color of the dollar sign in the haul UI"); HaulUISlashColor = ((BaseUnityPlugin)this).Config.Bind<string>("Haul UI", "Slash Color", "#616161", "Color for the slash in the haul UI"); } private void ConfigGoal() { GoalUIColor = ((BaseUnityPlugin)this).Config.Bind<string>("Goal UI", "Color", "#ff5f00", "Color for goal UI"); GoalUISlashColor = ((BaseUnityPlugin)this).Config.Bind<string>("Goal UI", "Slash Color", "#7d250b", "Color for the slash in the goal UI"); } private void ConfigControls() { WASDCancelsTumbleImmediately = ((BaseUnityPlugin)this).Config.Bind<bool>("Controls", "WASD Cancels Tumble Immediately", false, "If using WASD does NOT wait for you to stop moving before making you get up from a tumble"); SpaceToExitCrouch = ((BaseUnityPlugin)this).Config.Bind<bool>("Controls", "Jumping Exits Crouch", false, "If jumping automatically uncrouches you"); SprintToExitCrouch = ((BaseUnityPlugin)this).Config.Bind<bool>("Controls", "Sprinting Exits Crouch", false, "If trying to sprint while crouched will automatically uncrouch you"); } private void ConfigAim() { AimColorDefault = ((BaseUnityPlugin)this).Config.Bind<string>("Crosshair", "Default Color", "#ffffff32", "Color for default crosshair"); AimColorGrabbable = ((BaseUnityPlugin)this).Config.Bind<string>("Crosshair", "Object Hover Color", "#fff700ff", "Color for hovering over a grabbable object"); AimColorGrab = ((BaseUnityPlugin)this).Config.Bind<string>("Crosshair", "Object Grab Color", "#ffffff1e", "Color for holding an object"); AimColorRotate = ((BaseUnityPlugin)this).Config.Bind<string>("Crosshair", "Object Rotate Color", "#ffffff1e", "Color for rotating an object"); AimColorClimbable = ((BaseUnityPlugin)this).Config.Bind<string>("Crosshair", "Climb Hover Color", "#005fffff", "Color for hovering over a climbable surface"); AimColorClimb = ((BaseUnityPlugin)this).Config.Bind<string>("Crosshair", "Climb Grab Color", "#005fff49", "Color for climbing"); AimColorDefault.SettingChanged += delegate { AimPatch.Update(); }; AimColorGrabbable.SettingChanged += delegate { AimPatch.Update(); }; AimColorGrab.SettingChanged += delegate { AimPatch.Update(); }; AimColorRotate.SettingChanged += delegate { AimPatch.Update(); }; AimColorClimbable.SettingChanged += delegate { AimPatch.Update(); }; AimColorClimb.SettingChanged += delegate { AimPatch.Update(); }; } private void ConfigHurtVignette() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown HurtVignetteColor = ((BaseUnityPlugin)this).Config.Bind<string>("Hurt Vignette", "Color", "#b20000af", "Color of vignette"); HurtVignetteHealthBased = ((BaseUnityPlugin)this).Config.Bind<bool>("Hurt Vignette", "Health Based", false, "If the vignette should fade in the more your health goes down"); HurtVignetteHealthBasedScaleMax = ((BaseUnityPlugin)this).Config.Bind<float>("Hurt Vignette", "Max Scale", 2f, new ConfigDescription("(IF Health Based IS ENABLED ONLY) The scale of the vignette image when at max health.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2.5f), Array.Empty<object>())); HurtVignetteHealthBasedScaleMin = ((BaseUnityPlugin)this).Config.Bind<float>("Hurt Vignette", "Min Scale", 1f, new ConfigDescription("(IF Health Based IS ENABLED ONLY) The scale of the vignette image when at 0 health. Lowering this too far might make the vignette cover the screen a lot!", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); HurtVignetteWhileDead = ((BaseUnityPlugin)this).Config.Bind<bool>("Hurt Vignette", "Display While Dead", false, "(IF Health Based IS ENABLED ONLY) If the vignette should remain on screen while you're dead"); HurtVignetteAtMaxHealth = ((BaseUnityPlugin)this).Config.Bind<bool>("Hurt Vignette", "Display at Max Health", false, "(IF Health Based IS ENABLED ONLY) If the vignette should remain on screen even if you're at max health"); HurtVignetteColor.SettingChanged += delegate { HurtVignettePatch.SpoofLerp(); }; } private void ConfigWorldSpaceUIValue() { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown WorldSpaceValueUIEnablePatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Value UI", "Enable Patch", true, "Enables the patches for value UI. Disable for any compatibility purposes, disabling this will also disable all options below."); WorldSpaceValueUIColorMax = ((BaseUnityPlugin)this).Config.Bind<string>("Value UI", "Color (Max Value)", "#00a825", "Color of the value UI when holding a valuable at max value"); WorldSpaceValueUIColorMed = ((BaseUnityPlugin)this).Config.Bind<string>("Value UI", "Color (Med Value)", "#00a825", "Color of the value UI when holding a valuable at about half its original value"); WorldSpaceValueUIColorMin = ((BaseUnityPlugin)this).Config.Bind<string>("Value UI", "Color (Min Value)", "#00a825", "Color of the value UI when holding a valuable at min value (color will interpolate with max value as valuable's value goes down)"); WorldSpaceValueUIColorCost = ((BaseUnityPlugin)this).Config.Bind<string>("Value UI", "Color (Shop Cost)", "#f13337", "Color of the value UI when hovering over/holding a shop item"); WorldSpaceValueUICountUpTime = ((BaseUnityPlugin)this).Config.Bind<float>("Value UI", "Count-Up Speed", 15f, new ConfigDescription("How quickly to interpolate the value counting up. (Set to 0 to instantly change instead of animating.)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>())); WorldSpaceValueUICountDownTime = ((BaseUnityPlugin)this).Config.Bind<float>("Value UI", "Count-Down Speed", 6f, new ConfigDescription("How quickly to interpolate the value counting down. (Set to 0 to instantly change instead of animating.)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>())); } private void ConfigWorldSpaceUIValueLost() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Expected O, but got Unknown //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Expected O, but got Unknown WSUIVL_EnablePatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Value Lost UI", "Enable Patch", true, "Enables the patches for value lost UI. Disable for any compatibility purposes, disabling this will also disable all options below."); WSUIVL_AlwaysDisplayWhenPossible = ((BaseUnityPlugin)this).Config.Bind<bool>("Value Lost UI", "Always Display When Possible", false, "Attempts to always show the value lost UI at times when it wouldn't normally show (such as if an item falls into a pit, or is crushed by an extraction point)"); WSUIVL_Color0 = ((BaseUnityPlugin)this).Config.Bind<string>("Value Lost UI", "Color at $0", "#f13337", "Color of the value lost UI at this dollar amount"); WSUIVL_Scale0 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Text scale at $0", 0.54f, new ConfigDescription("Size multiplier of the value lost UI at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); WSUIVL_Timer0 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Display time at $0", 3f, new ConfigDescription("Time in seconds to display the value lost UI on-screen at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); WSUIVL_Color1000 = ((BaseUnityPlugin)this).Config.Bind<string>("Value Lost UI", "Color at $1.000", "#f13337", "Color of the value lost UI at this dollar amount"); WSUIVL_Scale1000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Text scale at $1.000", 0.72f, new ConfigDescription("Size multiplier of the value lost UI at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); WSUIVL_Timer1000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Display time at $1.000", 3f, new ConfigDescription("Time in seconds to display the value lost UI on-screen at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); WSUIVL_Color5000 = ((BaseUnityPlugin)this).Config.Bind<string>("Value Lost UI", "Color at $5.000", "#f13337", "Color of the value lost UI at this dollar amount"); WSUIVL_Scale5000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Text scale at $5.000", 0.72f, new ConfigDescription("Size multiplier of the value lost UI at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); WSUIVL_Timer5000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Display time at $5.000", 3f, new ConfigDescription("Time in seconds to display the value lost UI on-screen at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); WSUIVL_Color10000 = ((BaseUnityPlugin)this).Config.Bind<string>("Value Lost UI", "Color at $10.000", "#f13337", "Color of the value lost UI at this dollar amount"); WSUIVL_Scale10000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Text scale at $10.000", 0.72f, new ConfigDescription("Size multiplier of the value lost UI at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); WSUIVL_Timer10000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Display time at $10.000", 3f, new ConfigDescription("Time in seconds to display the value lost UI on-screen at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); WSUIVL_Color50000 = ((BaseUnityPlugin)this).Config.Bind<string>("Value Lost UI", "Color at $50.000", "#f13337", "Color of the value lost UI at this dollar amount"); WSUIVL_Scale50000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Text scale at $50.000", 0.72f, new ConfigDescription("Size multiplier of the value lost UI at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); WSUIVL_Timer50000 = ((BaseUnityPlugin)this).Config.Bind<float>("Value Lost UI", "Display time at $50.000", 3f, new ConfigDescription("Time in seconds to display the value lost UI on-screen at this dollar amount", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); WSUIVL_InterpolateColor = ((BaseUnityPlugin)this).Config.Bind<bool>("Value Lost UI", "Interpolate Color", false, "Whether to interpolate text color between value breakpoints"); WSUIVL_InterpolateScale = ((BaseUnityPlugin)this).Config.Bind<bool>("Value Lost UI", "Interpolate Scale", false, "Whether to interpolate text size multiplier between value breakpoints"); WSUIVL_InterpolateTimer = ((BaseUnityPlugin)this).Config.Bind<bool>("Value Lost UI", "Interpolate Timer", false, "Whether to interpolate display time between value breakpoints"); } private void ConfigItemInfoUI() { ItemInfoUIShowValuableNames = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Info UI", "Show Names of Valuables", false, "Shows the names of valuables you grab at the bottom of your screen, similar to shop items"); ItemInfoUIGradStart = ((BaseUnityPlugin)this).Config.Bind<string>("Item Info UI", "Color Gradient (Top)", "#ffff00", "Color 1 for the Item Info UI gradient (applies to the top part of the vertical gradient"); ItemInfoUIGradEnd = ((BaseUnityPlugin)this).Config.Bind<string>("Item Info UI", "Color Gradient (Bottom)", "#ff6300", "Color 2 for the Item Info UI gradient (applies to the bottom part of the vertical gradient"); ItemInfoUIGradEnemyStart = ((BaseUnityPlugin)this).Config.Bind<string>("Item Info UI", "Enemy Color Gradient (Top)", "#ff0000", "Color 1 for the Item Info UI gradient when grabbing an enemy (applies to the top part of the vertical gradient"); ItemInfoUIGradEnemyEnd = ((BaseUnityPlugin)this).Config.Bind<string>("Item Info UI", "Enemy Color Gradient (Bottom)", "#ff1a00", "Color 2 for the Item Info UI gradient when grabbing an enemy (applies to the bottom part of the vertical gradient"); } private void ConfigOverchargeUI() { OverchargeUIShowLegacy = ((BaseUnityPlugin)this).Config.Bind<bool>("Overcharge UI", "Show Legacy Number", false, "Whether to show the old overcharge UI, represented as a number at the top left of your screen"); OverchargeUILegacySignColor = ((BaseUnityPlugin)this).Config.Bind<string>("Overcharge UI", "Legacy Sign Color", "#ff0000", "Color of the overcharge symbol for the legacy UI"); OverchargeUILegacyColor = ((BaseUnityPlugin)this).Config.Bind<string>("Overcharge UI", "Legacy Color", "#ff0700", "Color of the overcharge number for the legacy UI"); OverchargeUILegacyMaxColor = ((BaseUnityPlugin)this).Config.Bind<string>("Overcharge UI", "Legacy Max Color", "#fc0000", "Color of the overcharge max number for the legacy UI"); OverchargeUILegacyMatchSlash = ((BaseUnityPlugin)this).Config.Bind<bool>("Overcharge UI", "Legacy Use Same Color for Current and Max", true, "If the max number and current number use the same color (true in vanilla)"); OverchargeUILegacySignAsBar = ((BaseUnityPlugin)this).Config.Bind<bool>("Overcharge UI", "Use Legacy Sign as Overcharge Meter", true, "If the overcharge symbol should be used as a meter"); OverchargeUIRoundBarColor = ((BaseUnityPlugin)this).Config.Bind<string>("Overcharge UI", "Round Bar Color", "#ff00004b", "Color of the standard ring UI"); } private void ConfigMap() { MapObjectValuableColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Valuable Object Color", "#ffd300", "Color of the valuable dots on the map."); MapObjectItemColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Item Object Color", "#00ffeb", "Color of the shop item dots on the map."); MapObjectDeathHeadColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Death Head Color", "#ff000e", "Color of the death head dots on the map."); MapObjectPlayerColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Player Color", "#72ff79", "Color of the main player arrow on the map."); MapObjectDoorColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Door Color", "#45ff50", "Color of the doors on the map."); MapObjectBacktrackColorStart = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Backtrack Color", "#ffffff", "Color of the dots on the map that make a path to the current objective."); MapObjectBacktrackColorEnd = ((BaseUnityPlugin)this).Config.Bind<string>("Map Objects", "Backtrack Fade Color", "#ffffff", "If set to a different color than Backtrack Color, the path dots on the map will fade to THIS color as the dots get further away from the player."); MapWallColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Wall Color", "#077600", "Color of walls on the map. (APPLIES ON LEVEL LOAD)"); MapFloorColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Floor Color", "#004803", "Color of floors on the map. (APPLIES ON LEVEL LOAD)"); MapStairsColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Stairs Color", "#2aff37", "Color of stairs on the map. (APPLIES ON LEVEL LOAD)"); MapInactiveWallColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Inactive Wall Color", "#8e4000", "Color of walls for inactive extraction points on the map. (APPLIES ON LEVEL LOAD)"); MapInactiveFloorColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Inactive Floor Color", "#542400", "Color of floors for inactive extraction points on the map. (APPLIES ON LEVEL LOAD)"); MapTruckWallColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Truck Wall Color", "#00797d", "Color of truck walls (ALSO USED FOR ACTIVE EXTRACTION POINTS) on the map. (APPLIES ON LEVEL LOAD)"); MapTruckFloorColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Truck Floor Color", "#005154", "Color of truck floors (ALSO USED FOR ACTIVE EXTRACTION POINTS) on the map. (APPLIES ON LEVEL LOAD)"); MapUsedWallColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Used Wall Color", "#950001", "Color of walls for completed extraction points on the map. (APPLIES ON LEVEL LOAD)"); MapUsedFloorColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Used Floor Color", "#4d0005", "Color of floors for completed extraction points on the map. (APPLIES ON LEVEL LOAD)"); MapUnexploredOutlineColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Unexplored Outline Color", "#008908", "Color of the outlines of unexplored rooms on the map. (APPLIES ON LEVEL LOAD)"); MapUnexploredColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Unexplored Color", "#000000", "Color of the shaded area for unexplored rooms on the map. (APPLIES ON LEVEL LOAD)"); MapUnexploredGraphicColor = ((BaseUnityPlugin)this).Config.Bind<string>("Map Geometry", "Unexplored Graphic Color", "#00bc09", "Color of the question mark symbol (?) for unexplored rooms on the map. (APPLIES ON LEVEL LOAD)"); MapObjectValuableColor.SettingChanged += delegate { MapPatch.UpdateAllValuables(); }; MapObjectItemColor.SettingChanged += delegate { MapPatch.UpdateAllItems(); }; MapObjectDeathHeadColor.SettingChanged += delegate { MapPatch.UpdateAllItems(); }; MapObjectPlayerColor.SettingChanged += delegate { DirtFinderPatches.UpdatePlayer(); }; MapObjectDoorColor.SettingChanged += delegate { DirtFinderPatches.UpdateAllDoorTargets(); }; MapObjectBacktrackColorStart.SettingChanged += delegate { DirtFinderPatches.UpdateBacktrack(null); }; MapObjectBacktrackColorEnd.SettingChanged += delegate { DirtFinderPatches.UpdateBacktrack(null); }; } } public class UITweak_Health : MonoBehaviour { public static UITweak_Health instance; public const string hexColorPlusSign = "#56ff6d"; public const string hexColorHealth = "#56ff6d"; public const string hexColorMaxHealth = "#008b20"; private const float VISUAL_PLUSSIGN_MIN = 0.03f; private const float VISUAL_PLUSSIGN_MAX = 0.98f; private HealthUI healthUI; private Image plusSign; private Image plusSignBackground; private TextMeshProUGUI healthText; private TextMeshProUGUI healthTextMax; private bool initialized; private void Start() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); return; } instance = this; healthUI = ((Component)this).GetComponent<HealthUI>(); healthText = ((Component)this).GetComponent<TextMeshProUGUI>(); healthTextMax = ((Component)((Component)this).transform.Find("HealthMax")).GetComponent<TextMeshProUGUI>(); plusSign = ((Component)((Component)this).transform.Find("Plus")).GetComponent<Image>(); plusSign.fillAmount = 1f; plusSign.fillMethod = (FillMethod)1; plusSign.type = (Type)3; plusSignBackground = Object.Instantiate<GameObject>(((Component)plusSign).gameObject, ((Component)plusSign).gameObject.transform.parent).GetComponent<Image>(); ((Object)((Component)plusSignBackground).gameObject).name = "Plus Sign Background"; ((Component)plusSignBackground).gameObject.transform.SetSiblingIndex(0); ((Graphic)plusSignBackground).color = Color.clear; initialized = true; } private void Update() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (initialized) { ((TMP_Text)healthText).faceColor = Color32.op_Implicit(Color.white); ((Graphic)plusSign).color = Helpers.ToColor(Plugin.HealthPlusSignColor.Value, "#56ff6d"); ((Graphic)plusSignBackground).color = ((Graphic)plusSign).color * new Color(1f, 1f, 1f, 0.1f); ((Graphic)healthTextMax).color = (Plugin.HealthMaxMatchSlash.Value ? Helpers.ToColor(Plugin.HealthColor.Value, "#56ff6d") : Helpers.ToColor(Plugin.HealthMaxColor.Value, "#008b20")); ((TMP_Text)healthTextMax).text = ((TMP_Text)healthTextMax).text.Replace("#008b20", Plugin.HealthMaxColor.Value); if (((SemiUI)healthUI).flashColorTime > 0f) { ((SemiUI)healthUI).originalTextColor = Helpers.ToColor(Plugin.HealthColor.Value, "#56ff6d"); } else { ((Graphic)healthText).color = Helpers.ToColor(Plugin.HealthColor.Value, "#56ff6d"); } if (!Plugin.HealthPlusSignAsHealthBar.Value || !Object.op_Implicit((Object)(object)PlayerAvatar.instance) || !Object.op_Implicit((Object)(object)PlayerAvatar.instance.playerHealth) || PlayerAvatar.instance.isDisabled) { plusSign.fillAmount = 1f; return; } int health = PlayerAvatar.instance.playerHealth.health; int maxHealth = PlayerAvatar.instance.playerHealth.maxHealth; plusSign.fillAmount = NormalizeFillAmount((float)health / (float)maxHealth); } } private float NormalizeFillAmount(float amount) { if (amount <= 0f) { return 0f; } if (amount >= 1f) { return 1f; } return Mathf.Lerp(0.03f, 0.98f, amount); } } public class UITweak_Overcharge : MonoBehaviour { public static UITweak_Overcharge instance; public const string colorSign = "#ff0000"; public const string colorNum = "#ff0700"; public const string colorMax = "#fc0000"; public const string colorRoundBar = "#ff00004b"; private const float VISUAL_SIGN_MIN = 0.03f; private const float VISUAL_SIGN_MAX = 0.96f; private OverchargeUI overchargeUI; private OverchargeRoundBarUI roundBarUI; private Image sign; private Image signBackground; private TextMeshProUGUI numText; private TextMeshProUGUI numTextMax; private void Start() { //IL_0128: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); return; } instance = this; roundBarUI = ((Component)this).GetComponent<OverchargeRoundBarUI>(); if (Object.op_Implicit((Object)(object)roundBarUI)) { overchargeUI = Object.FindObjectOfType<OverchargeUI>(true); if (Object.op_Implicit((Object)(object)overchargeUI)) { numText = ((Component)overchargeUI).GetComponent<TextMeshProUGUI>(); numTextMax = ((Component)((Component)overchargeUI).transform.Find("OverchargeMax")).GetComponent<TextMeshProUGUI>(); sign = ((Component)((Component)overchargeUI).transform.Find("Icon")).GetComponent<Image>(); sign.fillAmount = 1f; sign.fillMethod = (FillMethod)1; sign.type = (Type)3; signBackground = Object.Instantiate<GameObject>(((Component)sign).gameObject, ((Component)sign).gameObject.transform.parent).GetComponent<Image>(); ((Object)((Component)signBackground).gameObject).name = "Overcharge Sign Background"; ((Component)signBackground).gameObject.transform.SetSiblingIndex(0); ((Graphic)signBackground).color = Color.clear; } } } private void Update() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)roundBarUI)) { roundBarUI.originalColor = Helpers.ToColor(Plugin.OverchargeUIRoundBarColor.Value, "#ff00004b"); } if (!Plugin.OverchargeUIShowLegacy.Value || !Object.op_Implicit((Object)(object)overchargeUI) || !Object.op_Implicit((Object)(object)((Component)overchargeUI).gameObject)) { ((Component)overchargeUI).gameObject.SetActive(false); return; } ((Component)overchargeUI).gameObject.SetActive(true); ((Graphic)sign).color = Helpers.ToColor(Plugin.OverchargeUILegacySignColor.Value, "#ff0000"); ((Graphic)signBackground).color = ((Graphic)sign).color * new Color(1f, 1f, 1f, 0.1f); ((Graphic)numText).color = Helpers.ToColor(Plugin.OverchargeUILegacyColor.Value, "#ff0700"); ((Graphic)numTextMax).color = (Plugin.OverchargeUILegacyMatchSlash.Value ? Helpers.ToColor(Plugin.OverchargeUILegacyMaxColor.Value, "#ff0700") : Helpers.ToColor(Plugin.OverchargeUILegacyColor.Value, "#fc0000")); ((TMP_Text)numTextMax).text = ((TMP_Text)numTextMax).text.Replace("red", Plugin.OverchargeUILegacyColor.Value); if (PhysGrabber.instance.physGrabBeamOverChargeFloat > 0f && Object.op_Implicit((Object)(object)roundBarUI) && !((Behaviour)roundBarUI.roundBarBG).enabled) { ((Behaviour)roundBarUI.roundBarBG).enabled = true; } if (!Plugin.OverchargeUILegacySignAsBar.Value) { sign.fillAmount = 1f; } else { sign.fillAmount = NormalizeFillAmount(PhysGrabber.instance.physGrabBeamOverChargeFloat); } } private float NormalizeFillAmount(float amount) { if (amount <= 0f) { return 0f; } if (amount >= 1f) { return 1f; } return Mathf.Lerp(0.03f, 0.96f, amount); } } public class UITweak_Stamina : MonoBehaviour { public static UITweak_Stamina instance; public const string hexColorZapSign = "#fcff00"; public const string hexColorStamina = "#fcff00"; public const string hexColorMaxStamina = "#ffa500"; private const float VISUAL_ZAPSIGN_MIN = 0.04f; private const float VISUAL_ZAPSIGN_MAX = 0.97f; private EnergyUI energyUI; private Image zapSign; private Image zapSignBackground; private TextMeshProUGUI staminaText; private TextMeshProUGUI staminaTextMax; private bool initialized; private void Start() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); return; } instance = this; energyUI = ((Component)this).GetComponent<EnergyUI>(); staminaText = ((Component)this).GetComponent<TextMeshProUGUI>(); staminaTextMax = ((Component)((Component)this).transform.Find("EnergyMax")).GetComponent<TextMeshProUGUI>(); zapSign = ((Component)((Component)this).transform.Find("Zap")).GetComponent<Image>(); zapSign.fillAmount = 1f; zapSign.fillMethod = (FillMethod)1; zapSign.type = (Type)3; zapSignBackground = Object.Instantiate<GameObject>(((Component)zapSign).gameObject, ((Component)zapSign).gameObject.transform.parent).GetComponent<Image>(); ((Object)((Component)zapSignBackground).gameObject).name = "Zap Sign Background"; ((Component)zapSignBackground).gameObject.transform.SetSiblingIndex(0); ((Graphic)zapSignBackground).color = Color.clear; initialized = true; } private void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (initialized) { ((Graphic)zapSign).color = Helpers.ToColor(Plugin.StaminaZapSignColor.Value, "#fcff00"); ((Graphic)zapSignBackground).color = ((Graphic)zapSign).color * new Color(1f, 1f, 1f, 0.1f); ((Graphic)staminaText).color = Helpers.ToColor(Plugin.StaminaZapSignColor.Value, "#fcff00"); ((Graphic)staminaTextMax).color = (Plugin.StaminaMaxMatchSlash.Value ? Helpers.ToColor(Plugin.StaminaColor.Value, "#fcff00") : Helpers.ToColor(Plugin.StaminaMaxColor.Value, "#ffa500")); ((TMP_Text)staminaTextMax).text = ((TMP_Text)staminaTextMax).text.Replace("orange", Plugin.StaminaMaxColor.Value); if (((SemiUI)energyUI).flashColorTime > 0f) { ((SemiUI)energyUI).originalTextColor = Helpers.ToColor(Plugin.StaminaColor.Value, "#fcff00"); } else { ((Graphic)staminaText).color = Helpers.ToColor(Plugin.StaminaColor.Value, "#fcff00"); } if (!Plugin.StaminaZapSignAsStaminaBar.Value || !Object.op_Implicit((Object)(object)PlayerController.instance) || PlayerAvatar.instance.isDisabled) { zapSign.fillAmount = 1f; } else { zapSign.fillAmount = NormalizeFillAmount(PlayerController.instance.EnergyCurrent / PlayerController.instance.EnergyStart); } } } private float NormalizeFillAmount(float amount) { if (amount <= 0f) { return 0f; } if (amount >= 1f) { return 1f; } return Mathf.Lerp(0.04f, 0.97f, amount); } } public class UITweak_Tumble : MonoBehaviour { [CompilerGenerated] private sealed class <Start>d__7 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public UITweak_Tumble <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Start>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown int num = <>1__state; UITweak_Tumble uITweak_Tumble = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func<bool>)(() => LevelGenerator.Instance.Generated)); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)uITweak_Tumble); return false; } instance = uITweak_Tumble; uITweak_Tumble.tumbleUI = ((Component)uITweak_Tumble).GetComponent<TumbleUI>(); if ((Object)(object)uITweak_Tumble.tumbleUI == (Object)null) { Object.Destroy((Object)(object)((Component)uITweak_Tumble).gameObject); return false; } uITweak_Tumble.init = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string hexColorExitLight = "#ffb20050"; public const string hexColorExitDark = "#ffb20032"; public const string hexColorStunnedLight = "#ff000050"; public const string hexColorStunnedDark = "#ff000032"; public static UITweak_Tumble instance; private TumbleUI tumbleUI; private bool init; [IteratorStateMachine(typeof(<Start>d__7))] private IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Start>d__7(0) { <>4__this = this }; } private void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (init) { tumbleUI.canExitColor1 = Helpers.ToColor(Plugin.TumbleUIColorExitLight.Value, "#ffb20050"); tumbleUI.canExitColor2 = Helpers.ToColor(Plugin.TumbleUIColorExitDark.Value, "#ffb20032"); tumbleUI.canNotExitColor1 = Helpers.ToColor(Plugin.TumbleUIColorStunnedLight.Value, "#ff000050"); tumbleUI.canNotExitColor2 = Helpers.ToColor(Plugin.TumbleUIColorStunnedLight.Value, "#ff000032"); tumbleUI.updateTime = 1f / (float)Plugin.TumbleUIFrameRate.Value; tumbleUI.introSpeed = Plugin.TumbleUIInSpeed.Value; tumbleUI.outroSpeed = Plugin.TumbleUIOutSpeed.Value; } } } public class UITweak_TumbleWings : MonoBehaviour { [CompilerGenerated] private sealed class <Change>d__12 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public UITweak_TumbleWings <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Change>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; UITweak_TumbleWings uITweak_TumbleWings = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; TextMeshProUGUI[] holder = uITweak_TumbleWings.holder; for (int i = 0; i < holder.Length; i++) { ((Graphic)holder[i]).color = Helpers.ToColor(Plugin.TumbleWingUIHolderColor.Value, "#00beff"); } RawImage[] wings = uITweak_TumbleWings.wings; for (int i = 0; i < wings.Length; i++) { ((Graphic)wings[i]).color = Helpers.ToColor(Plugin.TumbleWingUIWingColor.Value, "#0065ff"); } } else { <>1__state = -1; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string hexColorWing = "#0065ff"; public const string hexColorHolder = "#00beff"; public const string hexColorBar = "#00bbff"; public static UITweak_TumbleWings instance; private TumbleWingsUI tumbleWingsUI; private TextMeshProUGUI[] holder; private RawImage[] wings; private RawImage bar; private bool setup; private void Start() { if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); return; } instance = this; tumbleWingsUI = ((Component)this).GetComponent<TumbleWingsUI>(); } private void Setup() { if (!setup) { setup = true; holder = (TextMeshProUGUI[])(object)new TextMeshProUGUI[2] { ((Component)((Component)this).transform.Find("Bar/Holder Left")).gameObject.GetComponent<TextMeshProUGUI>(), ((Component)((Component)this).transform.Find("Bar/Holder Right")).gameObject.GetComponent<TextMeshProUGUI>() }; wings = (RawImage[])(object)new RawImage[2] { ((Component)((Component)this).transform.Find("Bar/Wing Left")).gameObject.GetComponentInChildren<RawImage>(true), ((Component)((Component)this).transform.Find("Bar/Wing Right")).gameObject.GetComponentInChildren<RawImage>(true) }; bar = ((Component)((Component)this).transform.Find("Bar/Tumble Wings Bar")).gameObject.GetComponent<RawImage>(); ((MonoBehaviour)this).StartCoroutine(Change()); } } private void Update() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)tumbleWingsUI.itemUpgradePlayerTumbleWingsLogic)) { Setup(); if (!(tumbleWingsUI.itemUpgradePlayerTumbleWingsLogic.tumbleWingTimer <= 0f)) { Color val = Helpers.ToColor(Plugin.TumbleWingUIBarColorStart.Value, "#00bbff"); Color val2 = Helpers.ToColor(Plugin.TumbleWingUIBarColorEnd.Value, "#00bbff"); ((Graphic)bar).color = Color.Lerp(val2, val, tumbleWingsUI.itemUpgradePlayerTumbleWingsLogic.tumbleWingTimer); } } } [IteratorStateMachine(typeof(<Change>d__12))] private IEnumerator Change() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Change>d__12(0) { <>4__this = this }; } } } namespace RepoHUDTweaks.patches { [HarmonyPatch(typeof(Aim))] internal class AimPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP() { Update(); } public static void Update() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected I4, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Aim.instance) || Aim.instance.aimStates.Count == 0) { return; } foreach (AimState aimState in Aim.instance.aimStates) { State state = aimState.State; switch ((int)state) { case 0: aimState.Color = Helpers.ToColor(Plugin.AimColorDefault.Value, aimState.Color); break; case 1: aimState.Color = Helpers.ToColor(Plugin.AimColorGrabbable.Value, aimState.Color); break; case 2: aimState.Color = Helpers.ToColor(Plugin.AimColorGrab.Value, aimState.Color); break; case 3: aimState.Color = Helpers.ToColor(Plugin.AimColorRotate.Value, aimState.Color); break; case 5: aimState.Color = Helpers.ToColor(Plugin.AimColorClimbable.Value, aimState.Color); break; case 6: aimState.Color = Helpers.ToColor(Plugin.AimColorClimb.Value, aimState.Color); break; } } } } public class DirtFinderPatches { [HarmonyPatch(typeof(DirtFinderMapPlayer), "Awake")] [HarmonyPostfix] private static void DFMP_AwakeP() { UpdatePlayer(); } public static void UpdatePlayer() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)DirtFinderMapPlayer.Instance)) { ((Component)((Component)DirtFinderMapPlayer.Instance).transform.Find("Player Graphic")).GetComponent<SpriteRenderer>().color = Helpers.ToColor(Plugin.MapObjectPlayerColor.Value, "#72ff79"); } } [HarmonyPatch(typeof(DirtFinderMapDoorTarget), "Start")] [HarmonyPostfix] private static void DFMDT_StartP(ref DirtFinderMapDoorTarget __instance) { UpdateDoorTarget(__instance); } public static void UpdateAllDoorTargets() { DirtFinderMapDoorTarget[] array = Object.FindObjectsOfType<DirtFinderMapDoorTarget>(); for (int i = 0; i < array.Length; i++) { UpdateDoorTarget(array[i]); } } private static void UpdateDoorTarget(DirtFinderMapDoorTarget target) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] componentsInChildren = ((Component)target).GetComponentsInChildren<MeshRenderer>(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Renderer)componentsInChildren[i]).material.color = Helpers.ToColor(Plugin.MapObjectDoorColor.Value, "#45ff50"); } } [HarmonyPatch(typeof(MapBacktrack), "Start")] [HarmonyPostfix] private static void MB_StartP(ref MapBacktrack __instance) { UpdateBacktrack(__instance); } public static void UpdateBacktrack(MapBacktrack mb) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)mb == (Object)null) { mb = Object.FindObjectOfType<MapBacktrack>(); } if (!((Object)(object)mb == (Object)null)) { for (int i = 0; i < mb.points.Count; i++) { Color color = GetLerp(i, mb.points.Count - 1); mb.points[i].spriteRenderer.color = color; } } static Color GetLerp(int index, int count) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Color val = Helpers.ToColor(Plugin.MapObjectBacktrackColorStart.Value, "#ffffff"); Color val2 = Helpers.ToColor(Plugin.MapObjectBacktrackColorEnd.Value, "#ffffff"); return Color.Lerp(val, val2, (float)index / (float)count); } } } [HarmonyPatch(typeof(EnergyUI))] internal class EnergyUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref EnergyUI __instance) { ((Component)__instance).gameObject.AddComponent<UITweak_Stamina>(); } } [HarmonyPatch(typeof(GoalUI))] internal class GoalUIPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref GoalUI __instance) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)__instance.Text).text = ((TMP_Text)__instance.Text).text.Replace("#7D250B", Plugin.GoalUISlashColor.Value); if (((SemiUI)__instance).flashColorTime > 0f) { ((SemiUI)__instance).originalTextColor = Helpers.ToColor(Plugin.GoalUIColor.Value, "#ff5f00"); } else { ((Graphic)__instance.Text).color = Helpers.ToColor(Plugin.GoalUIColor.Value, "#ff5f00"); } } } [HarmonyPatch(typeof(HaulUI))] internal class HaulUIPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref HaulUI __instance) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)__instance.Text).text = ((TMP_Text)__instance.Text).text.Replace("#558B2F", Plugin.HaulUIDollarSignColor.Value); ((TMP_Text)__instance.Text).text = ((TMP_Text)__instance.Text).text.Replace("#558b2f", Plugin.HaulUIDollarSignColor.Value); ((TMP_Text)__instance.Text).text = ((TMP_Text)__instance.Text).text.Replace("#616161", Plugin.HaulUISlashColor.Value); if (((SemiUI)__instance).flashColorTime > 0f) { ((SemiUI)__instance).originalTextColor = Helpers.ToColor(Plugin.HaulUIColor.Value, "#c9e9e6"); } else { ((Graphic)__instance.Text).color = Helpers.ToColor(Plugin.HaulUIColor.Value, "#c9e9e6"); } } } [HarmonyPatch(typeof(HealthUI))] internal class HealthUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref HealthUI __instance) { ((Component)__instance).gameObject.AddComponent<UITweak_Health>(); } } [HarmonyPatch(typeof(HurtVignette))] internal class HurtVignettePatch { [HarmonyPatch("Update")] [HarmonyPrefix] private static bool UpdateP(ref HurtVignette __instance) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (!LevelGenerator.Instance.Generated || SemiFunc.MenuLevel()) { return false; } if ((Object)(object)PlayerAvatar.instance == (Object)null) { return false; } __instance.activeColor = Helpers.ToColor(Plugin.HurtVignetteColor.Value, __instance.activeColor); if (!Plugin.HurtVignetteHealthBased.Value || !Object.op_Implicit((Object)(object)PlayerAvatar.instance.playerHealth)) { return true; } float num = (float)PlayerAvatar.instance.playerHealth.health / (float)PlayerAvatar.instance.playerHealth.maxHealth; float num2 = Mathf.Max(Plugin.HurtVignetteHealthBasedScaleMax.Value, Plugin.HurtVignetteHealthBasedScaleMin.Value); float num3 = Mathf.Min(Plugin.HurtVignetteHealthBasedScaleMax.Value, Plugin.HurtVignetteHealthBasedScaleMin.Value); if ((num >= 1f && !Plugin.HurtVignetteAtMaxHealth.Value) || (PlayerAvatar.instance.isDisabled && !Plugin.HurtVignetteWhileDead.Value)) { Image image = __instance.image; ((Graphic)image).color = ((Graphic)image).color * new Color(0f, 0f, 0f, 0f); } else { ((Graphic)__instance.image).color = __instance.activeColor; } ((Transform)__instance.rectTransform).localScale = Vector3.one * Mathf.Lerp(num3, num2, num); return false; } public static void SpoofLerp() { if (Object.op_Implicit((Object)(object)HurtVignette.instance)) { HurtVignette.instance.lerp = 0.5f; } } } [HarmonyPatch(typeof(ItemInfoUI))] internal class ItemInfoUIPatch { public const string colorGradStart = "#ffff00"; public const string colorGradEnd = "#ff6300"; public const string colorGradEnemyStart = "#ff0000"; public const string colorGradEnemyEnd = "#ff1a00"; [HarmonyPatch("ItemInfoText")] [HarmonyPostfix] private static void ItemInfoText(ref ItemInfoUI __instance, ref bool enemy) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (enemy) { Color val = Helpers.ToColor(Plugin.ItemInfoUIGradEnemyStart.Value, "#ff0000"); Color val2 = Helpers.ToColor(Plugin.ItemInfoUIGradEnemyEnd.Value, "#ff1a00"); ((TMP_Text)__instance.Text).colorGradient = new VertexGradient(val, val, val2, val2); } else { Color val3 = Helpers.ToColor(Plugin.ItemInfoUIGradStart.Value, "#ffff00"); Color val4 = Helpers.ToColor(Plugin.ItemInfoUIGradEnd.Value, "#ff6300"); __instance.originalGradient = new VertexGradient(val3, val3, val4, val4); } } } [HarmonyPatch(typeof(Map))] public class MapPatch { public const string colorWall = "#077600"; public const string colorFloor = "#004803"; public const string colorInactiveWall = "#8e4000"; public const string colorInactiveFloor = "#542400"; public const string colorTruckWall = "#00797d"; public const string colorTruckFloor = "#005154"; public const string colorUsedWall = "#950001"; public const string colorUsedFloor = "#4d0005"; public const string colorUnexploredOutline = "#008908"; public const string colorUnexplored = "#000000"; public const string colorStairs = "#2aff37"; public const string colorUnexploredGraphic = "#00bc09"; public const string colorObjectItem = "#00ffeb"; public const string colorObjectValuable = "#ffd300"; public const string colorObjectDeathHead = "#ff000e"; public const string colorObjectDoor = "#45ff50"; public const string colorObjectPlayer = "#72ff79"; public const string colorObjectBacktrack = "#ffffff"; [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref Map __instance) { //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) List<GameObject> obj = new List<GameObject> { __instance.Wall1x1Object, __instance.Wall1x1DiagonalObject, __instance.Wall1x1CurveObject, __instance.Wall1x05Object, __instance.Wall1x05DiagonalObject, __instance.Wall1x05CurveObject, __instance.Wall1x025Object, __instance.Wall1x025DiagonalObject, __instance.Door1x1Object, __instance.Door1x05Object, __instance.Door1x1DiagonalObject, __instance.Door1x05DiagonalObject, __instance.Door1x2Object, __instance.Door1x1WizardObject, __instance.Door1x1ArcticObject, __instance.Door1x1MuseumObject, __instance.DoorBlockedObject, __instance.DoorBlockedWizardObject, __instance.DoorBlockedArcticObject, __instance.DoorDiagonalObject }; List<GameObject> list = new List<GameObject> { __instance.FloorObject1x1, __instance.FloorObject1x1Diagonal, __instance.FloorObject1x1Curve, __instance.FloorObject1x1CurveInverted, __instance.FloorObject1x05, __instance.FloorObject1x05Diagonal, __instance.FloorObject1x05Curve, __instance.FloorObject1x05CurveInverted, __instance.FloorObject1x025, __instance.FloorObject1x025Diagonal }; foreach (GameObject item in obj) { ApplyColorToMeshRenderer(item, Helpers.ToColor(Plugin.MapWallColor.Value, "#077600")); } foreach (GameObject item2 in list) { ApplyColorToMeshRenderer(item2, Helpers.ToColor(Plugin.MapFloorColor.Value, "#004803")); } ApplyColorToMeshRenderer(__instance.StairsObject, Helpers.ToColor(Plugin.MapStairsColor.Value, "#2aff37")); ApplyColorToMeshRenderer(__instance.WallInactive, Helpers.ToColor(Plugin.MapInactiveWallColor.Value, "#8e4000")); ApplyColorToMeshRenderer(__instance.FloorInactive, Helpers.ToColor(Plugin.MapInactiveFloorColor.Value, "#542400")); ApplyColorToMeshRenderer(__instance.WallTruck, Helpers.ToColor(Plugin.MapTruckWallColor.Value, "#00797d")); ApplyColorToMeshRenderer(__instance.FloorTruck, Helpers.ToColor(Plugin.MapTruckFloorColor.Value, "#005154")); ApplyColorToMeshRenderer(__instance.WallUsed, Helpers.ToColor(Plugin.MapUsedWallColor.Value, "#950001")); ApplyColorToMeshRenderer(__instance.FloorUsed, Helpers.ToColor(Plugin.MapUsedFloorColor.Value, "#4d0005")); ApplyColorToMeshRenderer(__instance.RoomVolumeOutline, Helpers.ToColor(Plugin.MapUnexploredOutlineColor.Value, "#008908")); ApplyColorToMeshRenderer(__instance.RoomVolume, Helpers.ToColor(Plugin.MapUnexploredColor.Value, "#000000")); __instance.ModulePrefab.GetComponentInChildren<SpriteRenderer>().color = Helpers.ToColor(Plugin.MapUnexploredGraphicColor.Value, "#00bc09"); } private static void ApplyColorToMeshRenderer(GameObject mapObject, Color color) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] componentsInChildren = mapObject.GetComponentsInChildren<MeshRenderer>(true); foreach (MeshRenderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { ((Renderer)val).material.color = color; } } } private static Color ConvertCustomEntityColor(Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) string text = "#" + ColorUtility.ToHtmlStringRGB(color).ToLower(); if (text == "#00ffeb") { return Helpers.ToColor(Plugin.MapObjectItemColor.Value, "#00ffeb"); } if (text == "#ff000e") { return Helpers.ToColor(Plugin.MapObjectDeathHeadColor.Value, "#ff000e"); } return color; } [HarmonyPatch(typeof(MapValuable), "Start")] [HarmonyPostfix] private static void MapValuable_StartP(ref MapValuable __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) __instance.spriteRenderer.color = Helpers.ToColor(Plugin.MapObjectValuableColor.Value, "#ffd300"); } [HarmonyPatch("AddCustom")] [HarmonyPrefix] private static void AddCustomP(ref Color color) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) color = ConvertCustomEntityColor(color); } public static void UpdateAllValuables() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MapValuable[] array = Object.FindObjectsOfType<MapValuable>(); for (int i = 0; i < array.Length; i++) { array[i].spriteRenderer.color = Helpers.ToColor(Plugin.MapObjectValuableColor.Value, "#ffd300"); } } public static void UpdateAllItems() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) MapCustomEntity[] array = Object.FindObjectsOfType<MapCustomEntity>(); foreach (MapCustomEntity val in array) { val.spriteRenderer.color = ConvertCustomEntityColor(val.mapCustom.color); } } } [HarmonyPatch(typeof(OverchargeRoundBarUI))] internal class OverchargeRoundBarUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref OverchargeRoundBarUI __instance) { ((Component)__instance).gameObject.AddComponent<UITweak_Overcharge>(); } } [HarmonyPatch(typeof(PhysGrabber))] internal class PhysGrabberPatch { private static string cachedName = ""; private static string lastName = ""; [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref PhysGrabber __instance) { if (__instance.isLocal && Plugin.ItemInfoUIShowValuableNames.Value && Object.op_Implicit((Object)(object)__instance.grabbedPhysGrabObject) && __instance.grabbedPhysGrabObject.isValuable) { ItemInfoUI.instance.ItemInfoText((ItemAttributes)null, GetName(((Object)__instance.grabbedPhysGrabObject).name), false); } } private static string GetName(string gameObjectName) { if (gameObjectName == cachedName) { return lastName; } lastName = gameObjectName.Replace("Valuable Wizard ", "").Replace("Valuable Manor ", "").Replace("Valuable Arctic ", "") .Replace("Valuable Museum ", "") .Replace("Valuable ", "") .Replace("(Clone)", ""); cachedName = gameObjectName; return lastName; } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal class PhysGrabObjectImpactDetectorPatch { [HarmonyPatch("DestroyObjectRPC")] [HarmonyPrefix] private static void DestroyObjectRPCP(ref PhysGrabObjectImpactDetector __instance, ref PhotonMessageInfo _info) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (Plugin.WSUIVL_AlwaysDisplayWhenPossible.Value && SemiFunc.MasterOnlyRPC(_info) && Object.op_Implicit((Object)(object)__instance.valuableObject) && !(__instance.valuableObject.dollarValueCurrent < __instance.valuableObject.dollarValueOriginal * 0.15f)) { WorldSpaceUIParent.instance.ValueLostCreate(((Component)__instance).transform.position, (int)__instance.valuableObject.dollarValueCurrent); } } } [HarmonyPatch(typeof(PlayerController))] internal class PlayerControllerPatch { private static PlayerAvatar Self => PlayerAvatar.instance; private static PlayerTumble Tumble => PlayerAvatar.instance.tumble; [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref PlayerController __instance) { if (!LevelGenerator.Instance.Generated || SemiFunc.MenuLevel()) { return; } bool flag = Mathf.Abs(SemiFunc.InputMovementX()) > 0f || Mathf.Abs(SemiFunc.InputMovementY()) > 0f; if (Self.isTumbling) { if (Plugin.WASDCancelsTumbleImmediately.Value) { bool flag2 = __instance.tumbleInputDisableTimer <= 0f && !Tumble.tumbleOverride && __instance.InputDisableTimer <= 0f; if (flag && flag2) { Tumble.TumbleRequest(false, true); } } } else { if (Plugin.SpaceToExitCrouch.Value && __instance.toggleCrouch && __instance.JumpImpulse) { __instance.toggleCrouch = false; } if (Plugin.SprintToExitCrouch.Value && __instance.toggleCrouch && flag && SemiFunc.InputDown((InputKey)15) && __instance.InputDisableTimer <= 0f) { __instance.toggleCrouch = false; } } } } [HarmonyPatch(typeof(PlayerTumble))] internal class PlayerTumblePatch { } [HarmonyPatch(typeof(TumbleUI))] internal class TumbleUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref TumbleUI __instance) { ((Component)__instance).gameObject.AddComponent<UITweak_Tumble>(); } } [HarmonyPatch(typeof(TumbleWingsUI))] internal class TumbleWingsUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref TumbleWingsUI __instance) { ((Component)__instance).gameObject.AddComponent<UITweak_TumbleWings>(); } } [HarmonyPatch(typeof(WorldSpaceUIValueLost))] internal class WorldSpaceUIValueLostPatch { public class ValueBreakpoint { public ConfigEntry<string> color; public ConfigEntry<float> scale; public ConfigEntry<float> time; public ValueBreakpoint(ConfigEntry<string> _color, ConfigEntry<float> _scale, ConfigEntry<float> _time) { color = _color; scale = _scale; time = _time; } } public const string VALUE_LOST_COLOR = "#f13337"; public static Dictionary<float, ValueBreakpoint> valueBreakpoints = new Dictionary<float, ValueBreakpoint> { { 50000f, new ValueBreakpoint(Plugin.WSUIVL_Color50000, Plugin.WSUIVL_Scale50000, Plugin.WSUIVL_Timer50000) }, { 10000f, new ValueBreakpoint(Plugin.WSUIVL_Color10000, Plugin.WSUIVL_Scale10000, Plugin.WSUIVL_Timer10000) }, { 5000f, new ValueBreakpoint(Plugin.WSUIVL_Color5000, Plugin.WSUIVL_Scale5000, Plugin.WSUIVL_Timer5000) }, { 1000f, new ValueBreakpoint(Plugin.WSUIVL_Color1000, Plugin.WSUIVL_Scale1000, Plugin.WSUIVL_Timer1000) }, { 0f, new ValueBreakpoint(Plugin.WSUIVL_Color0, Plugin.WSUIVL_Scale0, Plugin.WSUIVL_Timer0) } }; private static (ValueBreakpoint, ValueBreakpoint, float) GetBreakpoint(float value) { if (value <= 0f) { return (valueBreakpoints.Last().Value, valueBreakpoints.Last().Value, 0f); } ValueBreakpoint value2 = valueBreakpoints.First().Value; float num = float.MaxValue; foreach (KeyValuePair<float, ValueBreakpoint> valueBreakpoint in valueBreakpoints) { if (value >= valueBreakpoint.Key) { return (valueBreakpoint.Value, value2, Mathf.InverseLerp(valueBreakpoint.Key, num, value)); } value2 = valueBreakpoint.Value; num = valueBreakpoint.Key; } return (value2, value2, 0f); } [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(WorldSpaceUIValueLost __instance) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (Plugin.WSUIVL_EnablePatch.Value) { (ValueBreakpoint, ValueBreakpoint, float) breakpoint = GetBreakpoint(__instance.value); Color textColor = (Plugin.WSUIVL_InterpolateColor.Value ? Color.Lerp(Helpers.ToColor(breakpoint.Item1.color.Value, "#f13337"), Helpers.ToColor(breakpoint.Item2.color.Value, "#f13337"), breakpoint.Item3) : Helpers.ToColor(breakpoint.Item1.color.Value, "#f13337")); __instance.textColor = textColor; float num = (Plugin.WSUIVL_InterpolateScale.Value ? Mathf.Lerp(breakpoint.Item1.scale.Value, breakpoint.Item2.scale.Value, breakpoint.Item3) : breakpoint.Item1.scale.Value); __instance.scale = Vector3.one * num; ((Component)__instance).transform.localScale = __instance.scale; float timer = (Plugin.WSUIVL_InterpolateTimer.Value ? Mathf.Lerp(breakpoint.Item1.time.Value, breakpoint.Item2.time.Value, breakpoint.Item3) : breakpoint.Item1.time.Value); __instance.timer = timer; } } } [HarmonyPatch(typeof(WorldSpaceUIValue))] internal class WorldSpaceUIValuePatch { public const string VALUE_COLOR = "#00a825"; public const string COST_COLOR = "#f13337"; private static float currentDisplayValue; private static float targetDisplayValue; [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref WorldSpaceUIValue __instance) { if (__instance.showTimer <= 0f) { currentDisplayValue = 0f; targetDisplayValue = 0f; } } [HarmonyPatch("Show")] [HarmonyPostfix] private static void ShowP(ref PhysGrabObject _grabObject, ref bool _cost) { if (Plugin.WorldSpaceValueUIEnablePatch.Value) { if (_cost) { HandleCost(); } else { HandleValue(((Component)_grabObject).GetComponent<ValuableObject>()); } } } private static void HandleCost() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)WorldSpaceUIValue.instance == (Object)null)) { ((Graphic)WorldSpaceUIValue.instance.text).color = Helpers.ToColor(Plugin.WorldSpaceValueUIColorCost.Value, "#f13337"); } } private static void HandleValue(ValuableObject valuable) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)valuable == (Object)null)) { float dollarValueCurrent = valuable.dollarValueCurrent; float dollarValueOriginal = valuable.dollarValueOriginal; float progress = Mathf.Clamp01(dollarValueCurrent / dollarValueOriginal); targetDisplayValue = dollarValueCurrent; float num = ((currentDisplayValue < targetDisplayValue) ? Plugin.WorldSpaceValueUICountUpTime.Value : Plugin.WorldSpaceValueUICountDownTime.Value); if (num == 0f) { currentDisplayValue = targetDisplayValue; } else { currentDisplayValue = Mathf.Lerp(currentDisplayValue, targetDisplayValue, num * Time.deltaTime); } if (Mathf.Abs(currentDisplayValue - targetDisplayValue) < 0.2f || targetDisplayValue <= 0f) { currentDisplayValue = targetDisplayValue; } ((Graphic)WorldSpaceUIValue.instance.text).color = GetColorFromProgress(progress); ((TMP_Text)WorldSpaceUIValue.instance.text).text = "$" + SemiFunc.DollarGetString((int)currentDisplayValue); } } private static Color GetColorFromProgress(float progress) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) float num = 0.5f * Mathf.InverseLerp(0.67f, 1f, progress); num += 0.5f * Mathf.InverseLerp(0.2f, 0.67f, progress); if (num >= 0.5f) { return Color.Lerp(Helpers.ToColor(Plugin.WorldSpaceValueUIColorMed.Value, "#00a825"), Helpers.ToColor(Plugin.WorldSpaceValueUIColorMax.Value, "#00a825"), (num - 0.5f) / 0.5f); } return Color.Lerp(Helpers.ToColor(Plugin.WorldSpaceValueUIColorMin.Value, "#00a825"), Helpers.ToColor(Plugin.WorldSpaceValueUIColorMed.Value, "#00a825"), num / 0.5f); } } } namespace RepoHUDTweaks.compatibilityPatches { internal class WalkieTalkieCompatibilityPatch { [HarmonyPatch(typeof(WalkieController), "TryCreateBatteryUi")] [HarmonyPostfix] private static void TryCreateBatteryUiP(ref WalkieBatteryUI ____batteryUi) { Image[] componentsInChildren = ((Component)____batteryUi).gameObject.GetComponentsInChildren<Image>(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Behaviour)componentsInChildren[i]).enabled = false; } } } }