OpenTTD Source  12.0-beta2
gui.h File Reference
#include "vehicle_type.h"
#include "economy_type.h"
#include "tile_type.h"
#include "transport_type.h"
#include "story_type.h"
#include "company_type.h"

Go to the source code of this file.

Functions

void InitializeGUI ()
 
void ShowGameOptions ()
 Open the game options window.
 
void ShowGameSettings ()
 Open advanced settings window.
 
void ShowOrdersWindow (const Vehicle *v)
 
WindowShowBuildDocksToolbar ()
 Open the build water toolbar window. More...
 
WindowShowBuildDocksScenToolbar ()
 Open the build water toolbar window for the scenario editor. More...
 
WindowShowBuildAirToolbar ()
 Open the build airport toolbar window. More...
 
void ShowGenerateLandscape ()
 Start with a normal game.
 
void ShowHeightmapLoad ()
 Start with loading a heightmap.
 
void ShowLandInfo (TileIndex tile)
 Show land information window. More...
 
void ShowAboutWindow ()
 
void ShowBuildTreesToolbar ()
 
void ShowTownDirectory ()
 
void ShowIndustryDirectory ()
 
void ShowIndustryCargoesWindow ()
 Open the industry and cargoes window with an industry.
 
void ShowSubsidiesList ()
 
void ShowGoalsList (CompanyID company)
 Open a goal list window. More...
 
void ShowGoalQuestion (uint16 id, byte type, uint32 button_mask, const char *question)
 Display a goal question. More...
 
void ShowStoryBook (CompanyID company, uint16 page_id=INVALID_STORY_PAGE)
 Raise or create the story book window for company, at page page_id. More...
 
void ShowEstimatedCostOrIncome (Money cost, int x, int y)
 Display estimated costs. More...
 
void ShowExtraViewportWindow (TileIndex tile=INVALID_TILE)
 Show a new Extra Viewport window. More...
 
void ShowExtraViewportWindowForTileUnderCursor ()
 Show a new Extra Viewport window. More...
 
void ShowBuildBridgeWindow (TileIndex start, TileIndex end, TransportType transport_type, byte bridge_type)
 Prepare the data for the build a bridge window. More...
 
void ShowBuildIndustryWindow ()
 
void ShowFoundTownWindow ()
 
void ShowMusicWindow ()
 

Detailed Description

GUI functions that shouldn't be here.

Definition in file gui.h.

Function Documentation

◆ ShowBuildAirToolbar()

Window* ShowBuildAirToolbar ( )

Open the build airport toolbar window.

If the terraform toolbar is linked to the toolbar, that window is also opened.

Returns
newly opened airport toolbar, or nullptr if the toolbar could not be opened.

Definition at line 217 of file airport_gui.cpp.

References _local_company, CloseWindowByClass(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and WC_BUILD_TOOLBAR.

Referenced by MenuClickBuildAir().

◆ ShowBuildBridgeWindow()

void ShowBuildBridgeWindow ( TileIndex  start,
TileIndex  end,
TransportType  transport_type,
byte  road_rail_type 
)

Prepare the data for the build a bridge window.

If we can't build a bridge under the given conditions show an error message.

Parameters
startThe start tile of the bridge
endThe end tile of the bridge
transport_typeThe transport type
road_rail_typeThe road/rail type

Definition at line 361 of file bridge_gui.cpp.

References _ctrl_pressed, _last_railbridge_type, _last_roadbridge_type, CalcBridgeLenCostFactor(), CcBuildBridge(), CheckBridgeAvailability(), CloseWindowByClass(), CMD_BUILD_BRIDGE, CMD_MSG, CommandFlagsToDCFlags(), DC_QUERY_COST, DoCommand(), DoCommandP(), CommandCost::Failed(), GetCommandFlags(), CommandCost::GetErrorMessage(), GetTunnelBridgeLength(), INVALID_ROADTYPE, INVALID_STRING_ID, IsBridgeTile(), TRANSPORT_RAIL, TRANSPORT_ROAD, and WC_BUILD_BRIDGE.

◆ ShowBuildDocksScenToolbar()

Window* ShowBuildDocksScenToolbar ( )

Open the build water toolbar window for the scenario editor.

Returns
newly opened water toolbar, or nullptr if the toolbar could not be opened.

Definition at line 399 of file dock_gui.cpp.

References _build_docks_scen_toolbar_desc, and TRANSPORT_WATER.

◆ ShowBuildDocksToolbar()

Window* ShowBuildDocksToolbar ( )

Open the build water toolbar window.

If the terraform toolbar is linked to the toolbar, that window is also opened.

Returns
newly opened water toolbar, or nullptr if the toolbar could not be opened.

Definition at line 358 of file dock_gui.cpp.

References _local_company, CloseWindowByClass(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and WC_BUILD_TOOLBAR.

Referenced by MenuClickBuildWater().

◆ ShowEstimatedCostOrIncome()

void ShowEstimatedCostOrIncome ( Money  cost,
int  x,
int  y 
)

Display estimated costs.

Parameters
costEstimated cost (or income if negative).
xX position of the notification window.
yY position of the notification window.

Definition at line 554 of file misc_gui.cpp.

◆ ShowExtraViewportWindow()

◆ ShowExtraViewportWindowForTileUnderCursor()

void ShowExtraViewportWindowForTileUnderCursor ( )

Show a new Extra Viewport window.

Center it on the tile under the cursor, if the cursor is inside a viewport. If that fails, center it on main viewport center.

Definition at line 183 of file viewport_gui.cpp.

◆ ShowGoalQuestion()

void ShowGoalQuestion ( uint16  id,
byte  type,
uint32  button_mask,
const char *  question 
)

Display a goal question.

Parameters
idWindow number to use.
typeType of question.
button_maskButtons to display.
questionQuestion to ask.

Definition at line 561 of file goal_gui.cpp.

◆ ShowGoalsList()

void ShowGoalsList ( CompanyID  company)

Open a goal list window.

Parameters
companyCompany to display the goals for, use INVALID_COMPANY to display global goals.

Definition at line 320 of file goal_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().

Referenced by MenuClickGoal(), GoalListWindow::OnClick(), and StoryBookWindow::OnPageElementClick().

◆ ShowLandInfo()

void ShowLandInfo ( TileIndex  tile)

Show land information window.

Parameters
tileThe tile to show information about.

Definition at line 377 of file misc_gui.cpp.

References CloseWindowById(), and WC_LAND_INFO.

◆ ShowStoryBook()

void ShowStoryBook ( CompanyID  company,
uint16  page_id 
)

Raise or create the story book window for company, at page page_id.

Parameters
company'Owner' of the story book, may be INVALID_COMPANY.
page_idPage to open, may be INVALID_STORY_PAGE.

Definition at line 1062 of file story_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().

Referenced by CmdShowStoryPage(), GoalListWindow::HandleClick(), and MenuClickStory().