mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
Codechange: Add utility function for whether the focused window is a console
This commit is contained in:
parent
81f159434d
commit
1dba06656d
@ -466,6 +466,15 @@ bool EditBoxInGlobalFocus()
|
||||
return _focused_window->nested_focus != nullptr && _focused_window->nested_focus->type == WWT_EDITBOX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a console is focused.
|
||||
* @return returns true if the focused window is a console, else false
|
||||
*/
|
||||
bool FocusedWindowIsConsole()
|
||||
{
|
||||
return _focused_window && _focused_window->window_class == WC_CONSOLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes no widget on this window have focus. The function however doesn't change which window has focus.
|
||||
*/
|
||||
|
@ -55,6 +55,7 @@ void DeleteWindowById(WindowClass cls, WindowNumber number, bool force = true);
|
||||
void DeleteWindowByClass(WindowClass cls);
|
||||
|
||||
bool EditBoxInGlobalFocus();
|
||||
bool FocusedWindowIsConsole();
|
||||
Point GetCaretPosition();
|
||||
|
||||
#endif /* WINDOW_FUNC_H */
|
||||
|
Loading…
Reference in New Issue
Block a user