|
OpenTTD GameScript API
14.0-RC1
|
Class that handles window interaction. More...
Static Public Member Functions | |
| static void | Close (WindowClass window, SQInteger number) |
| Close a window. More... | |
| static bool | IsOpen (WindowClass window, SQInteger number) |
| Check if a window is open. More... | |
| static void | Highlight (WindowClass window, SQInteger number, SQInteger widget, TextColour colour) |
| Highlight a widget in a window. More... | |
Class that handles window interaction.
A Window in OpenTTD has two important values. The WindowClass, and a Window number. The first indicates roughly which window it is. WC_TOWN_VIEW for example, is the view of a town. The Window number is a bit more complex, as it depends mostly on the WindowClass. For example for WC_TOWN_VIEW it is the TownID. In general a good rule of thumb is: either the number is always 0, or the ID of the object in question. In the comment at the widget enum, it is mentioned how the number is used.
Note, that the detailed window layout is very version specific. Enum values might be added, changed or removed in future versions without notice in the changelog, and there won't be any means of compatibility.
| enum GSWindow::NumberType |
| enum GSWindow::TextColour |
The colours in the game which you can use for text and highlights.
| enum GSWindow::WidgetType |
Window classes.
| Enumerator | |
|---|---|
| WC_NONE | No window, redirects to WC_MAIN_WINDOW. |
| WC_MAIN_WINDOW | Main window; Window numbers:
|
| WC_MAIN_TOOLBAR | Main toolbar (the long bar at the top); Window numbers:
|
| WC_STATUS_BAR | Statusbar (at the bottom of your screen); Window numbers:
|
| WC_BUILD_TOOLBAR | Build toolbar; Window numbers:
|
| WC_SCEN_BUILD_TOOLBAR | Scenario build toolbar; Window numbers:
|
| WC_BUILD_TREES | Build trees toolbar; Window numbers:
|
| WC_TRANSPARENCY_TOOLBAR | Transparency toolbar; Window numbers:
|
| WC_BUILD_SIGNAL | Build signal toolbar; Window numbers:
|
| WC_SMALLMAP | Small map; Window numbers:
|
| WC_ERRMSG | Error message; Window numbers:
|
| WC_TOOLTIPS | Tooltip window; Window numbers:
|
| WC_QUERY_STRING | Query string window; Window numbers:
|
| WC_CONFIRM_POPUP_QUERY | Popup with confirm question; Window numbers:
|
| WC_GOAL_QUESTION | Popup with a set of buttons, designed to ask the user a question from a GameGS. Window numbers:
|
| WC_SAVELOAD | Saveload window; Window numbers:
|
| WC_LAND_INFO | Land info window; Window numbers:
|
| WC_DROPDOWN_MENU | Drop down menu; Window numbers:
|
| WC_OSK | On Screen Keyboard; Window numbers:
|
| WC_SET_DATE | Set date; Window numbers:
|
| WC_SCRIPT_SETTINGS | GS settings; Window numbers:
|
| WC_GRF_PARAMETERS | NewGRF parameters; Window numbers:
|
| WC_TEXTFILE | textfile; Window numbers:
|
| WC_TOWN_AUTHORITY | Town authority; Window numbers:
|
| WC_VEHICLE_DETAILS | Vehicle details; Window numbers:
|
| WC_VEHICLE_REFIT | Vehicle refit; Window numbers:
|
| WC_VEHICLE_ORDERS | Vehicle orders; Window numbers:
|
| WC_REPLACE_VEHICLE | Replace vehicle window; Window numbers:
|
| WC_VEHICLE_TIMETABLE | Vehicle timetable; Window numbers:
|
| WC_COMPANY_COLOUR | Company colour selection; Window numbers:
|
| WC_COMPANY_MANAGER_FACE | Alter company face window; Window numbers:
|
| WC_SELECT_STATION | Select station (when joining stations); Window numbers:
|
| WC_NEWS_WINDOW | News window; Window numbers:
|
| WC_TOWN_DIRECTORY | Town directory; Window numbers:
|
| WC_SUBSIDIES_LIST | Subsidies list; Window numbers:
|
| WC_INDUSTRY_DIRECTORY | Industry directory; Window numbers:
|
| WC_MESSAGE_HISTORY | News history list; Window numbers:
|
| WC_SIGN_LIST | Sign list; Window numbers:
|
| WC_SCRIPT_LIST | GSs list; Window numbers:
|
| WC_GOALS_LIST | Goals list; Window numbers:
|
| WC_STORY_BOOK | Story book; Window numbers:
|
| WC_STATION_LIST | Station list; Window numbers:
|
| WC_TRAINS_LIST | Trains list; Window numbers:
|
| WC_ROADVEH_LIST | Road vehicle list; Window numbers:
|
| WC_SHIPS_LIST | Ships list; Window numbers:
|
| WC_AIRCRAFT_LIST | Aircraft list; Window numbers:
|
| WC_TOWN_VIEW | Town view; Window numbers:
|
| WC_VEHICLE_VIEW | Vehicle view; Window numbers:
|
| WC_STATION_VIEW | Station view; Window numbers:
|
| WC_VEHICLE_DEPOT | Depot view; Window numbers:
|
| WC_WAYPOINT_VIEW | Waypoint view; Window numbers:
|
| WC_INDUSTRY_VIEW | Industry view; Window numbers:
|
| WC_COMPANY | Company view; Window numbers:
|
| WC_BUILD_OBJECT | Build object; Window numbers:
|
| WC_BUILD_VEHICLE | Build vehicle; Window numbers:
|
| WC_BUILD_BRIDGE | Build bridge; Window numbers:
|
| WC_BUILD_STATION | Build station; Window numbers:
|
| WC_BUS_STATION | Build bus station; Window numbers:
|
| WC_TRUCK_STATION | Build truck station; Window numbers:
|
| WC_BUILD_DEPOT | Build depot; Window numbers:
|
| WC_BUILD_WAYPOINT | Build waypoint; Window numbers:
|
| WC_FOUND_TOWN | Found a town; Window numbers:
|
| WC_BUILD_INDUSTRY | Build industry; Window numbers:
|
| WC_SELECT_GAME | Select game window; Window numbers:
|
| WC_SCEN_LAND_GEN | Landscape generation (in Scenario Editor); Window numbers:
|
| WC_GENERATE_LANDSCAPE | Generate landscape (newgame); Window numbers:
|
| WC_MODAL_PROGRESS | Progress report of landscape generation; Window numbers:
|
| WC_NETWORK_WINDOW | Network window; Window numbers:
|
| WC_CLIENT_LIST | Client list; Window numbers:
|
| WC_NETWORK_STATUS_WINDOW | Network status window; Window numbers:
|
| WC_NETWORK_ASK_RELAY | Network ask relay window; Window numbers:
|
| WC_NETWORK_ASK_SURVEY | Network ask survey window; Window numbers:
|
| WC_SEND_NETWORK_MSG | Chatbox; Window numbers:
|
| WC_COMPANY_PASSWORD_WINDOW | Company password query; Window numbers:
|
| WC_INDUSTRY_CARGOES | Industry cargoes chain; Window numbers:
|
| WC_GRAPH_LEGEND | Legend for graphs; Window numbers:
|
| WC_FINANCES | Finances of a company; Window numbers:
|
| WC_INCOME_GRAPH | Income graph; Window numbers:
|
| WC_OPERATING_PROFIT | Operating profit graph; Window numbers:
|
| WC_DELIVERED_CARGO | Delivered cargo graph; Window numbers:
|
| WC_PERFORMANCE_HISTORY | Performance history graph; Window numbers:
|
| WC_COMPANY_VALUE | Company value graph; Window numbers:
|
| WC_COMPANY_LEAGUE | Company league window; Window numbers:
|
| WC_PAYMENT_RATES | Payment rates graph; Window numbers:
|
| WC_PERFORMANCE_DETAIL | Performance detail window; Window numbers:
|
| WC_COMPANY_INFRASTRUCTURE | Company infrastructure overview; Window numbers:
|
| WC_BUY_COMPANY | Buyout company (merger); Window numbers:
|
| WC_ENGINE_PREVIEW | Engine preview window; Window numbers:
|
| WC_MUSIC_WINDOW | Music window; Window numbers:
|
| WC_MUSIC_TRACK_SELECTION | Music track selection; Window numbers:
|
| WC_GAME_OPTIONS | Game options window; Window numbers:
|
| WC_CUSTOM_CURRENCY | Custom currency; Window numbers:
|
| WC_CHEATS | Cheat window; Window numbers:
|
| WC_EXTRA_VIEWPORT | Extra viewport; Window numbers:
|
| WC_CONSOLE | Console; Window numbers:
|
| WC_BOOTSTRAP | Bootstrap; Window numbers:
|
| WC_HIGHSCORE | Highscore; Window numbers:
|
| WC_ENDSCREEN | Endscreen; Window numbers:
|
| WC_SCRIPT_DEBUG | GS debug window; Window numbers:
|
| WC_NEWGRF_INSPECT | NewGRF inspect (debug); Window numbers:
|
| WC_SPRITE_ALIGNER | Sprite aligner (debug); Window numbers:
|
| WC_LINKGRAPH_LEGEND | Linkgraph legend; Window numbers:
|
| WC_SAVE_PRESET | Save preset; Window numbers:
|
| WC_FRAMERATE_DISPLAY | Framerate display; Window numbers:
|
| WC_FRAMETIME_GRAPH | Frame time graph; Window numbers:
|
| WC_SCREENSHOT | Screenshot window; Window numbers:
|
| WC_INVALID | Invalid window. |
Window numbers.
|
static |
Close a window.
| window | The class of the window to close. |
| number | The number of the window to close, or NUMBER_ALL to close all of this class. The value will be clamped to 0 .. MAX(int32_t) when value is not NUMBER_ALL. |
|
static |
Highlight a widget in a window.
| window | The class of the window to highlight a widget in. |
| number | The number of the window to highlight a widget in. The value will be clamped to 0 .. MAX(int32_t) when value is not NUMBER_ALL. |
| widget | The widget in the window to highlight, or WIDGET_ALL (in combination with TC_INVALID) to disable all widget highlighting on this window. The value will be clamped to 0 .. MAX(uint8_t) when value is not WIDGET_ALL. |
| colour | The colour of the highlight, or TC_INVALID for disabling. |
|
static |
Check if a window is open.
| window | The class of the window to check for. |
| number | The number of the window to check for, or NUMBER_ALL to check for any in the class. The value will be clamped to 0 .. MAX(int32_t) when value is not NUMBER_ALL. |
1.8.17