MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FindWindowById

Function FindWindowById

src/window.cpp:1153–1160  ·  view source on GitHub ↗

* Find a window by its class and window number * @param cls Window class * @param number Number of the window within the window class * @return Pointer to the found window, or \c nullptr if not available */

Source from the content-addressed store, hash-verified

1151 * @return Pointer to the found window, or \c nullptr if not available
1152 */
1153Window *FindWindowById(WindowClass cls, WindowNumber number)
1154{
1155 for (Window *w : Window::Iterate()) {
1156 if (w->window_class == cls && w->window_number == number) return w;
1157 }
1158
1159 return nullptr;
1160}
1161
1162/**
1163 * Find any window by its class. Useful when searching for a window that uses

Callers 15

DeleteRenameSignWindowFunction · 0.85
LoadFromConfigFunction · 0.85
ShowExtraViewportWindowFunction · 0.85
OnClickMethod · 0.85
UpdateOSKOriginalTextFunction · 0.85
IsOSKOpenedForFunction · 0.85
UnshowCriticalErrorFunction · 0.85
ShowErrorMessageFunction · 0.85
HideActiveErrorMessageFunction · 0.85
OnDropdownCloseMethod · 0.85
GetMainWindowFunction · 0.85
CloseWindowByIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected