Skip to content

Commit c236a30

Browse files
committed
Fixes after merge with Master
1 parent 554ddb8 commit c236a30

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed

TLM/TLM/UI/SubTools/JunctionRestrictionsTool.cs

+30-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ namespace TrafficManager.UI.SubTools {
22
using ColossalFramework;
33
using CSUtil.Commons;
44
using System.Collections.Generic;
5-
using TrafficManager.API.Manager;
65
using TrafficManager.Manager.Impl;
76
using TrafficManager.State.ConfigData;
87
using TrafficManager.State;
9-
using TrafficManager.UI.Textures;
108
using UnityEngine;
119
using TrafficManager.State.Keybinds;
1210
using TrafficManager.UI.SubTools.PrioritySigns;
13-
using TrafficManager.UI.MainMenu.OSD;
1411
using TrafficManager.Util;
1512
using static TrafficManager.Util.Shortcuts;
1613
using TrafficManager.UI.Helpers;
14+
using TrafficManager.UI.MainMenu.OSD;
1715

1816
public class JunctionRestrictionsTool
1917
: LegacySubTool,
@@ -216,5 +214,33 @@ private void RefreshCurrentRestrictedNodeIds(ushort forceNodeId = 0) {
216214
}
217215
}
218216
}
219-
}
217+
218+
private static string T(string key) => Translation.JunctionRestrictions.Get(key);
219+
220+
public void UpdateOnscreenDisplayPanel() {
221+
if (SelectedNodeId == 0) {
222+
// Select mode
223+
var items = new List<OsdItem>();
224+
items.Add(
225+
new UI.MainMenu.OSD.ModeDescription(
226+
localizedText: T("JR.OnscreenHint.Mode:Select")));
227+
OnscreenDisplay.Display(items);
228+
return;
229+
} else {
230+
// Edit mode
231+
var items = new List<OsdItem>();
232+
items.Add(
233+
new UI.MainMenu.OSD.Shortcut(
234+
keybindSetting: KeybindSettingsBase.LaneConnectorDelete,
235+
localizedText: T("JR.OnscreenHint.Reset:Reset to default")));
236+
237+
items.Add(OnscreenDisplay.RightClick_LeaveNode());
238+
OnscreenDisplay.Display(items);
239+
return;
240+
}
241+
242+
// Default: no hint
243+
// OnscreenDisplay.Clear();
244+
}
245+
} // end class
220246
}

TLM/TLM/UI/SubTools/SpeedLimits/SpeedLimitsTool.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,19 @@ public override void OnToolGUI(Event e) {
126126
: 8 * (GUI_SPEED_SIGN_SIZE + 5);
127127

128128
paletteWindowRect = GUILayout.Window(
129-
254,
130-
paletteWindowRect,
131-
GuiSpeedLimitsWindow,
132-
Translation.Menu.Get("Tooltip:Speed limits") + unitTitle,
133-
WindowStyle);
129+
id: 254,
130+
screenRect: paletteWindowRect,
131+
func: GuiSpeedLimitsWindow,
132+
text: Translation.Menu.Get("Tooltip:Speed limits") + unitTitle,
133+
style: WindowStyle);
134134

135135
if (defaultsWindowVisible) {
136136
defaultsWindowRect = GUILayout.Window(
137-
258,
138-
defaultsWindowRect,
139-
GuiDefaultsWindow,
140-
Translation.SpeedLimits.Get("Window.Title:Default speed limits"),
141-
WindowStyle);
137+
id: 258,
138+
screenRect: defaultsWindowRect,
139+
func: GuiDefaultsWindow,
140+
text: Translation.SpeedLimits.Get("Window.Title:Default speed limits"),
141+
style: WindowStyle);
142142
}
143143

144144
cursorInSecondaryPanel = paletteWindowRect.Contains(Event.current.mousePosition)

0 commit comments

Comments
 (0)