Skip to content

Commit

Permalink
fixed JRM transparency (#1217)
Browse files Browse the repository at this point in the history
fixed JRM transparency
  • Loading branch information
kianzarrin authored Dec 8, 2021
1 parent 9cc7ba4 commit 2529372
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions TLM/TLM/UI/Helpers/TrafficRulesOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public SignsLayout(ushort segmentId,

dirX_ = (segmentEnd.LeftCorner - segmentEnd.RightCorner).normalized;

// for curved angled segements, corner1Direction may slightly differ from corner2Direction
// for curved angled segments, corner1Direction may slightly differ from corner2Direction
dirY_ = (segmentEnd.LeftCornerDir + segmentEnd.RightCornerDir) * 0.5f;

// origin point to start drawing sprites from.
Expand Down Expand Up @@ -138,19 +138,13 @@ public bool DrawSign(bool small,
if (viewOnly_) {
// Readonly signs look grey-ish
guiColor = Color.Lerp(guiColor, Color.gray, 0.5f);
guiColor.a = TrafficManagerTool.GetHandleAlpha(hovered: false);
} else {
// Handles in edit mode are always visible. Hovered handles are also highlighted.
guiColor.a = 1f;

if (hoveredHandle) {
guiColor = Color.Lerp(
a: guiColor,
b: new Color(r: 1f, g: .7f, b: 0f),
t: 0.5f);
}
} else if (hoveredHandle) {
guiColor = Color.Lerp(
a: guiColor,
b: new Color(r: 1f, g: .7f, b: 0f),
t: 0.5f);
}
// guiColor.a = TrafficManagerTool.GetHandleAlpha(hoveredHandle);
guiColor.a = TrafficManagerTool.GetHandleAlpha(hoveredHandle);

GUI.color = guiColor;
GUI.DrawTexture(boundingBox, signTexture);
Expand Down

0 comments on commit 2529372

Please sign in to comment.