|
OpenTTD Source 20260621-master-g720d10536d
|
Code related to the (main) toolbar. More...
#include "stdafx.h"#include "core/geometry_func.hpp"#include "gui.h"#include "spritecache.h"#include "window_gui.h"#include "window_func.h"#include "viewport_func.h"#include "command_func.h"#include "dropdown_type.h"#include "dropdown_func.h"#include "house.h"#include "vehicle_gui.h"#include "rail_gui.h"#include "road.h"#include "road_gui.h"#include "vehicle_func.h"#include "sound_func.h"#include "terraform_gui.h"#include "object.h"#include "newgrf_object.h"#include "strings_func.h"#include "company_func.h"#include "company_gui.h"#include "vehicle_base.h"#include "cheat_func.h"#include "transparency_gui.h"#include "screenshot.h"#include "signs_func.h"#include "fios.h"#include "console_gui.h"#include "news_gui.h"#include "ai/ai_gui.hpp"#include "game/game_gui.hpp"#include "script/script_gui.h"#include "tilehighlight_func.h"#include "smallmap_gui.h"#include "graph_gui.h"#include "textbuf_gui.h"#include "linkgraph/linkgraph_gui.h"#include "newgrf_debug.h"#include "hotkeys.h"#include "engine_base.h"#include "highscore.h"#include "game/game.hpp"#include "goal_base.h"#include "goal_gui.h"#include "story_base.h"#include "toolbar_gui.h"#include "framerate_type.h"#include "screenshot_gui.h"#include "misc_cmd.h"#include "league_gui.h"#include "league_base.h"#include "timer/timer.h"#include "timer/timer_window.h"#include "timer/timer_game_calendar.h"#include "help_gui.h"#include "core/string_consumer.hpp"#include "widgets/toolbar_widget.h"#include "network/network.h"#include "network/network_gui.h"#include "network/network_func.h"#include "table/strings.h"#include "dropdown_common_type.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| class | DropDownListCompanyItem |
| Company name list item, with company-colour icon, name, and lock components. More... | |
| class | NWidgetToolbarContainer |
| Full blown container to make it behave exactly as we want :). More... | |
| class | NWidgetMainToolbarContainer |
| Container for the 'normal' main toolbar. More... | |
| class | NWidgetScenarioToolbarContainer |
| Container for the scenario editor's toolbar. More... | |
| struct | MainToolbarWindow |
| Main toolbar. More... | |
| struct | ScenarioEditorToolbarWindow |
Typedefs | |
| typedef CallBackFunction | MenuClickedProc(int index) |
| using | ToolbarButtonProc = CallBackFunction(Window *w) |
| Callback for when a button is clicked in the given window. | |
Functions | |
| static DropDownOptions | GetToolbarDropDownOptions (DropDownOptions options={}) |
| Get options for toolbar dropdown menus,. | |
| static void | PopupMainToolbarMenu (Window *w, WidgetID widget, DropDownList &&list, int def) |
| Pop up a generic text only menu. | |
| static void | PopupMainToolbarMenu (Window *w, WidgetID widget, const std::initializer_list< StringID > &strings) |
| Pop up a generic text only menu. | |
| static void | PopupMainCompanyToolbMenu (Window *w, WidgetID widget, CompanyMask grey={}) |
| Pop up a generic company list menu. | |
| static CallBackFunction | SelectSignTool () |
| static CallBackFunction | ToolbarPauseClick (Window *) |
| static CallBackFunction | ToolbarFastForwardClick (Window *) |
| Toggle fast forward mode. | |
| static CallBackFunction | ToolbarOptionsClick (Window *w) |
| Handle click on Options button in toolbar. | |
| static CallBackFunction | MenuClickSettings (int index) |
| Handle click on one of the entries in the Options button menu. | |
| static CallBackFunction | ToolbarSaveClick (Window *w) |
| Handle click on Save button in toolbar in normal game mode. | |
| static CallBackFunction | ToolbarScenSaveOrLoad (Window *w) |
| Handle click on SaveLoad button in toolbar in the scenario editor. | |
| static CallBackFunction | MenuClickSaveLoad (int index=0) |
| Handle click on one of the entries in the SaveLoad menu. | |
| static CallBackFunction | ToolbarMapClick (Window *w) |
| static CallBackFunction | ToolbarScenMapTownDir (Window *w) |
| static CallBackFunction | MenuClickMap (int index) |
| Handle click on one of the entries in the Map menu. | |
| static CallBackFunction | ToolbarTownClick (Window *w) |
| static CallBackFunction | MenuClickTown (int index) |
| Handle click on one of the entries in the Town menu. | |
| static CallBackFunction | ToolbarSubsidiesClick (Window *w) |
| static CallBackFunction | MenuClickSubsidies (int) |
| Handle click on the entry in the Subsidies menu. | |
| static CallBackFunction | ToolbarStationsClick (Window *w) |
| static CallBackFunction | MenuClickStations (int index) |
| Handle click on the entry in the Stations menu. | |
| static CallBackFunction | ToolbarFinancesClick (Window *w) |
| static CallBackFunction | MenuClickFinances (int index) |
| Handle click on the entry in the finances overview menu. | |
| static CallBackFunction | ToolbarCompaniesClick (Window *w) |
| static CallBackFunction | MenuClickCompany (int index) |
| Handle click on the entry in the Company menu. | |
| static CallBackFunction | ToolbarStoryClick (Window *w) |
| static CallBackFunction | MenuClickStory (int index) |
| Handle click on the entry in the Story menu. | |
| static CallBackFunction | ToolbarGoalClick (Window *w) |
| static CallBackFunction | MenuClickGoal (int index) |
| Handle click on the entry in the Goal menu. | |
| static void | AddDropDownLeagueTableOptions (DropDownList &list) |
| static CallBackFunction | ToolbarGraphsClick (Window *w) |
| static CallBackFunction | ToolbarLeagueClick (Window *w) |
| static CallBackFunction | MenuClickGraphsOrLeague (int index) |
| Handle click on the entry in the Graphs or CompanyLeague. | |
| static CallBackFunction | ToolbarIndustryClick (Window *w) |
| static CallBackFunction | MenuClickIndustry (int index) |
| Handle click on the entry in the Industry menu. | |
| static void | ToolbarVehicleClick (Window *w, VehicleType veh) |
| static CallBackFunction | ToolbarTrainClick (Window *w) |
| static CallBackFunction | MenuClickShowTrains (int index) |
| Handle click on the entry in the Train menu. | |
| static CallBackFunction | ToolbarRoadClick (Window *w) |
| static CallBackFunction | MenuClickShowRoad (int index) |
| Handle click on the entry in the Road Vehicles menu. | |
| static CallBackFunction | ToolbarShipClick (Window *w) |
| static CallBackFunction | MenuClickShowShips (int index) |
| Handle click on the entry in the Ships menu. | |
| static CallBackFunction | ToolbarAirClick (Window *w) |
| static CallBackFunction | MenuClickShowAir (int index) |
| Handle click on the entry in the Aircraft menu. | |
| static CallBackFunction | ToolbarZoomInClick (Window *w) |
| static CallBackFunction | ToolbarZoomOutClick (Window *w) |
| static CallBackFunction | ToolbarBuildRailClick (Window *w) |
| static CallBackFunction | MenuClickBuildRail (int index) |
| Handle click on the entry in the Build Rail menu. | |
| static CallBackFunction | ToolbarBuildRoadClick (Window *w) |
| static CallBackFunction | MenuClickBuildRoad (int index) |
| Handle click on the entry in the Build Road menu. | |
| static CallBackFunction | ToolbarBuildTramClick (Window *w) |
| static CallBackFunction | MenuClickBuildTram (int index) |
| Handle click on the entry in the Build Tram menu. | |
| static CallBackFunction | ToolbarBuildWaterClick (Window *w) |
| static CallBackFunction | MenuClickBuildWater (int) |
| Handle click on the entry in the Build Waterways menu. | |
| static CallBackFunction | ToolbarBuildAirClick (Window *w) |
| static CallBackFunction | MenuClickBuildAir (int) |
| Handle click on the entry in the Build Air menu. | |
| static CallBackFunction | ToolbarForestClick (Window *w) |
| static CallBackFunction | MenuClickForest (int index) |
| Handle click on the entry in the landscaping menu. | |
| static CallBackFunction | ToolbarMusicClick (Window *w) |
| static CallBackFunction | MenuClickMusicWindow (int) |
| Handle click on the entry in the Music menu. | |
| static CallBackFunction | ToolbarNewspaperClick (Window *w) |
| static CallBackFunction | MenuClickNewspaper (int index) |
| Handle click on the entry in the Newspaper menu. | |
| static CallBackFunction | PlaceLandBlockInfo () |
| static CallBackFunction | ToolbarHelpClick (Window *w) |
| void | ToggleBoundingBoxes () |
| Toggle drawing of sprites' bounding boxes. | |
| void | ToggleDirtyBlocks () |
| Toggle drawing of the dirty blocks. | |
| void | ToggleWidgetOutlines () |
| Toggle drawing of widget outlines. | |
| void | SetStartingYear (TimerGameCalendar::Year year) |
| Set the starting year for a scenario. | |
| static CallBackFunction | MenuClickHelp (int index) |
| Choose the proper callback function for the main toolbar's help menu. | |
| static CallBackFunction | ToolbarSwitchClick (Window *w) |
| static CallBackFunction | ToolbarScenDatePanel (Window *w) |
| Called when clicking at the date panel of the scenario editor toolbar. | |
| static CallBackFunction | ToolbarScenDateBackward (Window *w) |
| static CallBackFunction | ToolbarScenDateForward (Window *w) |
| static CallBackFunction | ToolbarScenGenLand (Window *w) |
| static CallBackFunction | ToolbarScenGenTownClick (Window *w) |
| static CallBackFunction | ToolbarScenGenTown (int index) |
| static CallBackFunction | ToolbarScenGenIndustry (Window *w) |
| static CallBackFunction | ToolbarScenBuildRoadClick (Window *w) |
| static CallBackFunction | ToolbarScenBuildRoad (int index) |
| Handle click on the entry in the Build Road menu. | |
| static CallBackFunction | ToolbarScenBuildTramClick (Window *w) |
| static CallBackFunction | ToolbarScenBuildTram (int index) |
| Handle click on the entry in the Build Tram menu. | |
| static CallBackFunction | ToolbarScenBuildDocks (Window *w) |
| static CallBackFunction | ToolbarScenPlantTrees (Window *w) |
| static CallBackFunction | ToolbarScenPlaceSign (Window *w) |
| static CallBackFunction | ToolbarBtn_NULL (Window *) |
| Dimension | GetToolbarMaximalImageSize () |
| Get maximal square size of a toolbar image. | |
| static std::unique_ptr< NWidgetBase > | MakeMainToolbar () |
| Make widgets for the main toolbar. | |
| static std::unique_ptr< NWidgetBase > | MakeScenarioToolbar () |
| void | AllocateToolbar () |
| Allocate the toolbar. | |
Variables | |
| uint | _toolbar_width = 0 |
| Width of the toolbar, shared by statusbar. | |
| RailType | _last_built_railtype |
| The most recently used type of rail. | |
| RoadType | _last_built_roadtype |
| The most recently used type of road. | |
| RoadType | _last_built_tramtype |
| The most recently used type of tram track. | |
| static CallBackFunction | _last_started_action = CallBackFunction::None |
| Last started user action. | |
| static const int | CTMN_CLIENT_LIST = MAX_COMPANIES |
| Indicates the "all connected players" entry. | |
| static const int | CTMN_SPECTATE = COMPANY_SPECTATOR.base() |
| Indicates the "become spectator" entry. | |
| static const int | CTMN_SPECTATOR = CompanyID::Invalid().base() |
| Indicates that a window is being opened for the spectator. | |
| static ToolbarMode | _toolbar_mode |
| static const int | GRMN_OPERATING_PROFIT_GRAPH = -1 |
| Enum for the League Toolbar's and Graph Toolbar's related buttons. | |
| static const int | GRMN_INCOME_GRAPH = -2 |
| Show income graph. | |
| static const int | GRMN_DELIVERED_CARGO_GRAPH = -3 |
| Show delivered cargo graph. | |
| static const int | GRMN_PERFORMANCE_HISTORY_GRAPH = -4 |
| Show performance history graph. | |
| static const int | GRMN_COMPANY_VALUE_GRAPH = -5 |
| Show company value graph. | |
| static const int | GRMN_CARGO_PAYMENT_RATES = -6 |
| Show cargo payment rates graph. | |
| static const int | LTMN_PERFORMANCE_LEAGUE = -7 |
| Show default league table. | |
| static const int | LTMN_PERFORMANCE_RATING = -8 |
| Show detailed performance rating. | |
| static const int | LTMN_HIGHSCORE = -9 |
| Show highscrore table. | |
| static std::string | _railtype_filter |
| Persistent filter text for railtype dropdown menu. | |
| static std::string | _roadtype_filter |
| Persistent filter text for roadtype dropdown menu. | |
| static std::string | _tramtype_filter |
| Persistent filter text for tramtype dropdown menu. | |
| static MenuClickedProc *const | _menu_clicked_procs [] |
| static ToolbarButtonProc *const | _toolbar_button_procs [] |
| static constexpr std::tuple< WidgetID, WidgetType, SpriteID > | _toolbar_button_sprites [] |
| Sprites to use for the different toolbar buttons. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_toolbar_normal_widgets |
| static WindowDesc | _toolb_normal_desc (WindowPosition::Manual, {}, 0, 0, WindowClass::MainToolbar, WindowClass::None, {WindowDefaultFlag::NoFocus, WindowDefaultFlag::NoClose}, _nested_toolbar_normal_widgets, &MainToolbarWindow::hotkeys) |
| Window definition for the normal (top) toolbar. | |
| static MenuClickedProc *const | _scen_toolbar_dropdown_procs [] |
| static ToolbarButtonProc *const | _scen_toolbar_button_procs [] |
| static constexpr std::initializer_list< NWidgetPart > | _nested_toolb_scen_inner_widgets |
| static constexpr std::initializer_list< NWidgetPart > | _nested_toolb_scen_widgets |
| static WindowDesc | _toolb_scen_desc (WindowPosition::Manual, {}, 0, 0, WindowClass::MainToolbar, WindowClass::None, {WindowDefaultFlag::NoFocus, WindowDefaultFlag::NoClose}, _nested_toolb_scen_widgets, &ScenarioEditorToolbarWindow::hotkeys) |
| Window definition for the scenario editor (top) toolbar window. | |
Code related to the (main) toolbar.
Definition in file toolbar_gui.cpp.
| typedef CallBackFunction MenuClickedProc(int index) |
Definition at line 1339 of file toolbar_gui.cpp.
| using ToolbarButtonProc = CallBackFunction(Window *w) |
Callback for when a button is clicked in the given window.
| w | The clicked window. |
Definition at line 1968 of file toolbar_gui.cpp.
|
strong |
Callback functions.
Definition at line 97 of file toolbar_gui.cpp.
|
strong |
List of hotkeys available in scenario editor.
Definition at line 2335 of file toolbar_gui.cpp.
|
strong |
Map button menu entries.
Definition at line 432 of file toolbar_gui.cpp.
|
strong |
Game Option button menu entries.
| Enumerator | |
|---|---|
| GameOptions | Open game options window. |
| AISettings | Open AI settings window. |
| GameScriptSettings | Open GS settings window. |
| NewGRFSettings | Open NewGRF settings window. |
| SandboxOptions | Open sandbox options window. |
| Transparencies | Open transparency options window. |
| ShowTownNames | Toggle visibility of town names. |
| ShowStationNames | Toggle visibility of station names. |
| ShowTrainStationNames | Toggle visibility of train station names. |
| ShowLorryStationNames | Toggle visibility of lorry station names. |
| ShowBusStationNames | Toggle visibility of bus station names. |
| ShowDockNames | Toggle visibility of dock names. |
| ShowAirportNames | Toggle visibility of airport names. |
| ShowGhostStationNames | Toggle visibility of ghost station names. |
| ShowWaypointNames | Toggle visibility of waypoint names. |
| ShowSigns | Toggle visibility of signs. |
| ShowCompetitorSigns | Toggle visibility of competitor signs and names. |
| FullAnimation | Toggle full animations. |
| FullDetails | Toggle full details. |
| TransparentBuildings | Toggle buildings transparency. |
| TransparentStationSigns | Toggle transparency of signs and names. |
Definition at line 246 of file toolbar_gui.cpp.
|
strong |
SaveLoad entries in scenario editor mode.
| Enumerator | |
|---|---|
| SaveScenario | Save the scenario. |
| LoadScenario | Load a scenario. |
| SaveHeightmap | Save the heightmap. |
| LoadHeightmap | Load a heightmap. |
| ExitToMainMenu | Exit to main menu. |
| ExitGame | Exit to desktop. |
Definition at line 355 of file toolbar_gui.cpp.
|
strong |
SaveLoad entries in normal game mode.
| Enumerator | |
|---|---|
| SaveGame | Save the game. |
| LoadGame | Load a save. |
| ExitToMainMenu | Exit to main menu. |
| ExitGame | Exit to desktop. |
Definition at line 367 of file toolbar_gui.cpp.
|
strong |
Toolbar modes.
Definition at line 90 of file toolbar_gui.cpp.
|
strong |
Town button menu entries.
| Enumerator | |
|---|---|
| ShowDirectory | Open window with list of towns. |
| ShowFoundTown | Open town generation window. |
| ShowPlaceHouses | Open house selection window. |
Definition at line 486 of file toolbar_gui.cpp.
|
static |
Definition at line 675 of file toolbar_gui.cpp.
| void AllocateToolbar | ( | ) |
Allocate the toolbar.
Definition at line 2620 of file toolbar_gui.cpp.
References _toolb_normal_desc, _toolb_scen_desc, and Editor.
Referenced by ShowVitalWindows().
|
static |
Get options for toolbar dropdown menus,.
| options | Additional options to include. |
Definition at line 120 of file toolbar_gui.cpp.
Referenced by PopupMainToolbarMenu(), and ToolbarOptionsClick().
| Dimension GetToolbarMaximalImageSize | ( | ) |
Get maximal square size of a toolbar image.
Definition at line 2226 of file toolbar_gui.cpp.
References _toolbar_button_sprites, GetSquareScaledSpriteSize(), and maxdim().
Referenced by SetupWidgetDimensions().
|
static |
Make widgets for the main toolbar.
Definition at line 2240 of file toolbar_gui.cpp.
References _toolbar_button_sprites, Grey, WID_TN_BUILDING_TOOLS_START, WID_TN_FINANCES, WID_TN_MUSIC_SOUND, WID_TN_SMALL_MAP, WID_TN_VEHICLE_START, and WID_TN_ZOOM_IN.
|
static |
Definition at line 2601 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Build Air menu.
Definition at line 990 of file toolbar_gui.cpp.
References None, and ShowBuildAirToolbar().
|
static |
Handle click on the entry in the Build Rail menu.
| index | RailType to show the build toolbar for. |
Definition at line 905 of file toolbar_gui.cpp.
References _last_built_railtype, None, and ShowBuildRailToolbar().
|
static |
Handle click on the entry in the Build Road menu.
| index | RoadType to show the build toolbar for. |
Definition at line 926 of file toolbar_gui.cpp.
References _last_built_roadtype, None, and ShowBuildRoadToolbar().
|
static |
Handle click on the entry in the Build Tram menu.
| index | RoadType to show the build toolbar for. |
Definition at line 947 of file toolbar_gui.cpp.
References _last_built_tramtype, None, and ShowBuildRoadToolbar().
|
static |
Handle click on the entry in the Build Waterways menu.
Definition at line 969 of file toolbar_gui.cpp.
References None, and ShowBuildDocksToolbar().
|
static |
Handle click on the entry in the Company menu.
| index | Menu entry to handle. |
Definition at line 597 of file toolbar_gui.cpp.
References _network_server, _networking, CLIENT_ID_SERVER, COMPANY_SPECTATOR, CTMN_CLIENT_LIST, CTMN_SPECTATE, MarkWholeScreenDirty(), NetworkClientRequestMove(), NetworkServerDoMove(), None, ShowClientList(), and ShowCompany().
|
static |
Handle click on the entry in the finances overview menu.
| index | CompanyID to show finances for. |
Definition at line 577 of file toolbar_gui.cpp.
References None, and ShowCompanyFinances().
|
static |
Handle click on the entry in the landscaping menu.
| index | Menu entry clicked. |
Definition at line 1017 of file toolbar_gui.cpp.
References None, ShowBuildObjectPicker(), and ShowTerraformToolbar().
|
static |
Handle click on the entry in the Goal menu.
| index | CompanyID to show story book for |
Definition at line 653 of file toolbar_gui.cpp.
References None, and ShowGoalsList().
|
static |
Handle click on the entry in the Graphs or CompanyLeague.
| index | Graph to show. |
Definition at line 724 of file toolbar_gui.cpp.
References GRMN_CARGO_PAYMENT_RATES, GRMN_COMPANY_VALUE_GRAPH, GRMN_DELIVERED_CARGO_GRAPH, GRMN_INCOME_GRAPH, GRMN_OPERATING_PROFIT_GRAPH, GRMN_PERFORMANCE_HISTORY_GRAPH, LTMN_HIGHSCORE, LTMN_PERFORMANCE_LEAGUE, LTMN_PERFORMANCE_RATING, None, and ShowHighscoreTable().
|
static |
Choose the proper callback function for the main toolbar's help menu.
| index | The menu index which was selected. |
Definition at line 1174 of file toolbar_gui.cpp.
References _ctrl_pressed, IConsoleSwitch(), None, ShowFramerateWindow(), ShowScriptDebugWindow(), ShowSpriteAlignerWindow(), ToggleBoundingBoxes(), ToggleDirtyBlocks(), and ToggleWidgetOutlines().
|
static |
Handle click on the entry in the Industry menu.
| index | Menu entry number. |
Definition at line 766 of file toolbar_gui.cpp.
References None, ShowIndustryCargoesWindow(), and ShowIndustryDirectory.
|
static |
Handle click on one of the entries in the Map menu.
| index | Index being clicked. |
Definition at line 470 of file toolbar_gui.cpp.
References None, ShowExtraViewport, ShowExtraViewportWindow(), ShowIndustryDirectory, ShowLinkGraph, ShowLinkGraphLegend(), ShowSignList, ShowSignList(), ShowSmallMap, ShowSmallMap(), and ShowTownDirectory.
|
static |
Handle click on the entry in the Music menu.
Definition at line 1041 of file toolbar_gui.cpp.
References None.
|
static |
Handle click on the entry in the Newspaper menu.
| index | Menu entry clicked. |
Definition at line 1061 of file toolbar_gui.cpp.
References DeleteAllMessages(), None, ShowLastNewsMessage(), and ShowMessageHistory().
|
static |
Handle click on one of the entries in the SaveLoad menu.
| index | Index being clicked. |
Definition at line 407 of file toolbar_gui.cpp.
References Editor, ExitGame, ExitToMainMenu, Heightmap, Load, LoadGame, LoadHeightmap, LoadScenario, None, Save, SaveGame, Savegame, SaveHeightmap, SaveScenario, Scenario, and ShowSaveLoadDialog().
Referenced by MainToolbarWindow::OnHotkey(), and ScenarioEditorToolbarWindow::OnHotkey().
|
static |
Handle click on one of the entries in the Options button menu.
| index | Index being clicked. |
Definition at line 319 of file toolbar_gui.cpp.
References _display_opt, _facility_display_opt, _grfconfig, _networking, _settings_client, Airport, AISettings, BusStop, CheckBlitter(), Dock, FullAnimation, FullDetail, FullDetails, GameOptions, GameScriptSettings, Houses, InvalidateWindowClassesData(), MarkWholeScreenDirty(), NewGRFSettings, None, SandboxOptions, ShowAIConfigWindow(), ShowAirportNames, ShowBusStationNames, ShowCheatWindow(), ShowCompetitorSigns, ShowDockNames, ShowGameOptions(), ShowGhostStationNames, ShowGSConfigWindow(), ShowLorryStationNames, ShowNewGRFSettings(), ShowSigns, ShowStationNames, ShowTownNames, ShowTrainStationNames, ShowTransparencyToolbar(), ShowWaypointNames, Signs, STATION_FACILITY_GHOST, ToggleTransparency(), Train, Transparencies, TransparentBuildings, TransparentStationSigns, and TruckStop.
|
static |
Handle click on the entry in the Aircraft menu.
| index | CompanyID to show aircraft list for. |
Definition at line 861 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Road Vehicles menu.
| index | CompanyID to show road vehicles list for. |
Definition at line 821 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Ships menu.
| index | CompanyID to show ship list for. |
Definition at line 841 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Train menu.
| index | CompanyID to show train list for. |
Definition at line 801 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Stations menu.
| index | CompanyID to show station list for |
Definition at line 557 of file toolbar_gui.cpp.
References None, and ShowCompanyStations().
|
static |
Handle click on the entry in the Story menu.
| index | CompanyID to show story book for |
Definition at line 633 of file toolbar_gui.cpp.
References None, and ShowStoryBook().
|
static |
Handle click on the entry in the Subsidies menu.
Definition at line 537 of file toolbar_gui.cpp.
References None.
|
static |
Handle click on one of the entries in the Town menu.
| index | Index being clicked. |
Definition at line 510 of file toolbar_gui.cpp.
References _settings_game, None, ShowDirectory, ShowFoundTown, ShowPlaceHouses, ShowTownDirectory, and TF_FORBIDDEN.
|
static |
Definition at line 1073 of file toolbar_gui.cpp.
|
static |
Pop up a generic company list menu.
| w | The toolbar window. |
| widget | The button widget id. |
| grey | A bitmask of which companies to mark as disabled. |
Definition at line 171 of file toolbar_gui.cpp.
|
static |
Pop up a generic text only menu.
| w | Toolbar |
| widget | Toolbar button |
| strings | List of strings for each item in the menu |
Definition at line 144 of file toolbar_gui.cpp.
References MakeDropDownListDividerItem(), MakeDropDownListStringItem(), and PopupMainToolbarMenu().
|
static |
Pop up a generic text only menu.
| w | Toolbar |
| widget | Toolbar button |
| list | List of items |
| def | Default item |
Definition at line 133 of file toolbar_gui.cpp.
References GetToolbarDropDownOptions(), and ShowDropDownList().
Referenced by PopupMainToolbarMenu(), ToolbarSaveClick(), and ToolbarScenSaveOrLoad().
|
static |
Definition at line 205 of file toolbar_gui.cpp.
| void SetStartingYear | ( | TimerGameCalendar::Year | year | ) |
Set the starting year for a scenario.
| year | New starting year. |
Definition at line 1152 of file toolbar_gui.cpp.
References _settings_game, Clamp(), TimerGameCalendar::ConvertYMDToDate(), TimerGameEconomy::date, LinkGraphSchedule::instance, TimerGameConst< struct Calendar >::MAX_YEAR, TimerGameConst< struct Calendar >::MIN_YEAR, TimerGameCalendar::SetDate(), and TimerGameEconomy::SetDate().
Referenced by ScenarioEditorToolbarWindow::OnQueryTextFinished().
| void ToggleBoundingBoxes | ( | ) |
Toggle drawing of sprites' bounding boxes.
Function is found here and not in viewport.cpp in order to avoid importing the settings structs to there.
Definition at line 1107 of file toolbar_gui.cpp.
References _settings_client, and MarkWholeScreenDirty().
Referenced by MenuClickHelp(), and MainWindow::OnHotkey().
| void ToggleDirtyBlocks | ( | ) |
Toggle drawing of the dirty blocks.
Function is found here and not in viewport.cpp in order to avoid importing the settings structs to there.
Definition at line 1124 of file toolbar_gui.cpp.
References _settings_client, and MarkWholeScreenDirty().
Referenced by MenuClickHelp(), and MainWindow::OnHotkey().
| void ToggleWidgetOutlines | ( | ) |
Toggle drawing of widget outlines.
Definition at line 1138 of file toolbar_gui.cpp.
References _settings_client, and MarkWholeScreenDirty().
Referenced by MenuClickHelp(), and MainWindow::OnHotkey().
|
static |
Definition at line 849 of file toolbar_gui.cpp.
|
static |
Definition at line 1334 of file toolbar_gui.cpp.
|
static |
Definition at line 977 of file toolbar_gui.cpp.
|
static |
Definition at line 893 of file toolbar_gui.cpp.
|
static |
Definition at line 914 of file toolbar_gui.cpp.
|
static |
Definition at line 935 of file toolbar_gui.cpp.
|
static |
Definition at line 956 of file toolbar_gui.cpp.
|
static |
Definition at line 585 of file toolbar_gui.cpp.
|
static |
Toggle fast forward mode.
Definition at line 233 of file toolbar_gui.cpp.
References _game_speed, _networking, None, and SndClickBeep().
Referenced by MainToolbarWindow::OnHotkey().
|
static |
Definition at line 565 of file toolbar_gui.cpp.
|
static |
Definition at line 998 of file toolbar_gui.cpp.
|
static |
Definition at line 641 of file toolbar_gui.cpp.
|
static |
Definition at line 690 of file toolbar_gui.cpp.
|
static |
Definition at line 1084 of file toolbar_gui.cpp.
|
static |
Definition at line 749 of file toolbar_gui.cpp.
|
static |
Definition at line 707 of file toolbar_gui.cpp.
|
static |
Definition at line 441 of file toolbar_gui.cpp.
|
static |
Definition at line 1030 of file toolbar_gui.cpp.
|
static |
Definition at line 1049 of file toolbar_gui.cpp.
|
static |
Handle click on Options button in toolbar.
| w | parent window the shown Drop down list is attached to. |
Definition at line 276 of file toolbar_gui.cpp.
References _display_opt, _facility_display_opt, _network_server, _networking, Airport, AISettings, BusStop, Dock, Editor, FullAnimation, FullDetail, FullDetails, GameOptions, GameScriptSettings, GetToolbarDropDownOptions(), Houses, IsTransparencySet(), MakeDropDownListCheckedItem(), MakeDropDownListDividerItem(), MakeDropDownListStringItem(), NewGRFSettings, None, SandboxOptions, ShowAirportNames, ShowBusStationNames, ShowCompetitorSigns, ShowDockNames, ShowDropDownList(), ShowGhostStationNames, ShowLorryStationNames, ShowSigns, ShowStationNames, ShowTownNames, ShowTrainStationNames, ShowWaypointNames, Signs, STATION_FACILITY_GHOST, Train, Transparencies, TransparentBuildings, TransparentStationSigns, TruckStop, and WID_TN_SETTINGS.
|
static |
Definition at line 218 of file toolbar_gui.cpp.
|
static |
Definition at line 809 of file toolbar_gui.cpp.
|
static |
Handle click on Save button in toolbar in normal game mode.
| w | parent window the shown save dialogue is attached to. |
Definition at line 380 of file toolbar_gui.cpp.
References None, PopupMainToolbarMenu(), and WID_TN_SAVE.
|
static |
Definition at line 1314 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Build Road menu.
| index | RoadType to show the build toolbar for. |
Definition at line 1288 of file toolbar_gui.cpp.
References _last_built_roadtype, None, and ShowBuildRoadScenToolbar().
|
static |
Definition at line 1276 of file toolbar_gui.cpp.
|
static |
Handle click on the entry in the Build Tram menu.
| index | RoadType to show the build toolbar for. |
Definition at line 1307 of file toolbar_gui.cpp.
References _last_built_tramtype, None, and ShowBuildRoadScenToolbar().
|
static |
Definition at line 1295 of file toolbar_gui.cpp.
|
static |
Definition at line 1220 of file toolbar_gui.cpp.
|
static |
Definition at line 1233 of file toolbar_gui.cpp.
|
static |
Called when clicking at the date panel of the scenario editor toolbar.
Callback for when a button is clicked in the given window.
| w | The clicked window. |
Definition at line 1214 of file toolbar_gui.cpp.
References _settings_game, CS_NUMERAL, EnableDefault, GetString(), None, and ShowQueryString().
|
static |
Definition at line 1269 of file toolbar_gui.cpp.
|
static |
Definition at line 1246 of file toolbar_gui.cpp.
|
static |
Definition at line 1260 of file toolbar_gui.cpp.
|
static |
Definition at line 1254 of file toolbar_gui.cpp.
|
static |
Definition at line 452 of file toolbar_gui.cpp.
|
static |
Definition at line 1328 of file toolbar_gui.cpp.
|
static |
Definition at line 1321 of file toolbar_gui.cpp.
|
static |
Handle click on SaveLoad button in toolbar in the scenario editor.
| w | parent window the shown save dialogue is attached to. |
Definition at line 393 of file toolbar_gui.cpp.
References None, PopupMainToolbarMenu(), and WID_TE_SAVE.
|
static |
Definition at line 829 of file toolbar_gui.cpp.
|
static |
Definition at line 545 of file toolbar_gui.cpp.
|
static |
Definition at line 621 of file toolbar_gui.cpp.
|
static |
Definition at line 526 of file toolbar_gui.cpp.
|
static |
Definition at line 1194 of file toolbar_gui.cpp.
|
static |
Definition at line 492 of file toolbar_gui.cpp.
|
static |
Definition at line 789 of file toolbar_gui.cpp.
|
static |
Definition at line 778 of file toolbar_gui.cpp.
|
static |
Definition at line 869 of file toolbar_gui.cpp.
|
static |
Definition at line 879 of file toolbar_gui.cpp.
| RailType _last_built_railtype |
The most recently used type of rail.
Definition at line 85 of file toolbar_gui.cpp.
Referenced by BuildRailToolbarWindow::ChangeRailTypeOnHotkey(), MenuClickBuildRail(), MainToolbarWindow::OnHotkey(), BuildRailToolbarWindow::RailToolbarGlobalHotkeys(), ReinitGuiAfterToggleElrail(), and SetDefaultRailGui().
| RoadType _last_built_roadtype |
The most recently used type of road.
Definition at line 86 of file toolbar_gui.cpp.
Referenced by BuildRoadToolbarWindow::ChangeRoadTypeOnHotkey(), MenuClickBuildRoad(), MainToolbarWindow::OnHotkey(), ScenarioEditorToolbarWindow::OnHotkey(), SetDefaultRoadGui(), and ToolbarScenBuildRoad().
| RoadType _last_built_tramtype |
The most recently used type of tram track.
Definition at line 87 of file toolbar_gui.cpp.
Referenced by BuildRoadToolbarWindow::ChangeRoadTypeOnHotkey(), MenuClickBuildTram(), MainToolbarWindow::OnHotkey(), ScenarioEditorToolbarWindow::OnHotkey(), SetDefaultRoadGui(), and ToolbarScenBuildTram().
|
static |
Last started user action.
Definition at line 103 of file toolbar_gui.cpp.
Referenced by ScenarioEditorToolbarWindow::OnClick(), MainToolbarWindow::OnDropdownSelect(), ScenarioEditorToolbarWindow::OnDropdownSelect(), MainToolbarWindow::OnHotkey(), ScenarioEditorToolbarWindow::OnHotkey(), MainToolbarWindow::OnPlaceObject(), ScenarioEditorToolbarWindow::OnPlaceObject(), MainToolbarWindow::OnPlaceObjectAbort(), and ScenarioEditorToolbarWindow::OnPlaceObjectAbort().
|
static |
Definition at line 1341 of file toolbar_gui.cpp.
|
staticconstexpr |
Definition at line 2566 of file toolbar_gui.cpp.
|
staticconstexpr |
Definition at line 2606 of file toolbar_gui.cpp.
|
staticconstexpr |
Definition at line 2262 of file toolbar_gui.cpp.
|
static |
Persistent filter text for railtype dropdown menu.
Definition at line 889 of file toolbar_gui.cpp.
|
static |
Persistent filter text for roadtype dropdown menu.
Definition at line 890 of file toolbar_gui.cpp.
|
static |
Definition at line 2304 of file toolbar_gui.cpp.
|
static |
Definition at line 2278 of file toolbar_gui.cpp.
|
static |
Definition at line 1970 of file toolbar_gui.cpp.
|
staticconstexpr |
Sprites to use for the different toolbar buttons.
Definition at line 2188 of file toolbar_gui.cpp.
Referenced by GetToolbarMaximalImageSize(), and MakeMainToolbar().
|
static |
Definition at line 203 of file toolbar_gui.cpp.
| uint _toolbar_width = 0 |
Width of the toolbar, shared by statusbar.
Definition at line 83 of file toolbar_gui.cpp.
Referenced by MainToolbarWindow::FindWindowPlacementAndResize(), NetworkChatWindow::FindWindowPlacementAndResize(), ScenarioEditorToolbarWindow::FindWindowPlacementAndResize(), StatusBarWindow::FindWindowPlacementAndResize(), RelocateAllWindows(), NWidgetScenarioToolbarContainer::SetupSmallestSize(), and NWidgetToolbarContainer::SetupSmallestSize().
|
static |
Persistent filter text for tramtype dropdown menu.
Definition at line 891 of file toolbar_gui.cpp.
|
static |
Indicates the "all connected players" entry.
Definition at line 161 of file toolbar_gui.cpp.
Referenced by MenuClickCompany().
|
static |
Indicates the "become spectator" entry.
Definition at line 162 of file toolbar_gui.cpp.
Referenced by MenuClickCompany().
|
static |
Indicates that a window is being opened for the spectator.
Definition at line 163 of file toolbar_gui.cpp.
|
static |
Show cargo payment rates graph.
Definition at line 670 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show company value graph.
Definition at line 669 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show delivered cargo graph.
Definition at line 667 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show income graph.
Definition at line 666 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Enum for the League Toolbar's and Graph Toolbar's related buttons.
Use continuous numbering as League Toolbar can be combined into the Graph Toolbar. Show operating profit graph
Definition at line 665 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show performance history graph.
Definition at line 668 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show highscrore table.
Definition at line 673 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show default league table.
Definition at line 671 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().
|
static |
Show detailed performance rating.
Definition at line 672 of file toolbar_gui.cpp.
Referenced by MenuClickGraphsOrLeague().