feat(console): rework (selectable/copyable log text entries) #2908
+564
−71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal of this PR
The goal of this PR is to enhance the functionality and usability of the client and server consoles by implementing selectable and copyable text, improving the user experience, and resolving various interface issues. This includes ensuring that the console input fields are more user-friendly and maintain proper focus behavior, while also improving the visual consistency and functionality of the consoles.
Cfx_selectable_console_log.mp4
How is this PR achieving the goal
Selectable/Copyable Text: Introduced a submodule that provides the functionality to select and copy text in ImGui windows. This has been implemented on all available consoles.
Modified the text input behavior so that the consoles' text input fields automatically gain focus when no other keyboard-interactive items are active.
Addressed viewport overflow issues that caused the entire console window to become scrollable.
Adjusted window padding to align with the inner item spacing.
The autoscroll ConVar is now initialized only on the client side.
Implemented support for disabling autoscrolling in the server console (svgui).
Ensured proper synchronization of the autoscroll state between the big console and the win console.
Updated the minicon behavior to prevent it from gaining focus when its viewport is clicked, allowing users to maintain focus on the big console regardless of the current mouse position.
Modified the draw FPS item to not gain focus upon activation.
Enhanced code style and performed general code cleanup
Dependency:
The submodule must either be transferred to the organization or included directly by source. Using the upstream repository is not feasible due to multiple modifications required to integrate it with the FiveM codebase. For reference, changes that were needed can be found here: https://github.com/tens0rfl0w/ImGuiTextSelect.
This PR applies to the following area(s)
FiveM, Server
Successfully tested on
Game builds: Not applicable
Platforms: Windows, Linux
Checklist
Fixes issues
/