diff --git a/application/editormode.cpp b/application/editormode.cpp index bb1b10fe5..b8d0bbac8 100644 --- a/application/editormode.cpp +++ b/application/editormode.cpp @@ -4186,6 +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::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")); if (ImGui::MenuItem(STR_C("Structure gauge"), nullptr, m_gauge.is_open())) m_gauge.toggle(); if (ImGui::IsItemHovered()) diff --git a/application/uilayer.cpp b/application/uilayer.cpp index 3e5a3a50e..b12a724b7 100644 --- a/application/uilayer.cpp +++ b/application/uilayer.cpp @@ -624,8 +624,18 @@ void ui_layer::render_hierarchy(){ void ui_layer::set_cursor(int const Mode) { - glfwSetInputMode(m_window, GLFW_CURSOR, Mode); + // the cursor drawn into the picture: the one of the system hidden, so only that one shows, also in a capture of the window + auto const hidden{Mode == GLFW_CURSOR_NORMAL && m_drawcursor}; + glfwSetInputMode(m_window, GLFW_CURSOR, hidden ? GLFW_CURSOR_HIDDEN : Mode); m_cursorvisible = Mode != GLFW_CURSOR_DISABLED; + if (m_imguiio != nullptr) + m_imguiio->MouseDrawCursor = m_drawcursor && m_cursorvisible; +} + +void ui_layer::draw_cursor(bool const Draw) +{ + m_drawcursor = Draw; + set_cursor(m_cursorvisible ? GLFW_CURSOR_NORMAL : GLFW_CURSOR_DISABLED); } void ui_layer::set_progress(std::string const &Text) diff --git a/application/uilayer.h b/application/uilayer.h index 462c8dc1e..a2443d04d 100644 --- a/application/uilayer.h +++ b/application/uilayer.h @@ -104,6 +104,9 @@ public: static void begin_ui_frame_internal(); // static void set_cursor( int Mode ); + // the cursor drawn into the picture by the interface instead of the system: seen in a stream or a recording of the window + static void draw_cursor( bool Draw ); + static bool drawn_cursor() { return m_drawcursor; } // loading void set_progress(std::string const &Text); void set_progress(float progress, float subtaskprogress); @@ -139,6 +142,7 @@ protected: static GLFWwindow *m_keywindow; // window of the key event being handled static ImGuiIO *m_imguiio; static bool m_cursorvisible; + static inline bool m_drawcursor{ false }; virtual void render_menu_contents(); // items of the windows menu which belong to the ui of a mode, after the common ones diff --git a/lang/editor_pl.po b/lang/editor_pl.po index c85232dc6..9c6a8c908 100644 --- a/lang/editor_pl.po +++ b/lang/editor_pl.po @@ -14207,3 +14207,9 @@ msgstr "W czasie jazdy: W i S to jazda naprzód i wstecz, z Shift szybciej; A i msgid "Ride along a track with Y" msgstr "Przejedź się po torze klawiszem Y" + +msgid "Cursor drawn into the picture (streams)" +msgstr "Kursor rysowany w obrazie (stream)" + +msgid "The pointer drawn by the editor into the frame instead of the one of the system: seen by those watching a stream\nor a recording of the window (Discord, OBS, the capture of the system), which leave the system pointer out" +msgstr "Wskaźnik rysowany przez edytor w klatce zamiast systemowego: widać go w streamie\ni w nagraniu okna (Discord, OBS, przechwytywanie systemowe), które pomijają wskaźnik systemu"