|
OpenTTD Source 20251116-master-g21329071df
|
Functions for setting GUIs. More...
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, uint8_t state, bool clickable_left, bool clickable_right) |
| Draw [<][>] boxes. | |
| void | DrawUpDownButtons (int x, int y, Colours button_colour, uint8_t state, bool clickable_up, bool clickable_down) |
| Draw [^][v] buttons. | |
| void | DrawDropDownButton (int x, int y, Colours button_colour, bool state, bool clickable) |
| Draw a dropdown button. | |
| void | DrawBoolButton (int x, int y, Colours button_colour, Colours background, bool state, bool clickable) |
| Draw a toggle button. | |
| template<class T > | |
| DropDownList | BuildSetDropDownList (int *selected_index) |
| void | ChangeMusicSet (int index) |
| Change the configured music set and reset playback. | |
Functions for setting GUIs.
Definition in file settings_gui.h.
| #define SETTING_BUTTON_HEIGHT ((int)NWidgetScrollbar::GetHorizontalDimension().height) |
Height of setting buttons.
Definition at line 19 of file settings_gui.h.
| #define SETTING_BUTTON_WIDTH ((int)NWidgetScrollbar::GetHorizontalDimension().width * 2) |
Width of setting buttons.
Definition at line 17 of file settings_gui.h.
| DropDownList BuildSetDropDownList | ( | int * | selected_index | ) |
Definition at line 147 of file settings_gui.cpp.
| void ChangeMusicSet | ( | int | index | ) |
Change the configured music set and reset playback.
| index | Index of music set to switch to |
Definition at line 462 of file music_gui.cpp.
References MusicSystem::ChangeMusicSet(), BaseMedia< MusicSet >::GetIndexOfUsedSet(), and BaseMedia< MusicSet >::GetSet().
Referenced by MusicTrackSelectionWindow::OnDropdownSelect(), and GameOptionsWindow::OnDropdownSelect().
| void DrawArrowButtons | ( | int | x, |
| int | y, | ||
| Colours | button_colour, | ||
| uint8_t | state, | ||
| bool | clickable_left, | ||
| bool | clickable_right | ||
| ) |
Draw [<][>] boxes.
| 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 1866 of file settings_gui.cpp.
References _current_text_dir, WidgetDimensions::bevel, DrawFrameRect(), FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), Lowered, SA_CENTER, WidgetDimensions::scaled, Rect::Shrink(), and TD_RTL.
Referenced by IndustryViewWindow::DrawInfo(), SettingEntry::DrawSetting(), SelectCompanyManagerFaceWindow::DrawWidget(), GSConfigWindow::DrawWidget(), NewGRFParametersWindow::DrawWidget(), and ScriptSettingsWindow::DrawWidget().
| void DrawBoolButton | ( | int | x, |
| int | y, | ||
| Colours | button_colour, | ||
| Colours | background, | ||
| bool | state, | ||
| bool | clickable | ||
| ) |
Draw a toggle button.
| x | the x position to draw |
| y | the y position to draw |
| button_colour | the colour of the button. |
| background | background colour. |
| state | true = lowered |
| clickable | is the button clickable? |
Definition at line 1947 of file settings_gui.cpp.
References _current_text_dir, WidgetDimensions::bevel, BorderOnly, DrawFrameRect(), FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), Lowered, WidgetDimensions::scaled, SETTING_BUTTON_HEIGHT, SETTING_BUTTON_WIDTH, Rect::Shrink(), TD_RTL, and Rect::WithWidth().
Referenced by NWidgetLeaf::Draw(), SettingEntry::DrawSetting(), SelectCompanyManagerFaceWindow::DrawWidget(), GSConfigWindow::DrawWidget(), NewGRFParametersWindow::DrawWidget(), and ScriptSettingsWindow::DrawWidget().
| void DrawDropDownButton | ( | int | x, |
| int | y, | ||
| Colours | button_colour, | ||
| bool | state, | ||
| bool | clickable | ||
| ) |
Draw a dropdown button.
| 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 1924 of file settings_gui.cpp.
References WidgetDimensions::bevel, DrawFrameRect(), FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), Lowered, SA_CENTER, WidgetDimensions::scaled, SETTING_BUTTON_HEIGHT, SETTING_BUTTON_WIDTH, and Rect::Shrink().
Referenced by SettingEntry::DrawSetting(), GSConfigWindow::DrawWidget(), NewGRFParametersWindow::DrawWidget(), and ScriptSettingsWindow::DrawWidget().
| void DrawUpDownButtons | ( | int | x, |
| int | y, | ||
| Colours | button_colour, | ||
| uint8_t | state, | ||
| bool | clickable_up, | ||
| bool | clickable_down | ||
| ) |
Draw [^][v] buttons.
| 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_up | is the up button clickable? |
| clickable_down | is the down button clickable? |
Definition at line 1898 of file settings_gui.cpp.
References _current_text_dir, WidgetDimensions::bevel, DrawFrameRect(), FILLRECT_CHECKER, GetColourGradient(), GfxFillRect(), Lowered, SA_CENTER, WidgetDimensions::scaled, SETTING_BUTTON_HEIGHT, SETTING_BUTTON_WIDTH, Rect::Shrink(), TD_RTL, and Rect::WithWidth().