Exemple #1
0
        /// <summary>
        /// Called from the <see cref="TrafficManagerTool"/> when update for the Keybinds panel
        /// in MainMenu is requested. Or when we need to change state.
        /// Never call this directly, only as: MainTool.RequestOnscreenDisplayUpdate();
        /// </summary>
        void IOnscreenDisplayProvider.UpdateOnscreenDisplayPanel()
        {
            if (fsm_ == null)
            {
                OnscreenDisplay.Clear();
                return;
            }

            switch (fsm_.State)
            {
            case State.Select: {
                var items = new List <OsdItem>();
                items.Add(
                    new MainMenu.OSD.ModeDescription(
                        localizedText: T("LaneArrows.Mode:Select")));
                items.Add(
                    new MainMenu.OSD.HardcodedMouseShortcut(
                        button: UIMouseButton.Left,
                        shift: false,
                        ctrl: true,
                        alt: false,
                        localizedText: T("LaneArrows.Click:Separate lanes for entire junction")));
                items.Add(
                    new MainMenu.OSD.HardcodedMouseShortcut(
                        button: UIMouseButton.Left,
                        shift: false,
                        ctrl: false,
                        alt: true,
                        localizedText: T("LaneArrows.Click:Separate lanes for segment")));
                OnscreenDisplay.Display(items: items);
                return;
            }

            case State.EditLaneArrows: {
                var items = new List <OsdItem>();
                items.Add(
                    item: new MainMenu.OSD.Shortcut(
                        keybindSetting: KeybindSettingsBase.RestoreDefaultsKey,
                        localizedText: T(key: "LaneConnector.Label:Reset to default")));
                items.Add(item: OnscreenDisplay.RightClick_LeaveSegment());
                OnscreenDisplay.Display(items: items);
                return;
            }

            default: {
                OnscreenDisplay.Clear();
                return;
            }
            }
        }
Exemple #2
0
 /// <summary>Called from GenericFsm when user leaves lane arrow editor, to hide the GUI.</summary>
 private void OnLeaveEditorState()
 {
     OnscreenDisplay.Clear();
     DestroyToolWindow();
 }
Exemple #3
0
 private void OnLeaveSelectState()
 {
     OnscreenDisplay.Clear();
 }