Functions

gui.h File Reference

GUI functions that shouldn't be here. More...

#include "vehicle_type.h"
#include "gfx_type.h"
#include "economy_type.h"
#include "tile_type.h"
#include "transport_type.h"

Go to the source code of this file.

Functions

void HandleOnEditText (const char *str)
void InitializeGUI ()
void ShowGameOptions ()
 Open the game options window.
void ShowGameDifficulty ()
 Open the game-difficulty window.
void ShowGameSettings ()
 Open advanced settings window.
void DrawArrowButtons (int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right)
 Draw [<][>] boxes.
void DrawBoolButton (int x, int y, bool state, bool clickable)
 Draw a toggle button.
void ShowOrdersWindow (const Vehicle *v)
WindowShowBuildDocksToolbar ()
 Open the build water toolbar window.
WindowShowBuildDocksScenToolbar ()
 Open the build water toolbar window for the scenario editor.
WindowShowBuildAirToolbar ()
 Open the build airport toolbar window.
void ShowGenerateLandscape ()
 Start with a normal game.
void ShowHeightmapLoad ()
 Start with loading a heightmap.
void ShowLandInfo (TileIndex tile)
 Show land information window.
void ShowAboutWindow ()
void ShowBuildTreesToolbar ()
void ShowTownDirectory ()
void ShowIndustryDirectory ()
void ShowSubsidiesList ()
void ShowGoalsList ()
void ShowGoalQuestion (uint16 id, byte type, uint32 button_mask, const char *question)
void ShowEstimatedCostOrIncome (Money cost, int x, int y)
 Display estimated costs.
void ShowExtraViewPortWindow (TileIndex tile=INVALID_TILE)
 Show a new Extra Viewport window.
void ShowExtraViewPortWindowForTileUnderCursor ()
 Show a new Extra Viewport window.
void ShowBuildBridgeWindow (TileIndex start, TileIndex end, TransportType transport_type, byte bridge_type)
 Prepare the data for the build a bridge window.
void ShowBuildIndustryWindow ()
void ShowFoundTownWindow ()
void ShowMusicWindow ()

Detailed Description

GUI functions that shouldn't be here.

Definition in file gui.h.


Function Documentation

void DrawArrowButtons ( int  x,
int  y,
Colours  button_colour,
byte  state,
bool  clickable_left,
bool  clickable_right 
)

Draw [<][>] boxes.

Parameters:
x the x position to draw
y the y position to draw
button_colour the colour of the button
state 0 = none clicked, 1 = first clicked, 2 = second clicked
clickable_left is the left button clickable?
clickable_right is the right button clickable?

Definition at line 1899 of file settings_gui.cpp.

References _colour_gradient, _current_text_dir, DrawFrameRect(), DrawSprite(), FILLRECT_CHECKER, FR_LOWERED, GfxFillRect(), WD_IMGBTN_LEFT, and WD_IMGBTN_TOP.

Referenced by IndustryViewWindow::DrawInfo(), SettingEntry::DrawSetting(), NewGRFParametersWindow::DrawWidget(), CheatWindow::DrawWidget(), and AISettingsWindow::DrawWidget().

void DrawBoolButton ( int  x,
int  y,
bool  state,
bool  clickable 
)

Draw a toggle button.

Parameters:
x the x position to draw
y the y position to draw
state true = lowered
clickable is the button clickable?

Definition at line 1925 of file settings_gui.cpp.

References DrawFrameRect(), and FR_LOWERED.

Referenced by SettingEntry::DrawSetting(), NewGRFParametersWindow::DrawWidget(), CheatWindow::DrawWidget(), and AISettingsWindow::DrawWidget().

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 NULL if the toolbar could not be opened.

Definition at line 182 of file airport_gui.cpp.

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

Referenced by MenuClickBuildAir(), and MainToolbarWindow::OnKeyPress().

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

Open the build water toolbar window for the scenario editor.

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

Definition at line 380 of file dock_gui.cpp.

References _build_docks_scen_toolbar_desc.

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 NULL if the toolbar could not be opened.

Definition at line 330 of file dock_gui.cpp.

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

Referenced by MenuClickBuildWater(), and MainToolbarWindow::OnKeyPress().

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

Display estimated costs.

Parameters:
cost Estimated cost (or income if negative).
x X position of the notification window.
y Y position of the notification window.

Definition at line 513 of file misc_gui.cpp.

References INVALID_STRING_ID, SetDParam(), ShowErrorMessage(), and WL_INFO.

Referenced by DoCommandP().

void ShowExtraViewPortWindow ( TileIndex  tile  ) 
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 182 of file viewport_gui.cpp.

References INVALID_TILE, ShowExtraViewPortWindow(), and TileVirtXY().

Referenced by ScenarioEditorToolbarWindow::OnKeyPress(), and MainToolbarWindow::OnKeyPress().

void ShowGameDifficulty (  ) 

Open the game-difficulty window.

Definition at line 954 of file settings_gui.cpp.

References _game_difficulty_desc, DeleteWindowByClass(), and WC_GAME_OPTIONS.

Referenced by MenuClickSettings(), and SelectGameWindow::OnClick().

void ShowGameOptions (  ) 
void ShowGameSettings (  ) 

Open advanced settings window.

Definition at line 1883 of file settings_gui.cpp.

References DeleteWindowByClass(), and WC_GAME_OPTIONS.

Referenced by MenuClickSettings(), and SelectGameWindow::OnClick().

void ShowGenerateLandscape (  ) 

Start with a normal game.

Definition at line 853 of file genworld_gui.cpp.

References GLWM_GENERATE.

Referenced by SelectGameWindow::OnClick(), and CreateScenarioWindow::OnClick().

void ShowHeightmapLoad (  ) 

Start with loading a heightmap.

Definition at line 859 of file genworld_gui.cpp.

References GLWM_HEIGHTMAP.

void ShowLandInfo ( TileIndex  tile  ) 

Show land information window.

Parameters:
tile The tile to show information about.

Definition at line 347 of file misc_gui.cpp.

References DeleteWindowById(), and WC_LAND_INFO.

Referenced by ScenarioEditorToolbarWindow::OnPlaceObject(), and MainToolbarWindow::OnPlaceObject().