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

Method Close

src/script/api/script_window.cpp:18–30  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

16#include "../../safeguards.h"
17
18/* static */ void ScriptWindow::Close(WindowClass window, SQInteger number)
19{
20 if (ScriptGame::IsMultiplayer()) return;
21
22 if (number == NUMBER_ALL) {
23 CloseWindowByClass((::WindowClass)window);
24 return;
25 }
26
27 number = Clamp<SQInteger>(number, 0, INT32_MAX);
28
29 CloseWindowById((::WindowClass)window, number);
30}
31
32/* static */ bool ScriptWindow::IsOpen(WindowClass window, SQInteger number)
33{

Callers 5

OnInvalidateDataMethod · 0.45
OnClickMethod · 0.45
OnInvalidateDataMethod · 0.45
OnInvalidateDataMethod · 0.45
OnInvalidateDataMethod · 0.45

Calls 2

CloseWindowByClassFunction · 0.85
CloseWindowByIdFunction · 0.85

Tested by

no test coverage detected