OpenTTD Source: src/settings_gui.h File Reference

OpenTTD Source 14.1

Macros | Functions
settings_gui.h File Reference
`#include "gfx_type.h"`
`#include "widgets/dropdown_type.h"`

Go to the source code of this file.

## Macros
#define | SETTING_BUTTON_WIDTH ((int)NWidgetScrollbar::GetHorizontalDimension().width * 2)
| Width of setting buttons.
#define | SETTING_BUTTON_HEIGHT ((int)NWidgetScrollbar::GetHorizontalDimension().height)
| Height of setting buttons.

## Functions
void | DrawArrowButtons (int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right)
| Draw [<][>] boxes. More...
void | DrawDropDownButton (int x, int y, Colours button_colour, bool state, bool clickable)
| Draw a dropdown button. More...
void | DrawBoolButton (int x, int y, bool state, bool clickable)
| Draw a toggle button. More...
template<class T >
DropDownList | BuildSetDropDownList (int *selected_index)
void | ChangeMusicSet (int index)
| Change the configured music set and reset playback. More...

## Detailed Description

Functions for setting GUIs.

Definition in file settings_gui.h.

## Function Documentation

## ◆ ChangeMusicSet()

void ChangeMusicSet | ( | int | index | ) |

Change the configured music set and reset playback.

Parameters

  index | Index of music set to switch to

Definition at line 463 of file music_gui.cpp.

References _music, BaseMedia< MusicSet >::GetIndexOfUsedSet(), and BaseMedia< MusicSet >::GetSet().

## ◆ DrawArrowButtons()

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

## ◆ DrawBoolButton()

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

## ◆ DrawDropDownButton()

void DrawDropDownButton | ( | int | x,
|  | int | y,
|  | Colours | button_colour,
|  | bool | state,
|  | bool | clickable
| ) |  |

Draw a dropdown button.

Parameters

  x | the x position to draw
  y | the y position to draw
  button_colour | the colour of the button
  state | true = lowered
  clickable | is the button clickable?

Definition at line 2941 of file settings_gui.cpp.