|
OpenTTD Source
1.11.0-beta2
|
#include "stdafx.h"#include "currency.h"#include "error.h"#include "settings_gui.h"#include "textbuf_gui.h"#include "command_func.h"#include "network/network.h"#include "town.h"#include "settings_internal.h"#include "strings_func.h"#include "window_func.h"#include "string_func.h"#include "widgets/dropdown_type.h"#include "widgets/dropdown_func.h"#include "highscore.h"#include "base_media_base.h"#include "company_base.h"#include "company_func.h"#include "viewport_func.h"#include "core/geometry_func.hpp"#include "ai/ai.hpp"#include "blitter/factory.hpp"#include "language.h"#include "textfile_gui.h"#include "stringfilter_type.h"#include "querystring_gui.h"#include "fontcache.h"#include "zoom_func.h"#include <vector>#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | BaseSetTextfileWindow< TBaseSet > |
| Window for displaying the textfile of a BaseSet. More... | |
| struct | GameOptionsWindow |
| struct | SettingFilter |
| Filter for settings list. More... | |
| struct | BaseSettingEntry |
| Data structure describing a single setting in a tab. More... | |
| struct | SettingEntry |
| Standard setting. More... | |
| struct | SettingsContainer |
| Containers for BaseSettingEntry. More... | |
| struct | SettingsPage |
| Data structure describing one page of settings in the settings window. More... | |
| struct | GameSettingsWindow |
| Window to edit settings of the game. More... | |
| struct | CustomCurrencyWindow |
Enumerations | |
| enum | SettingEntryFlags { SEF_LEFT_DEPRESSED = 0x01, SEF_RIGHT_DEPRESSED = 0x02, SEF_BUTTONS_MASK = (SEF_LEFT_DEPRESSED | SEF_RIGHT_DEPRESSED), SEF_LAST_FIELD = 0x04, SEF_FILTERED = 0x08 } |
| Flags for SettingEntry. More... | |
| enum | RestrictionMode { RM_BASIC, RM_ADVANCED, RM_ALL, RM_CHANGED_AGAINST_DEFAULT, RM_CHANGED_AGAINST_NEW, RM_END } |
| How the list of advanced settings is filtered. More... | |
| enum | WarnHiddenResult { WHR_NONE, WHR_CATEGORY, WHR_TYPE, WHR_CATEGORY_TYPE } |
| Warnings about hidden search results. More... | |
Functions | |
| static const void * | ResolveVariableAddress (const GameSettings *settings_ptr, const SettingDesc *sd) |
| static uint | GetCurRes () |
| Get index of the current screen resolution. More... | |
| static void | ShowCustCurrency () |
| Open custom currency window. | |
| template<class T > | |
| static DropDownList | BuildSetDropDownList (int *selected_index, bool allow_selection) |
| DropDownList | BuildMusicSetDropDownList (int *selected_index) |
| template<class TBaseSet > | |
| void | ShowBaseSetTextfileWindow (TextfileType file_type, const TBaseSet *baseset, StringID content_type) |
| Open the BaseSet version of the textfile window. More... | |
| void | ShowGameOptions () |
| Open the game options window. | |
| static SettingsContainer & | GetSettingsTree () |
| Construct settings tree. | |
| 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. 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... | |
Variables | |
| static const StringID | _autosave_dropdown [] |
| static const StringID | _gui_zoom_dropdown [] |
| static const StringID | _font_zoom_dropdown [] |
| static Dimension | _circle_size |
| Dimension of the circle +/- icon. This is here as not all users are within the class of the settings window. | |
| static const NWidgetPart | _nested_game_options_widgets [] |
| static WindowDesc | _game_options_desc (WDP_CENTER, "settings_game", 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, _nested_game_options_widgets, lengthof(_nested_game_options_widgets)) |
| static int | SETTING_HEIGHT = 11 |
| Height of a single setting in the tree view in pixels. | |
| static const int | LEVEL_WIDTH = 15 |
| Indenting width of a sub-page in pixels. | |
| static const StringID | _game_settings_restrict_dropdown [] |
| static const NWidgetPart | _nested_settings_selection_widgets [] |
| static WindowDesc | _settings_selection_desc (WDP_CENTER, "settings", 510, 450, WC_GAME_OPTIONS, WC_NONE, 0, _nested_settings_selection_widgets, lengthof(_nested_settings_selection_widgets)) |
| static const NWidgetPart | _nested_cust_currency_widgets [] |
| static WindowDesc | _cust_currency_desc (WDP_CENTER, nullptr, 0, 0, WC_CUSTOM_CURRENCY, WC_NONE, 0, _nested_cust_currency_widgets, lengthof(_nested_cust_currency_widgets)) |
GUI for settings.
Definition in file settings_gui.cpp.
| enum RestrictionMode |
How the list of advanced settings is filtered.
Definition at line 620 of file settings_gui.cpp.
| enum SettingEntryFlags |
Flags for SettingEntry.
Definition at line 610 of file settings_gui.cpp.
| enum WarnHiddenResult |
Warnings about hidden search results.
Definition at line 1701 of file settings_gui.cpp.
| void DrawArrowButtons | ( | int | x, |
| int | y, | ||
| Colours | button_colour, | ||
| byte | 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 2331 of file settings_gui.cpp.
| void DrawBoolButton | ( | int | x, |
| int | y, | ||
| bool | state, | ||
| bool | clickable | ||
| ) |
Draw a toggle button.
| x | the x position to draw |
| y | the y position to draw |
| state | true = lowered |
| clickable | is the button clickable? |
Definition at line 2378 of file settings_gui.cpp.
| 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 2359 of file settings_gui.cpp.
|
static |
Get index of the current screen resolution.
Definition at line 77 of file settings_gui.cpp.
References _resolutions.
| void ShowBaseSetTextfileWindow | ( | TextfileType | file_type, |
| const TBaseSet * | baseset, | ||
| StringID | content_type | ||
| ) |
Open the BaseSet version of the textfile window.
| file_type | The type of textfile to display. |
| baseset | The BaseSet to use. |
| content_type | STR_CONTENT_TYPE_xxx for title. |
Definition at line 136 of file settings_gui.cpp.
References DeleteWindowById(), and WC_TEXTFILE.
|
static |
Definition at line 44 of file settings_gui.cpp.
|
static |
Definition at line 61 of file settings_gui.cpp.
|
static |
Definition at line 1691 of file settings_gui.cpp.
|
static |
Definition at line 53 of file settings_gui.cpp.