Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools GUI windows - disable click through UI background #1443

Merged
merged 7 commits into from
Mar 4, 2022
5 changes: 5 additions & 0 deletions TLM/TLM/UI/Helpers/Highlight.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TrafficManager.UI.Helpers {
using ColossalFramework;
using ColossalFramework.Math;
using ColossalFramework.UI;
using TrafficManager.Util;
using TrafficManager.Util.Extensions;
using UnityEngine;
Expand Down Expand Up @@ -384,6 +385,10 @@ public static bool DrawGenericOverlayTexture(Texture2D texture,
GUI.color = guiColor;
GUI.DrawTexture(screenRect, texture);

if (hovered) {
UIInput.MouseUsed();
}

return hovered;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ public override void OnToolGUI(Event e) {
break;
}
}

if (_cursorInSecondaryPanel) {
UIInput.MouseUsed();
}
}

public override void RenderOverlay(RenderManager.CameraInfo cameraInfo) {
Expand Down Expand Up @@ -2550,6 +2554,8 @@ ref nodeId.ToNode(),
if (!hoveredSegment) {
_hoveredButton[0] = 0;
_hoveredButton[1] = 0;
} else {
UIInput.MouseUsed();
}
}

Expand Down
5 changes: 5 additions & 0 deletions TLM/TLM/UI/SubTools/VehicleRestrictionsTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace TrafficManager.UI.SubTools {
using ColossalFramework;
using static Util.SegmentLaneTraverser;
using System.Collections.Generic;
using ColossalFramework.UI;
using TrafficManager.API.Traffic.Enums;
using TrafficManager.Manager.Impl;
using TrafficManager.State;
Expand Down Expand Up @@ -163,6 +164,10 @@ public override void OnToolGUI(Event e) {
// overlayHandleHovered = false;
}

if (cursorInSecondaryPanel) {
UIInput.MouseUsed();
}

// ShowSigns(false);
}

Expand Down
2 changes: 1 addition & 1 deletion TLM/TLM/UI/WhatsNew/WhatsNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static Version PreviouslySeenVersion {
}
}

public bool Shown => PreviouslySeenVersion >= CurrentVersion;
public bool Shown => CurrentVersion <= PreviouslySeenVersion;
krzychu124 marked this conversation as resolved.
Show resolved Hide resolved

public List<Changelog> Changelogs { get; private set; }

Expand Down