2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file window_type.h Types related to windows */
15 * Even though the ID is signed, actual IDs must be non-negative.
16 * Negative IDs are used for special cases, like denoting 'no widget'.
20 /** %Window numbers. */
21 enum WindowNumberEnum
{
22 WN_GAME_OPTIONS_AI
= 0, ///< AI settings.
23 WN_GAME_OPTIONS_GS
, ///< GS settings.
24 WN_GAME_OPTIONS_ABOUT
, ///< About window.
25 WN_GAME_OPTIONS_NEWGRF_STATE
, ///< NewGRF settings.
26 WN_GAME_OPTIONS_GAME_OPTIONS
, ///< Game options.
27 WN_GAME_OPTIONS_GAME_SETTINGS
, ///< Game settings.
29 WN_QUERY_STRING
= 0, ///< Query string.
30 WN_QUERY_STRING_SIGN
, ///< Query string for signs.
32 WN_CONFIRM_POPUP_QUERY
= 0, ///< Query popup confirm.
33 WN_CONFIRM_POPUP_QUERY_BOOTSTRAP
, ///< Query popup confirm for bootstrap.
35 WN_NETWORK_WINDOW_GAME
= 0, ///< Network game window.
36 WN_NETWORK_WINDOW_CONTENT_LIST
, ///< Network content list.
37 WN_NETWORK_WINDOW_START
, ///< Network start server.
39 WN_NETWORK_STATUS_WINDOW_JOIN
= 0, ///< Network join status.
40 WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD
, ///< Network content download status.
43 /** %Window classes. */
45 WC_NONE
, ///< No window, redirects to WC_MAIN_WINDOW.
48 * Main window; %Window numbers:
51 WC_MAIN_WINDOW
= WC_NONE
,
54 * Main toolbar (the long bar at the top); %Window numbers:
55 * - 0 = #ToolbarNormalWidgets
56 * - 0 = #ToolbarEditorWidgets
61 * Statusbar (at the bottom of your screen); %Window numbers:
62 * - 0 = #StatusbarWidgets
67 * Build toolbar; %Window numbers:
68 * - #TRANSPORT_RAIL = #RailToolbarWidgets
69 * - #TRANSPORT_AIR = #AirportToolbarWidgets
70 * - #TRANSPORT_WATER = #DockToolbarWidgets
71 * - #TRANSPORT_ROAD = #RoadToolbarWidgets
76 * Scenario build toolbar; %Window numbers:
77 * - #TRANSPORT_WATER = #DockToolbarWidgets
78 * - #TRANSPORT_ROAD = #RoadToolbarWidgets
80 WC_SCEN_BUILD_TOOLBAR
,
83 * Build trees toolbar; %Window numbers:
84 * - 0 = #BuildTreesWidgets
89 * Transparency toolbar; %Window numbers:
90 * - 0 = #TransparencyToolbarWidgets
92 WC_TRANSPARENCY_TOOLBAR
,
95 * Build signal toolbar; %Window numbers:
96 * - #TRANSPORT_RAIL = #BuildSignalWidgets
101 * Small map; %Window numbers:
102 * - 0 = #SmallMapWidgets
107 * Error message; %Window numbers:
108 * - 0 = #ErrorMessageWidgets
113 * Tooltip window; %Window numbers:
114 * - 0 = #ToolTipsWidgets
119 * Query string window; %Window numbers:
120 * - #WN_QUERY_STRING = #QueryStringWidgets
121 * - #WN_QUERY_STRING_SIGN = #QueryEditSignWidgets
126 * Popup with confirm question; %Window numbers:
127 * - #WN_CONFIRM_POPUP_QUERY = #QueryWidgets
128 * - #WN_CONFIRM_POPUP_QUERY_BOOTSTRAP = #BootstrapAskForDownloadWidgets
130 WC_CONFIRM_POPUP_QUERY
,
133 * Popup with a set of buttons, designed to ask the user a question
134 * from a GameScript. %Window numbers:
135 * - uniqueid = #GoalQuestionWidgets
141 * Saveload window; %Window numbers:
142 * - 0 = #SaveLoadWidgets
147 * Land info window; %Window numbers:
148 * - 0 = #LandInfoWidgets
153 * Drop down menu; %Window numbers:
154 * - 0 = #DropdownMenuWidgets
159 * On Screen Keyboard; %Window numbers:
160 * - 0 = #OnScreenKeyboardWidgets
165 * Set date; %Window numbers:
166 * - #VehicleID = #SetDateWidgets
172 * Script settings; %Window numbers:
173 * - 0 = #ScriptSettingsWidgets
178 * NewGRF parameters; %Window numbers:
179 * - 0 = #NewGRFParametersWidgets
184 * textfile; %Window numbers:
185 * - 0 = #TextfileWidgets
191 * Town authority; %Window numbers:
192 * - #TownID = #TownAuthorityWidgets
197 * Vehicle details; %Window numbers:
198 * - #VehicleID = #VehicleDetailsWidgets
203 * Vehicle refit; %Window numbers:
204 * - #VehicleID = #VehicleRefitWidgets
209 * Vehicle orders; %Window numbers:
210 * - #VehicleID = #OrderWidgets
215 * Replace vehicle window; %Window numbers:
216 * - #VehicleType = #ReplaceVehicleWidgets
221 * Vehicle timetable; %Window numbers:
222 * - #VehicleID = #VehicleTimetableWidgets
224 WC_VEHICLE_TIMETABLE
,
227 * Company colour selection; %Window numbers:
228 * - #CompanyID = #SelectCompanyLiveryWidgets
233 * Alter company face window; %Window numbers:
234 * - #CompanyID = #SelectCompanyManagerFaceWidgets
236 WC_COMPANY_MANAGER_FACE
,
239 * Select station (when joining stations); %Window numbers:
240 * - 0 = #JoinStationWidgets
245 * News window; %Window numbers:
251 * Town directory; %Window numbers:
252 * - 0 = #TownDirectoryWidgets
257 * Subsidies list; %Window numbers:
258 * - 0 = #SubsidyListWidgets
263 * Industry directory; %Window numbers:
264 * - 0 = #IndustryDirectoryWidgets
266 WC_INDUSTRY_DIRECTORY
,
269 * News history list; %Window numbers:
270 * - 0 = #MessageHistoryWidgets
275 * Sign list; %Window numbers:
276 * - 0 = #SignListWidgets
281 * Scripts list; %Window numbers:
282 * - 0 = #ScriptListWidgets
287 * Goals list; %Window numbers:
288 * - 0 ; #GoalListWidgets
293 * Story book; %Window numbers:
294 * - CompanyID = #StoryBookWidgets
299 * Station list; %Window numbers:
300 * - #CompanyID = #StationListWidgets
305 * Trains list; %Window numbers:
306 * - Packed value = #GroupListWidgets / #VehicleListWidgets
311 * Road vehicle list; %Window numbers:
312 * - Packed value = #GroupListWidgets / #VehicleListWidgets
317 * Ships list; %Window numbers:
318 * - Packed value = #GroupListWidgets / #VehicleListWidgets
323 * Aircraft list; %Window numbers:
324 * - Packed value = #GroupListWidgets / #VehicleListWidgets
330 * Town view; %Window numbers:
331 * - #TownID = #TownViewWidgets
336 * Vehicle view; %Window numbers:
337 * - #VehicleID = #VehicleViewWidgets
342 * Station view; %Window numbers:
343 * - #StationID = #StationViewWidgets
348 * Depot view; %Window numbers:
349 * - #TileIndex = #DepotWidgets
354 * Waypoint view; %Window numbers:
355 * - #WaypointID = #WaypointWidgets
360 * Industry view; %Window numbers:
361 * - #IndustryID = #IndustryViewWidgets
366 * Company view; %Window numbers:
367 * - #CompanyID = #CompanyWidgets
373 * Build object; %Window numbers:
374 * - 0 = #BuildObjectWidgets
379 * Build house; %Window numbers:
380 * - 0 = #BuildHouseWidgets
385 * Build vehicle; %Window numbers:
386 * - #VehicleType = #BuildVehicleWidgets
387 * - #TileIndex = #BuildVehicleWidgets
392 * Build bridge; %Window numbers:
393 * - #TransportType = #BuildBridgeSelectionWidgets
398 * Build station; %Window numbers:
399 * - #TRANSPORT_AIR = #AirportPickerWidgets
400 * - #TRANSPORT_WATER = #DockToolbarWidgets
401 * - #TRANSPORT_RAIL = #BuildRailStationWidgets
406 * Build bus station; %Window numbers:
407 * - #TRANSPORT_ROAD = #BuildRoadStationWidgets
412 * Build truck station; %Window numbers:
413 * - #TRANSPORT_ROAD = #BuildRoadStationWidgets
418 * Build depot; %Window numbers:
419 * - #TRANSPORT_WATER = #BuildDockDepotWidgets
420 * - #TRANSPORT_RAIL = #BuildRailDepotWidgets
421 * - #TRANSPORT_ROAD = #BuildRoadDepotWidgets
426 * Build waypoint; %Window numbers:
427 * - #TRANSPORT_RAIL = #BuildRailWaypointWidgets
432 * Found a town; %Window numbers:
433 * - 0 = #TownFoundingWidgets
438 * Build industry; %Window numbers:
439 * - 0 = #DynamicPlaceIndustriesWidgets
445 * Select game window; %Window numbers:
446 * - 0 = #SelectGameIntroWidgets
451 * Landscape generation (in Scenario Editor); %Window numbers:
452 * - 0 = #TerraformToolbarWidgets
453 * - 0 = #EditorTerraformToolbarWidgets
458 * Generate landscape (newgame); %Window numbers:
459 * - GLWM_SCENARIO = #CreateScenarioWidgets
460 * - #GenerateLandscapeWindowMode = #GenerateLandscapeWidgets
462 WC_GENERATE_LANDSCAPE
,
465 * Progress report of landscape generation; %Window numbers:
466 * - 0 = #GenerationProgressWidgets
467 * - 1 = #ScanProgressWidgets
473 * Network window; %Window numbers:
474 * - #WN_NETWORK_WINDOW_GAME = #NetworkGameWidgets
475 * - #WN_NETWORK_WINDOW_CONTENT_LIST = #NetworkContentListWidgets
476 * - #WN_NETWORK_WINDOW_START = #NetworkStartServerWidgets
481 * Client list; %Window numbers:
482 * - 0 = #ClientListWidgets
487 * Network status window; %Window numbers:
488 * - #WN_NETWORK_STATUS_WINDOW_JOIN = #NetworkJoinStatusWidgets
489 * - #WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD = #NetworkContentDownloadStatusWidgets
491 WC_NETWORK_STATUS_WINDOW
,
494 * Network ask relay window; %Window numbers:
495 * - 0 - #NetworkAskRelayWidgets
497 WC_NETWORK_ASK_RELAY
,
500 * Network ask survey window; %Window numbers:
501 * - 0 - #NetworkAskSurveyWidgets
503 WC_NETWORK_ASK_SURVEY
,
506 * Chatbox; %Window numbers:
507 * - #DestType = #NetWorkChatWidgets
512 * Industry cargoes chain; %Window numbers:
513 * - 0 = #IndustryCargoesWidgets
518 * Legend for graphs; %Window numbers:
519 * - 0 = #GraphLegendWidgets
524 * Finances of a company; %Window numbers:
525 * - #CompanyID = #CompanyWidgets
530 * Income graph; %Window numbers:
531 * - 0 = #CompanyValueWidgets
536 * Operating profit graph; %Window numbers:
537 * - 0 = #CompanyValueWidgets
542 * Delivered cargo graph; %Window numbers:
543 * - 0 = #CompanyValueWidgets
548 * Performance history graph; %Window numbers:
549 * - 0 = #PerformanceHistoryGraphWidgets
551 WC_PERFORMANCE_HISTORY
,
554 * Company value graph; %Window numbers:
555 * - 0 = #CompanyValueWidgets
560 * Company league window; %Window numbers:
561 * - 0 = #CompanyLeagueWidgets
566 * Payment rates graph; %Window numbers:
567 * - 0 = #CargoPaymentRatesWidgets
572 * Performance detail window; %Window numbers:
573 * - 0 = #PerformanceRatingDetailsWidgets
575 WC_PERFORMANCE_DETAIL
,
578 * Industry production history graph; %Window numbers:
579 * - #IndustryID = #IndustryProductionGraphWidgets
581 WC_INDUSTRY_PRODUCTION
,
584 * Company infrastructure overview; %Window numbers:
585 * - #CompanyID = #CompanyInfrastructureWidgets
587 WC_COMPANY_INFRASTRUCTURE
,
591 * Buyout company (merger); %Window numbers:
592 * - #CompanyID = #BuyCompanyWidgets
597 * Engine preview window; %Window numbers:
598 * - #EngineID = #EnginePreviewWidgets
604 * Music window; %Window numbers:
605 * - 0 = #MusicWidgets
610 * Music track selection; %Window numbers:
611 * - 0 = MusicTrackSelectionWidgets
613 WC_MUSIC_TRACK_SELECTION
,
616 * Game options window; %Window numbers:
617 * - #WN_GAME_OPTIONS_AI = #AIConfigWidgets
618 * - #WN_GAME_OPTIONS_GS = #GSConfigWidgets
619 * - #WN_GAME_OPTIONS_ABOUT = #AboutWidgets
620 * - #WN_GAME_OPTIONS_NEWGRF_STATE = #NewGRFStateWidgets
621 * - #WN_GAME_OPTIONS_GAME_OPTIONS = #GameOptionsWidgets
622 * - #WN_GAME_OPTIONS_GAME_SETTINGS = #GameSettingsWidgets
627 * Custom currency; %Window numbers:
628 * - 0 = #CustomCurrencyWidgets
633 * Cheat window; %Window numbers:
634 * - 0 = #CheatWidgets
639 * Extra viewport; %Window numbers:
640 * - Ascending value = #ExtraViewportWidgets
646 * Console; %Window numbers:
647 * - 0 = #ConsoleWidgets
652 * Bootstrap; %Window numbers:
653 * - 0 = #BootstrapBackgroundWidgets
658 * Highscore; %Window numbers:
659 * - 0 = #HighscoreWidgets
664 * Endscreen; %Window numbers:
665 * - 0 = #HighscoreWidgets
671 * Script debug window; %Window numbers:
672 * - Ascending value = #ScriptDebugWidgets
677 * NewGRF inspect (debug); %Window numbers:
678 * - Packed value = #NewGRFInspectWidgets
683 * Sprite aligner (debug); %Window numbers:
684 * - 0 = #SpriteAlignerWidgets
689 * Linkgraph legend; %Window numbers:
690 * - 0 = #LinkGraphWidgets
695 * Save preset; %Window numbers:
696 * - 0 = #SavePresetWidgets
701 * Framerate display; %Window numbers:
702 * - 0 = #FramerateDisplayWidgets
704 WC_FRAMERATE_DISPLAY
,
707 * Frame time graph; %Window numbers:
708 * - 0 = #FrametimeGraphWindowWidgets
713 * Screenshot window; %Window numbers:
714 * - 0 = #ScreenshotWidgets
719 * Help and manuals window; %Window numbers:
720 * - 0 = #HelpWindowWidgets
724 WC_INVALID
= 0xFFFF, ///< Invalid window.
727 /** Data value for #Window::OnInvalidateData() of windows with class #WC_GAME_OPTIONS. */
728 enum GameOptionsInvalidationData
{
730 GOID_NEWGRF_RESCANNED
, ///< NewGRFs were just rescanned.
731 GOID_NEWGRF_CURRENT_LOADED
, ///< The current list of active NewGRF has been loaded.
732 GOID_NEWGRF_LIST_EDITED
, ///< List of active NewGRFs is being edited.
733 GOID_NEWGRF_CHANGES_MADE
, ///< Changes have been made to a given NewGRF either through the palette or its parameters.
734 GOID_NEWGRF_CHANGES_APPLIED
, ///< The active NewGRF list changes have been applied.
739 /** Number to differentiate different windows of the same class */
740 typedef int32_t WindowNumber
;
742 /** State of handling an event. */
744 ES_HANDLED
, ///< The passed event is handled.
745 ES_NOT_HANDLED
, ///< The passed event is not handled.
748 #endif /* WINDOW_TYPE_H */