mirror of
https://github.com/rmroc451/TweaksAndThings.git
synced 2025-12-17 17:59:39 -06:00
remove SetActive call, which seems to be a performance gain when tags are displayed.
This commit is contained in:
@@ -3,9 +3,7 @@ using Model;
|
|||||||
using Model.OpsNew;
|
using Model.OpsNew;
|
||||||
using Railloader;
|
using Railloader;
|
||||||
using RMROC451.TweaksAndThings.Extensions;
|
using RMROC451.TweaksAndThings.Extensions;
|
||||||
using UI;
|
|
||||||
using UI.Tags;
|
using UI.Tags;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace RMROC451.TweaksAndThings.Patches;
|
namespace RMROC451.TweaksAndThings.Patches;
|
||||||
|
|
||||||
@@ -19,7 +17,6 @@ internal class TagController_UpdateTag_Patch
|
|||||||
|
|
||||||
private static void Postfix(Car car, TagCallout tagCallout)
|
private static void Postfix(Car car, TagCallout tagCallout)
|
||||||
{
|
{
|
||||||
TagController tagController = UnityEngine.Object.FindObjectOfType<TagController>();
|
|
||||||
TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase<TweaksAndThingsPlugin>.Shared;
|
TweaksAndThingsPlugin tweaksAndThings = SingletonPluginBase<TweaksAndThingsPlugin>.Shared;
|
||||||
|
|
||||||
if (!tweaksAndThings.IsEnabled || !tweaksAndThings.settings.HandBrakeAndAirTagModifiers)
|
if (!tweaksAndThings.IsEnabled || !tweaksAndThings.settings.HandBrakeAndAirTagModifiers)
|
||||||
@@ -27,24 +24,14 @@ internal class TagController_UpdateTag_Patch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProceedWithPostFix(car, tagCallout, tagController);
|
ProceedWithPostFix(car, tagCallout);
|
||||||
|
|
||||||
return;
|
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.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 =
|
tagCallout.callout.Title =
|
||||||
(car.CarAndEndGearIssue(), car.EndAirSystemIssue(), car.HandbrakeApplied()) switch
|
(car.CarAndEndGearIssue(), car.EndAirSystemIssue(), car.HandbrakeApplied()) switch
|
||||||
|
|||||||
Reference in New Issue
Block a user