OpenTTD Source 20260208-master-g43af8e94d0
toolbar_gui.h File Reference

Stuff related to the (main) toolbar. More...

#include "rail_type.h"
#include "road_type.h"

Go to the source code of this file.

Enumerations

enum  MainToolbarHotkeys : int32_t {
  MTHK_PAUSE , MTHK_FASTFORWARD , MTHK_SETTINGS , MTHK_SAVEGAME ,
  MTHK_LOADGAME , MTHK_SMALLMAP , MTHK_TOWNDIRECTORY , MTHK_SUBSIDIES ,
  MTHK_STATIONS , MTHK_FINANCES , MTHK_COMPANIES , MTHK_STORY ,
  MTHK_GOAL , MTHK_GRAPHS , MTHK_LEAGUE , MTHK_INDUSTRIES ,
  MTHK_TRAIN_LIST , MTHK_ROADVEH_LIST , MTHK_SHIP_LIST , MTHK_AIRCRAFT_LIST ,
  MTHK_ZOOM_IN , MTHK_ZOOM_OUT , MTHK_BUILD_RAIL , MTHK_BUILD_ROAD ,
  MTHK_BUILD_TRAM , MTHK_BUILD_DOCKS , MTHK_BUILD_AIRPORT , MTHK_BUILD_TREES ,
  MTHK_MUSIC , MTHK_LANDINFO , MTHK_SCRIPT_DEBUG , MTHK_SMALL_SCREENSHOT ,
  MTHK_ZOOMEDIN_SCREENSHOT , MTHK_DEFAULTZOOM_SCREENSHOT , MTHK_GIANT_SCREENSHOT , MTHK_CHEATS ,
  MTHK_TERRAFORM , MTHK_EXTRA_VIEWPORT , MTHK_CLIENT_LIST , MTHK_SIGN_LIST
}

Functions

void AllocateToolbar ()
 Allocate the toolbar.
void ToggleBoundingBoxes ()
 Toggle drawing of sprites' bounding boxes.
void ToggleDirtyBlocks ()
 Toggle drawing of the dirty blocks.
void ToggleWidgetOutlines ()
 Toggle drawing of widget outlines.

Variables

uint _toolbar_width
 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.

Detailed Description

Stuff related to the (main) toolbar.

Definition in file toolbar_gui.h.

Enumeration Type Documentation

◆ MainToolbarHotkeys

enum MainToolbarHotkeys : int32_t

Definition at line 16 of file toolbar_gui.h.

Function Documentation

◆ AllocateToolbar()

void AllocateToolbar ( )

Allocate the toolbar.

Definition at line 2573 of file toolbar_gui.cpp.

References _last_built_roadtype, _last_built_tramtype, ROADTYPE_ROAD, and ROADTYPE_TRAM.

Referenced by ShowVitalWindows().

◆ ToggleBoundingBoxes()

void ToggleBoundingBoxes ( )

Toggle drawing of sprites' bounding boxes.

Note
has only an effect when newgrf_developer_tools are active.

Function is found here and not in viewport.cpp in order to avoid importing the settings structs to there.

Definition at line 1087 of file toolbar_gui.cpp.

References _settings_client, and MarkWholeScreenDirty().

Referenced by MenuClickHelp(), and MainWindow::OnHotkey().

◆ ToggleDirtyBlocks()

void ToggleDirtyBlocks ( )

Toggle drawing of the dirty blocks.

Note
has only an effect when newgrf_developer_tools are active.

Function is found here and not in viewport.cpp in order to avoid importing the settings structs to there.

Definition at line 1104 of file toolbar_gui.cpp.

References _settings_client, and MarkWholeScreenDirty().

Referenced by MenuClickHelp(), and MainWindow::OnHotkey().

◆ ToggleWidgetOutlines()

void ToggleWidgetOutlines ( )

Toggle drawing of widget outlines.

Note
has only an effect when newgrf_developer_tools are active.

Definition at line 1118 of file toolbar_gui.cpp.

References _settings_client, and MarkWholeScreenDirty().

Referenced by MenuClickHelp(), and MainWindow::OnHotkey().

Variable Documentation

◆ _last_built_railtype

◆ _last_built_roadtype

RoadType _last_built_roadtype
extern

◆ _last_built_tramtype

RoadType _last_built_tramtype
extern

The most recently used type of tram track.

Definition at line 82 of file toolbar_gui.cpp.

Referenced by AllocateToolbar(), BuildRoadToolbarWindow::ChangeRoadTypeOnHotkey(), MenuClickBuildTram(), MainToolbarWindow::OnHotkey(), and ToolbarScenBuildTram().

◆ _toolbar_width