Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Objective Currently, there appears to be no way to tell if the console is open. This is an almost required feature for a console as without it you cannot block inputs while using the console or control how the mouse behaves when the console is open. ## Solution - Exposed the ConsoleUiState struct (keeping the fields as only crate public) - Exposed a function that returns whether the console is currently open ## Imagined usage (with the console only conditionally included in the project) ```rust fn keyboard_update( ..., #[cfg(debug_assertions)] console: Res<ConsoleUiState> ) { #[cfg(debug_assertions)] if console.open() { return; } ... } ``` I can also see this being useful for locking and unlocking the mouse based on whether the console is visible. ## Other There also appears to be a `text_focus` field however this appears to not be updated while the console is presented. In the future, it'd be nice to have an `text_focused()` method so that an open console only blocks input when the text field is selected. --------- Co-authored-by: Robert-M-Lucas <[email protected]>
- Loading branch information