From b691ef4d20eb9db71ab3c98e0934564f43db77b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 11:34:38 +0100 Subject: [PATCH] fix(editor): the drawn cursor is the editor's: off when it's left, back on when it's entered Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ --- application/editormode.cpp | 11 +++++++++-- application/editormode.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/editormode.cpp b/application/editormode.cpp index b8d0bbac8..beb80655e 100644 --- a/application/editormode.cpp +++ b/application/editormode.cpp @@ -4186,8 +4186,11 @@ void editor_mode::render_view_menu() ImGui::MenuItem(STR_C("Show lanes"), nullptr, &m_roadtool.lanes); if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", STR_C("The lanes of the roads drawn as the paths the vehicles take")); - if (ImGui::MenuItem(STR_C("Cursor drawn into the picture (streams)"), nullptr, ui_layer::drawn_cursor())) - ui_layer::draw_cursor(false == ui_layer::drawn_cursor()); + if (ImGui::MenuItem(STR_C("Cursor drawn into the picture (streams)"), nullptr, m_draw_cursor)) + { + m_draw_cursor = !m_draw_cursor; + ui_layer::draw_cursor(m_draw_cursor); + } if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", STR_C("The pointer drawn by the editor into the frame instead of the one of the system: seen by those watching a stream\n" "or a recording of the window (Discord, OBS, the capture of the system), which leave the system pointer out")); @@ -6907,6 +6910,8 @@ void editor_mode::enter() track_sleepers::lay_in_background(false); // the editor may remove the tracks and the vehicles the recording refers to: it ends here simulation::Blackbox.close(); + // the cursor drawn into the picture is the editor's: back on when it comes back, if it was chosen + ui_layer::draw_cursor(m_draw_cursor); if (simulation::Region != nullptr) { @@ -7006,6 +7011,8 @@ void editor_mode::exit() { m_ride.leave(); track_sleepers::lay_in_background(true); + // the driver's view has no menu to switch the drawn cursor off: the system one there + ui_layer::draw_cursor(false); Global.editor_tracks = false; EditorModeFlag = false; Global.ControlPicking = m_statebackup.picking; diff --git a/application/editormode.h b/application/editormode.h index ef6202f38..36598e593 100644 --- a/application/editormode.h +++ b/application/editormode.h @@ -240,6 +240,7 @@ class editor_mode : public application_mode, private editor_track::observer, pri bool m_dragging = false; glm::dvec3 oldPos; // world position of the last brush placement bool m_brush_has_last{false}; // false at the start of a brush stroke, so the first placement ignores spacing + bool m_draw_cursor{false}; // the cursor drawn into the picture (View menu), on only while the editor is bool mouseHold{false}; float kMaxPlacementDistance = 200.0f; static bool m_change_history;