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

Function CloseAllNonVitalWindows

src/window.cpp:3358–3366  ·  view source on GitHub ↗

* It is possible that a stickied window gets to a position where the * 'close' button is outside the gaming area. You cannot close it then; except * with this function. It closes all windows calling the standard function, * then, does a little hacked loop of closing all stickied windows. Note * that standard windows (status bar, etc.) are not stickied, so these aren't affected */

Source from the content-addressed store, hash-verified

3356 * that standard windows (status bar, etc.) are not stickied, so these aren't affected
3357 */
3358void CloseAllNonVitalWindows()
3359{
3360 /* Note: the container remains stable, even when closing windows. */
3361 for (Window *w : Window::Iterate()) {
3362 if (!w->window_desc.flags.Test(WindowDefaultFlag::NoClose)) {
3363 w->Close();
3364 }
3365 }
3366}
3367
3368/**
3369 * Delete all messages and close their corresponding window (if any).

Callers 3

StartGeneratingLandscapeFunction · 0.85
GenerateWorldFunction · 0.85
OnHotkeyMethod · 0.85

Calls 2

TestMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected