# 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 "strings_type.h"`
`#include "transport_type.h"`

Go to the source code of this file.

## Functions
void | HandleOnEditText (const char *str)
void | InitializeGUI ()
void | ShowGameOptions ()
void | ShowGameDifficulty ()
void | ShowGameSettings ()
void | DrawArrowButtons (int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right)
| Draw [<][>] boxes.
void | ShowOrdersWindow (const Vehicle *v)
void | ShowBuildDocksToolbar ()
void | ShowBuildDocksScenToolbar ()
void | ShowBuildAirToolbar ()
void | ShowGenerateLandscape ()
void | ShowHeightmapLoad ()
void | PlaceLandBlockInfo ()
void | ShowAboutWindow ()
void | ShowBuildTreesToolbar ()
void | ShowTownDirectory ()
void | ShowIndustryDirectory ()
void | ShowSubsidiesList ()
void | ShowEstimatedCostOrIncome (Money cost, int x, int y)
void | ShowErrorMessage (StringID summary_msg, StringID detailed_msg, int x, int y, bool no_timeout=false)
| Display an error message in a window.
void | ShowExtraViewPortWindow (TileIndex tile=INVALID_TILE)
void | BuildFileList ()
void | SetFiosType (const byte fiostype)
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 ()
## Variables
const TextColour | _fios_colours []

## 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 1736 of file settings_gui.cpp.

References _colour_gradient, _dynlang, DrawFrameRect(), DrawSprite(), FILLRECT_CHECKER, FR_LOWERED, GfxFillRect(), TD_RTL, DynamicLanguages::text_dir, WD_IMGBTN_LEFT, and WD_IMGBTN_TOP.

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

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:

  | start | The start tile of the bridge
  | end | The end tile of the bridge
  | transport_type | The transport type
  | road_rail_type | The road/rail type

Definition at line 355 of file bridge_gui.cpp.

References _ctrl_pressed, _last_railbridge_type, _last_roadbridge_type, SmallVector< T, S >::Append(), CalcBridgeLenCostFactor(), CcBuildBridge(), CheckBridgeAvailability(), CMD_BUILD_BRIDGE, CMD_MSG, DC_AUTO, DC_QUERY_COST, DeleteWindowByClass(), DoCommand(), DoCommandP(), CommandCost::Failed(), CommandCost::GetCost(), GetTunnelBridgeLength(), INVALID_STRING_ID, SmallVector< T, S >::Length(), BridgeSpec::price, RailBuildCost(), ShowErrorMessage(), CommandCost::Succeeded(), TILE_SIZE, TileX(), TileY(), TRANSPORT_RAIL, and TRANSPORT_ROAD.

Referenced by BuildRoadToolbarWindow::OnPlaceMouseUp(), and BuildRailToolbarWindow::OnPlaceMouseUp().

void ShowErrorMessage | ( | StringID | summary_msg,
|  | StringID | detailed_msg,
|  | int | x,
|  | int | y,
|  | bool | no_timeout |
| ) |  |  |

Display an error message in a window.

Parameters:

  | summary_msg | General error message showed in first line. Must be valid.
  | detailed_msg | Detailed error message showed in second line. Can be INVALID_STRING_ID.
  | x | World X position (TileVirtX) of the error location. Set both x and y to 0 to just center the message when there is no related error tile.
  | y | World Y position (TileVirtY) of the error location. Set both x and y to 0 to just center the message when there is no related error tile.
  | no_timeout | Set to true, if the message is that important that it should not close automatically after some time.

Definition at line 709 of file misc_gui.cpp.

References _settings_client, DeleteWindowById(), GUISettings::errmsg_duration, and ClientSettings::gui.

Referenced by ClientNetworkContentSocketHandler::AfterDownload(), ClientNetworkContentSocketHandler::BeforeDownload(), ChangeDynamicEngines(), CheckForMissingGlyphsInLoadedLanguagePack(), CheckForMissingSprites(), CheckTrainsLengths(), AIInstance::Died(), DoAutosave(), DoCommandP(), ExpandTown(), IndustryProductionCallback(), MakeScreenshot(), FoundTownWindow::OnClick(), TownViewWindow::OnClick(), GameDifficultyWindow::OnClick(), GameOptionsWindow::OnClick(), NewGRFWindow::OnClick(), NewGRFAddWindow::OnClick(), SaveLoadWindow::OnClick(), SelectGameWindow::OnClick(), BuildIndustryWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), AIConfigWindow::OnClick(), NetworkContentListWindow::OnConnect(), BuildIndustryWindow::OnPlaceObject(), SelectCompanyManagerFaceWindow::OnQueryTextFinished(), SaveLoadWindow::OnTimeout(), ReadHeightmapBMP(), ReadHeightmapPNG(), SaveFileError(), SaveOrLoad(), ShowBuildBridgeWindow(), ShowNetworkContentListWindow(), ShowNewGRFError(), ShowNewGrfVehicleError(), StartScenario(), and WarnCorruptSprite().