OpenTTD Source 20260311-master-g511d3794ce
script_gui.h File Reference

Window for configuring the scripts. More...

#include "../company_type.h"
#include "../textfile_type.h"

Go to the source code of this file.

Functions

void ShowScriptListWindow (CompanyID slot, bool show_all)
 Open the Script list window to chose a script for the given company slot.
WindowShowScriptDebugWindow (CompanyID show_company=CompanyID::Invalid(), bool new_window=false)
 Open the Script debug window and select the given company.
void ShowScriptSettingsWindow (CompanyID slot)
 Open the Script settings window to change the Script settings for a Script.
void ShowScriptTextfileWindow (Window *parent, TextfileType file_type, CompanyID slot)
 Open the Script version of the textfile window.
void ShowScriptDebugWindowIfScriptError ()
 Open the AI debug window if one of the AI scripts has crashed.
void InitializeScriptGui ()
 Reset the Script windows to their initial state.

Detailed Description

Window for configuring the scripts.

Definition in file script_gui.h.

Function Documentation

◆ InitializeScriptGui()

void InitializeScriptGui ( )

Reset the Script windows to their initial state.

Definition at line 1302 of file script_gui.cpp.

◆ ShowScriptDebugWindow()

Window * ShowScriptDebugWindow ( CompanyID show_company,
bool new_window )

Open the Script debug window and select the given company.

Parameters
show_companyDisplay debug information about this AI company.
new_windowShow in new window instead of existing window.
Returns
The existing or allocated window, or nullptr when there is no debug window to show.

Definition at line 1268 of file script_gui.cpp.

References _network_server, _networking, _script_debug_desc, BringWindowToFrontById(), ScriptDebugWindow::ChangeToScript(), FindWindowByClass(), FindWindowById(), GetEncodedString(), ScriptDebugWindow::FilterState::script_debug_company, ShowErrorMessage(), WC_SCRIPT_DEBUG, Window::window_class, Window::window_number, and WL_INFO.

Referenced by ScriptDebugWindow::ChangeToScript(), AIInstance::Died(), GameInstance::Died(), MenuClickHelp(), MainToolbarWindow::OnHotkey(), ScriptDebugWindow::ScriptDebugGlobalHotkeys(), and ShowScriptDebugWindowIfScriptError().

◆ ShowScriptDebugWindowIfScriptError()

void ShowScriptDebugWindowIfScriptError ( )

Open the AI debug window if one of the AI scripts has crashed.

Definition at line 1308 of file script_gui.cpp.

References _network_server, _networking, Game::GetInstance(), ScriptInstance::IsDead(), OWNER_DEITY, and ShowScriptDebugWindow().

Referenced by StartScripts().

◆ ShowScriptListWindow()

void ShowScriptListWindow ( CompanyID slot,
bool show_all )

Open the Script list window to chose a script for the given company slot.

Parameters
slotThe slot to change the script of.
show_allWhether to show all available versions.

Definition at line 278 of file script_gui.cpp.

References _script_list_desc, CloseWindowByClass(), and WC_SCRIPT_LIST.

Referenced by AIConfigWindow::OnClick(), and GSConfigWindow::OnClick().

◆ ShowScriptSettingsWindow()

void ShowScriptSettingsWindow ( CompanyID slot)

Open the Script settings window to change the Script settings for a Script.

Parameters
slotThe CompanyID of the Script to change the settings.

Definition at line 588 of file script_gui.cpp.

References _script_settings_desc, CloseWindowByClass(), WC_SCRIPT_LIST, and WC_SCRIPT_SETTINGS.

Referenced by AIConfigWindow::OnClick(), and ScriptDebugWindow::OnClick().

◆ ShowScriptTextfileWindow()

void ShowScriptTextfileWindow ( Window * parent,
TextfileType file_type,
CompanyID slot )

Open the Script version of the textfile window.

Parameters
parentThe window we become a child of, and for which other textfile windows are closed.
file_typeThe type of textfile to display.
slotThe slot the Script is using.

Definition at line 632 of file script_gui.cpp.

References Window::CloseChildWindowById(), and WC_TEXTFILE.

Referenced by AIConfigWindow::OnClick(), and GSConfigWindow::OnClick().