Fix #9521: Don't load at just removed docks that were part of a multi-dock station...
[openttd-github.git] / src / window_type.h
blob6eb9573b609ab4f9ebddebf1ee771d71f5865674
1 /*
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/>.
6 */
8 /** @file window_type.h Types related to windows */
10 #ifndef WINDOW_TYPE_H
11 #define WINDOW_TYPE_H
13 /** %Window numbers. */
14 enum WindowNumberEnum {
15 WN_GAME_OPTIONS_AI = 0, ///< AI settings.
16 WN_GAME_OPTIONS_ABOUT, ///< About window.
17 WN_GAME_OPTIONS_NEWGRF_STATE, ///< NewGRF settings.
18 WN_GAME_OPTIONS_GAME_OPTIONS, ///< Game options.
19 WN_GAME_OPTIONS_GAME_SETTINGS, ///< Game settings.
21 WN_QUERY_STRING = 0, ///< Query string.
22 WN_QUERY_STRING_SIGN, ///< Query string for signs.
24 WN_CONFIRM_POPUP_QUERY = 0, ///< Query popup confirm.
25 WN_CONFIRM_POPUP_QUERY_BOOTSTRAP, ///< Query popup confirm for bootstrap.
27 WN_NETWORK_WINDOW_GAME = 0, ///< Network game window.
28 WN_NETWORK_WINDOW_CONTENT_LIST, ///< Network content list.
29 WN_NETWORK_WINDOW_START, ///< Network start server.
31 WN_NETWORK_STATUS_WINDOW_JOIN = 0, ///< Network join status.
32 WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD, ///< Network content download status.
35 /** %Window classes. */
36 enum WindowClass {
37 WC_NONE, ///< No window, redirects to WC_MAIN_WINDOW.
39 /**
40 * Main window; %Window numbers:
41 * - 0 = #MainWidgets
43 WC_MAIN_WINDOW = WC_NONE,
45 /**
46 * Main toolbar (the long bar at the top); %Window numbers:
47 * - 0 = #ToolbarNormalWidgets
48 * - 0 = #ToolbarEditorWidgets
50 WC_MAIN_TOOLBAR,
52 /**
53 * Statusbar (at the bottom of your screen); %Window numbers:
54 * - 0 = #StatusbarWidgets
56 WC_STATUS_BAR,
58 /**
59 * Build toolbar; %Window numbers:
60 * - #TRANSPORT_RAIL = #RailToolbarWidgets
61 * - #TRANSPORT_AIR = #AirportToolbarWidgets
62 * - #TRANSPORT_WATER = #DockToolbarWidgets
63 * - #TRANSPORT_ROAD = #RoadToolbarWidgets
65 WC_BUILD_TOOLBAR,
67 /**
68 * Scenario build toolbar; %Window numbers:
69 * - #TRANSPORT_WATER = #DockToolbarWidgets
70 * - #TRANSPORT_ROAD = #RoadToolbarWidgets
72 WC_SCEN_BUILD_TOOLBAR,
74 /**
75 * Build trees toolbar; %Window numbers:
76 * - 0 = #BuildTreesWidgets
78 WC_BUILD_TREES,
80 /**
81 * Transparency toolbar; %Window numbers:
82 * - 0 = #TransparencyToolbarWidgets
84 WC_TRANSPARENCY_TOOLBAR,
86 /**
87 * Build signal toolbar; %Window numbers:
88 * - #TRANSPORT_RAIL = #BuildSignalWidgets
90 WC_BUILD_SIGNAL,
92 /**
93 * Small map; %Window numbers:
94 * - 0 = #SmallMapWidgets
96 WC_SMALLMAP,
98 /**
99 * Error message; %Window numbers:
100 * - 0 = #ErrorMessageWidgets
102 WC_ERRMSG,
105 * Tooltip window; %Window numbers:
106 * - 0 = #ToolTipsWidgets
108 WC_TOOLTIPS,
111 * Query string window; %Window numbers:
112 * - #WN_QUERY_STRING = #QueryStringWidgets
113 * - #WN_QUERY_STRING_SIGN = #QueryEditSignWidgets
115 WC_QUERY_STRING,
118 * Popup with confirm question; %Window numbers:
119 * - #WN_CONFIRM_POPUP_QUERY = #QueryWidgets
120 * - #WN_CONFIRM_POPUP_QUERY_BOOTSTRAP = #BootstrapAskForDownloadWidgets
122 WC_CONFIRM_POPUP_QUERY,
125 * Popup with a set of buttons, designed to ask the user a question
126 * from a GameScript. %Window numbers:
127 * - uniqueid = #GoalQuestionWidgets
129 WC_GOAL_QUESTION,
133 * Saveload window; %Window numbers:
134 * - 0 = #SaveLoadWidgets
136 WC_SAVELOAD,
139 * Land info window; %Window numbers:
140 * - 0 = #LandInfoWidgets
142 WC_LAND_INFO,
145 * Drop down menu; %Window numbers:
146 * - 0 = #DropdownMenuWidgets
148 WC_DROPDOWN_MENU,
151 * On Screen Keyboard; %Window numbers:
152 * - 0 = #OnScreenKeyboardWidgets
154 WC_OSK,
157 * Set date; %Window numbers:
158 * - #VehicleID = #SetDateWidgets
160 WC_SET_DATE,
164 * AI settings; %Window numbers:
165 * - 0 = #AISettingsWidgets
167 WC_AI_SETTINGS,
170 * NewGRF parameters; %Window numbers:
171 * - 0 = #NewGRFParametersWidgets
173 WC_GRF_PARAMETERS,
176 * textfile; %Window numbers:
177 * - 0 = #TextfileWidgets
179 WC_TEXTFILE,
183 * Town authority; %Window numbers:
184 * - #TownID = #TownAuthorityWidgets
186 WC_TOWN_AUTHORITY,
189 * Vehicle details; %Window numbers:
190 * - #VehicleID = #VehicleDetailsWidgets
192 WC_VEHICLE_DETAILS,
195 * Vehicle refit; %Window numbers:
196 * - #VehicleID = #VehicleRefitWidgets
198 WC_VEHICLE_REFIT,
201 * Vehicle orders; %Window numbers:
202 * - #VehicleID = #OrderWidgets
204 WC_VEHICLE_ORDERS,
207 * Replace vehicle window; %Window numbers:
208 * - #VehicleType = #ReplaceVehicleWidgets
210 WC_REPLACE_VEHICLE,
213 * Vehicle timetable; %Window numbers:
214 * - #VehicleID = #VehicleTimetableWidgets
216 WC_VEHICLE_TIMETABLE,
219 * Company colour selection; %Window numbers:
220 * - #CompanyID = #SelectCompanyLiveryWidgets
222 WC_COMPANY_COLOUR,
225 * Alter company face window; %Window numbers:
226 * - #CompanyID = #SelectCompanyManagerFaceWidgets
228 WC_COMPANY_MANAGER_FACE,
231 * Select station (when joining stations); %Window numbers:
232 * - 0 = #JoinStationWidgets
234 WC_SELECT_STATION,
237 * News window; %Window numbers:
238 * - 0 = #NewsWidgets
240 WC_NEWS_WINDOW,
243 * Town directory; %Window numbers:
244 * - 0 = #TownDirectoryWidgets
246 WC_TOWN_DIRECTORY,
249 * Subsidies list; %Window numbers:
250 * - 0 = #SubsidyListWidgets
252 WC_SUBSIDIES_LIST,
255 * Industry directory; %Window numbers:
256 * - 0 = #IndustryDirectoryWidgets
258 WC_INDUSTRY_DIRECTORY,
261 * News history list; %Window numbers:
262 * - 0 = #MessageHistoryWidgets
264 WC_MESSAGE_HISTORY,
267 * Sign list; %Window numbers:
268 * - 0 = #SignListWidgets
270 WC_SIGN_LIST,
273 * AI list; %Window numbers:
274 * - 0 = #AIListWidgets
276 WC_AI_LIST,
279 * Goals list; %Window numbers:
280 * - 0 ; #GoalListWidgets
282 WC_GOALS_LIST,
285 * Story book; %Window numbers:
286 * - CompanyID = #StoryBookWidgets
288 WC_STORY_BOOK,
291 * Station list; %Window numbers:
292 * - #CompanyID = #StationListWidgets
294 WC_STATION_LIST,
297 * Trains list; %Window numbers:
298 * - Packed value = #GroupListWidgets / #VehicleListWidgets
300 WC_TRAINS_LIST,
303 * Road vehicle list; %Window numbers:
304 * - Packed value = #GroupListWidgets / #VehicleListWidgets
306 WC_ROADVEH_LIST,
309 * Ships list; %Window numbers:
310 * - Packed value = #GroupListWidgets / #VehicleListWidgets
312 WC_SHIPS_LIST,
315 * Aircraft list; %Window numbers:
316 * - Packed value = #GroupListWidgets / #VehicleListWidgets
318 WC_AIRCRAFT_LIST,
322 * Town view; %Window numbers:
323 * - #TownID = #TownViewWidgets
325 WC_TOWN_VIEW,
328 * Vehicle view; %Window numbers:
329 * - #VehicleID = #VehicleViewWidgets
331 WC_VEHICLE_VIEW,
334 * Station view; %Window numbers:
335 * - #StationID = #StationViewWidgets
337 WC_STATION_VIEW,
340 * Depot view; %Window numbers:
341 * - #TileIndex = #DepotWidgets
343 WC_VEHICLE_DEPOT,
346 * Waypoint view; %Window numbers:
347 * - #WaypointID = #WaypointWidgets
349 WC_WAYPOINT_VIEW,
352 * Industry view; %Window numbers:
353 * - #IndustryID = #IndustryViewWidgets
355 WC_INDUSTRY_VIEW,
358 * Company view; %Window numbers:
359 * - #CompanyID = #CompanyWidgets
361 WC_COMPANY,
365 * Build object; %Window numbers:
366 * - 0 = #BuildObjectWidgets
368 WC_BUILD_OBJECT,
371 * Build vehicle; %Window numbers:
372 * - #VehicleType = #BuildVehicleWidgets
373 * - #TileIndex = #BuildVehicleWidgets
375 WC_BUILD_VEHICLE,
378 * Build bridge; %Window numbers:
379 * - #TransportType = #BuildBridgeSelectionWidgets
381 WC_BUILD_BRIDGE,
384 * Build station; %Window numbers:
385 * - #TRANSPORT_AIR = #AirportPickerWidgets
386 * - #TRANSPORT_WATER = #DockToolbarWidgets
387 * - #TRANSPORT_RAIL = #BuildRailStationWidgets
389 WC_BUILD_STATION,
392 * Build bus station; %Window numbers:
393 * - #TRANSPORT_ROAD = #BuildRoadStationWidgets
395 WC_BUS_STATION,
398 * Build truck station; %Window numbers:
399 * - #TRANSPORT_ROAD = #BuildRoadStationWidgets
401 WC_TRUCK_STATION,
404 * Build depot; %Window numbers:
405 * - #TRANSPORT_WATER = #BuildDockDepotWidgets
406 * - #TRANSPORT_RAIL = #BuildRailDepotWidgets
407 * - #TRANSPORT_ROAD = #BuildRoadDepotWidgets
409 WC_BUILD_DEPOT,
412 * Build waypoint; %Window numbers:
413 * - #TRANSPORT_RAIL = #BuildRailWaypointWidgets
415 WC_BUILD_WAYPOINT,
418 * Found a town; %Window numbers:
419 * - 0 = #TownFoundingWidgets
421 WC_FOUND_TOWN,
424 * Build industry; %Window numbers:
425 * - 0 = #DynamicPlaceIndustriesWidgets
427 WC_BUILD_INDUSTRY,
431 * Select game window; %Window numbers:
432 * - 0 = #SelectGameIntroWidgets
434 WC_SELECT_GAME,
437 * Landscape generation (in Scenario Editor); %Window numbers:
438 * - 0 = #TerraformToolbarWidgets
439 * - 0 = #EditorTerraformToolbarWidgets
441 WC_SCEN_LAND_GEN,
444 * Generate landscape (newgame); %Window numbers:
445 * - GLWM_SCENARIO = #CreateScenarioWidgets
446 * - #GenerateLandscapeWindowMode = #GenerateLandscapeWidgets
448 WC_GENERATE_LANDSCAPE,
451 * Progress report of landscape generation; %Window numbers:
452 * - 0 = #GenerationProgressWidgets
453 * - 1 = #ScanProgressWidgets
455 WC_MODAL_PROGRESS,
459 * Network window; %Window numbers:
460 * - #WN_NETWORK_WINDOW_GAME = #NetworkGameWidgets
461 * - #WN_NETWORK_WINDOW_CONTENT_LIST = #NetworkContentListWidgets
462 * - #WN_NETWORK_WINDOW_START = #NetworkStartServerWidgets
464 WC_NETWORK_WINDOW,
467 * Client list; %Window numbers:
468 * - 0 = #ClientListWidgets
470 WC_CLIENT_LIST,
473 * Network status window; %Window numbers:
474 * - #WN_NETWORK_STATUS_WINDOW_JOIN = #NetworkJoinStatusWidgets
475 * - #WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD = #NetworkContentDownloadStatusWidgets
477 WC_NETWORK_STATUS_WINDOW,
480 * Network ask relay window; %Window numbers:
481 * - 0 - #NetworkAskRelayWidgets
483 WC_NETWORK_ASK_RELAY,
486 * Chatbox; %Window numbers:
487 * - #DestType = #NetWorkChatWidgets
489 WC_SEND_NETWORK_MSG,
492 * Company password query; %Window numbers:
493 * - 0 = #NetworkCompanyPasswordWidgets
495 WC_COMPANY_PASSWORD_WINDOW,
499 * Industry cargoes chain; %Window numbers:
500 * - 0 = #IndustryCargoesWidgets
502 WC_INDUSTRY_CARGOES,
505 * Legend for graphs; %Window numbers:
506 * - 0 = #GraphLegendWidgets
508 WC_GRAPH_LEGEND,
511 * Finances of a company; %Window numbers:
512 * - #CompanyID = #CompanyWidgets
514 WC_FINANCES,
517 * Income graph; %Window numbers:
518 * - 0 = #CompanyValueWidgets
520 WC_INCOME_GRAPH,
523 * Operating profit graph; %Window numbers:
524 * - 0 = #CompanyValueWidgets
526 WC_OPERATING_PROFIT,
529 * Delivered cargo graph; %Window numbers:
530 * - 0 = #CompanyValueWidgets
532 WC_DELIVERED_CARGO,
535 * Performance history graph; %Window numbers:
536 * - 0 = #PerformanceHistoryGraphWidgets
538 WC_PERFORMANCE_HISTORY,
541 * Company value graph; %Window numbers:
542 * - 0 = #CompanyValueWidgets
544 WC_COMPANY_VALUE,
547 * Company league window; %Window numbers:
548 * - 0 = #CompanyLeagueWidgets
550 WC_COMPANY_LEAGUE,
553 * Payment rates graph; %Window numbers:
554 * - 0 = #CargoPaymentRatesWidgets
556 WC_PAYMENT_RATES,
559 * Performance detail window; %Window numbers:
560 * - 0 = #PerformanceRatingDetailsWidgets
562 WC_PERFORMANCE_DETAIL,
565 * Company infrastructure overview; %Window numbers:
566 * - #CompanyID = #CompanyInfrastructureWidgets
568 WC_COMPANY_INFRASTRUCTURE,
572 * Buyout company (merger); %Window numbers:
573 * - #CompanyID = #BuyCompanyWidgets
575 WC_BUY_COMPANY,
578 * Engine preview window; %Window numbers:
579 * - #EngineID = #EnginePreviewWidgets
581 WC_ENGINE_PREVIEW,
585 * Music window; %Window numbers:
586 * - 0 = #MusicWidgets
588 WC_MUSIC_WINDOW,
591 * Music track selection; %Window numbers:
592 * - 0 = MusicTrackSelectionWidgets
594 WC_MUSIC_TRACK_SELECTION,
597 * Game options window; %Window numbers:
598 * - #WN_GAME_OPTIONS_AI = #AIConfigWidgets
599 * - #WN_GAME_OPTIONS_ABOUT = #AboutWidgets
600 * - #WN_GAME_OPTIONS_NEWGRF_STATE = #NewGRFStateWidgets
601 * - #WN_GAME_OPTIONS_GAME_OPTIONS = #GameOptionsWidgets
602 * - #WN_GAME_OPTIONS_GAME_SETTINGS = #GameSettingsWidgets
604 WC_GAME_OPTIONS,
607 * Custom currency; %Window numbers:
608 * - 0 = #CustomCurrencyWidgets
610 WC_CUSTOM_CURRENCY,
613 * Cheat window; %Window numbers:
614 * - 0 = #CheatWidgets
616 WC_CHEATS,
619 * Extra viewport; %Window numbers:
620 * - Ascending value = #ExtraViewportWidgets
622 WC_EXTRA_VIEWPORT,
626 * Console; %Window numbers:
627 * - 0 = #ConsoleWidgets
629 WC_CONSOLE,
632 * Bootstrap; %Window numbers:
633 * - 0 = #BootstrapBackgroundWidgets
635 WC_BOOTSTRAP,
638 * Highscore; %Window numbers:
639 * - 0 = #HighscoreWidgets
641 WC_HIGHSCORE,
644 * Endscreen; %Window numbers:
645 * - 0 = #HighscoreWidgets
647 WC_ENDSCREEN,
651 * AI debug window; %Window numbers:
652 * - 0 = #AIDebugWidgets
654 WC_AI_DEBUG,
657 * NewGRF inspect (debug); %Window numbers:
658 * - Packed value = #NewGRFInspectWidgets
660 WC_NEWGRF_INSPECT,
663 * Sprite aligner (debug); %Window numbers:
664 * - 0 = #SpriteAlignerWidgets
666 WC_SPRITE_ALIGNER,
669 * Linkgraph legend; %Window numbers:
670 * - 0 = #LinkGraphWidgets
672 WC_LINKGRAPH_LEGEND,
675 * Save preset; %Window numbers:
676 * - 0 = #SavePresetWidgets
678 WC_SAVE_PRESET,
681 * Framerate display; %Window numbers:
682 * - 0 = #FramerateDisplayWidgets
684 WC_FRAMERATE_DISPLAY,
687 * Frame time graph; %Window numbers:
688 * - 0 = #FrametimeGraphWindowWidgets
690 WC_FRAMETIME_GRAPH,
693 * Screenshot window; %Window numbers:
694 * - 0 = #ScreenshotWidgets
696 WC_SCREENSHOT,
698 WC_INVALID = 0xFFFF, ///< Invalid window.
701 /** Data value for #Window::OnInvalidateData() of windows with class #WC_GAME_OPTIONS. */
702 enum GameOptionsInvalidationData {
703 GOID_DEFAULT = 0,
704 GOID_NEWGRF_RESCANNED, ///< NewGRFs were just rescanned.
705 GOID_NEWGRF_CURRENT_LOADED, ///< The current list of active NewGRF has been loaded.
706 GOID_NEWGRF_LIST_EDITED, ///< List of active NewGRFs is being edited.
707 GOID_NEWGRF_CHANGES_MADE, ///< Changes have been made to a given NewGRF either through the palette or its parameters.
708 GOID_NEWGRF_CHANGES_APPLIED, ///< The active NewGRF list changes have been applied.
711 struct Window;
713 /** Number to differentiate different windows of the same class */
714 typedef int32 WindowNumber;
716 /** State of handling an event. */
717 enum EventState {
718 ES_HANDLED, ///< The passed event is handled.
719 ES_NOT_HANDLED, ///< The passed event is not handled.
722 #endif /* WINDOW_TYPE_H */