From 80d064c9507769bd859a36a1938b8308f35cd580 Mon Sep 17 00:00:00 2001 From: RMROC451 Date: Wed, 24 Jul 2024 00:03:11 -0500 Subject: [PATCH] remove SetActive call, which seems to be a performance gain when tags are displayed. --- .../Patches/TagController_UpdateTag_Patch.cs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/TweaksAndThings/Patches/TagController_UpdateTag_Patch.cs b/TweaksAndThings/Patches/TagController_UpdateTag_Patch.cs index 825f595..a9acf17 100644 --- a/TweaksAndThings/Patches/TagController_UpdateTag_Patch.cs +++ b/TweaksAndThings/Patches/TagController_UpdateTag_Patch.cs @@ -3,9 +3,7 @@ using Model; using Model.OpsNew; using Railloader; using RMROC451.TweaksAndThings.Extensions; -using UI; using UI.Tags; -using UnityEngine; namespace RMROC451.TweaksAndThings.Patches; @@ -19,7 +17,6 @@ internal class TagController_UpdateTag_Patch private static void Postfix(Car car, TagCallout tagCallout) { - TagController tagController = UnityEngine.Object.FindObjectOfType(); TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase.Shared; if (!tweaksAndThings.IsEnabled || !tweaksAndThings.settings.HandBrakeAndAirTagModifiers) @@ -27,24 +24,14 @@ internal class TagController_UpdateTag_Patch return; } - ProceedWithPostFix(car, tagCallout, tagController); + ProceedWithPostFix(car, tagCallout); return; } - private static void ProceedWithPostFix(Car car, TagCallout tagCallout, TagController tagController) + private static void ProceedWithPostFix(Car car, TagCallout tagCallout) { - bool isAltDownWithCarIssue = GameInput.IsAltDown && car.CarOrEndGearIssue(); tagCallout.callout.Title = string.Format(tagTitleFormat, "{0}", car.DisplayName); - tagCallout.gameObject.SetActive( - tagCallout.gameObject.activeSelf && - (!GameInput.IsAltDown || isAltDownWithCarIssue) - ); - - if (tagCallout.gameObject.activeSelf && isAltDownWithCarIssue) - { - tagController.ApplyImageColor(tagCallout, Color.black); - } tagCallout.callout.Title = (car.CarAndEndGearIssue(), car.EndAirSystemIssue(), car.HandbrakeApplied()) switch