|
OpenTTD Source
1.10.0-RC1
|
Standard setting. More...
Public Member Functions | |
| SettingEntry (const char *name) | |
| Constructor for a single setting in the 'advanced settings' window. More... | |
| virtual void | Init (byte level=0) |
| Initialization of a setting entry. More... | |
| virtual uint | Length () const |
| Return number of rows needed to display the (filtered) entry. | |
| virtual uint | GetMaxHelpHeight (int maxw) |
| Get the biggest height of the help text(s), if the width is at least maxw. More... | |
| virtual bool | UpdateFilterState (SettingFilter &filter, bool force_visible) |
| Update the filter state. More... | |
| void | SetButtons (byte new_val) |
| Set the button-depressed flags (SEF_LEFT_DEPRESSED and SEF_RIGHT_DEPRESSED) to a specified value. More... | |
| StringID | GetHelpText () const |
| Get the help text of a single setting. More... | |
| void | SetValueDParams (uint first_param, int32 value) const |
| Set the DParams for drawing the value of a setting. More... | |
Public Member Functions inherited from BaseSettingEntry | |
| virtual void | FoldAll () |
| virtual void | UnFoldAll () |
| void | SetLastField (bool last_field) |
| Set whether this is the last visible entry of the parent node. More... | |
| virtual void | GetFoldingState (bool &all_folded, bool &all_unfolded) const |
| virtual bool | IsVisible (const BaseSettingEntry *item) const |
| Check whether an entry is visible and not folded or filtered away. More... | |
| virtual BaseSettingEntry * | FindEntry (uint row, uint *cur_row) |
| Find setting entry at row row_num. More... | |
| bool | IsFiltered () const |
| Check whether an entry is hidden due to filters. More... | |
| virtual uint | Draw (GameSettings *settings_ptr, int left, int right, int y, uint first_row, uint max_row, BaseSettingEntry *selected, uint cur_row=0, uint parent_last=0) const |
| Draw a row in the settings panel. More... | |
Data Fields | |
| const char * | name |
| Name of the setting. | |
| const SettingDesc * | setting |
| Setting description of the setting. | |
| uint | index |
| Index of the setting in the settings table. | |
Data Fields inherited from BaseSettingEntry | |
| byte | flags |
| Flags of the setting entry. More... | |
| byte | level |
| Nesting level of this setting entry. | |
Protected Member Functions | |
| virtual void | DrawSetting (GameSettings *settings_ptr, int left, int right, int y, bool highlight) const |
| Function to draw setting value (button + text + current value) More... | |
Private Member Functions | |
| bool | IsVisibleByRestrictionMode (RestrictionMode mode) const |
| Checks whether an entry shall be made visible based on the restriction mode. More... | |
Standard setting.
Definition at line 768 of file settings_gui.cpp.
| SettingEntry::SettingEntry | ( | const char * | name | ) |
Constructor for a single setting in the 'advanced settings' window.
| name | Name of the setting in the setting table |
Definition at line 959 of file settings_gui.cpp.
|
protectedvirtual |
Function to draw setting value (button + text + current value)
| settings_ptr | Pointer to current values of all settings |
| left | Left-most position in window/panel to start drawing |
| right | Right-most position in window/panel to draw |
| y | Upper-most position in window/panel to start drawing |
| highlight | Highlight entry. |
Implements BaseSettingEntry.
Definition at line 1133 of file settings_gui.cpp.
|
inline |
Get the help text of a single setting.
Definition at line 786 of file settings_gui.cpp.
References SettingDesc::desc, Window::left, and SettingDescBase::str_help.
|
virtual |
Get the biggest height of the help text(s), if the width is at least maxw.
Help text gets wrapped if needed.
| maxw | Maximal width of a line help text. |
Reimplemented from BaseSettingEntry.
Definition at line 999 of file settings_gui.cpp.
References GetStringHeight().
|
virtual |
Initialization of a setting entry.
| level | Page nesting level of this entry |
Reimplemented from BaseSettingEntry.
Definition at line 970 of file settings_gui.cpp.
References GetSettingFromName(), and BaseSettingEntry::Init().
|
private |
Checks whether an entry shall be made visible based on the restriction mode.
| mode | The current status of the restriction drop down box. |
Definition at line 1009 of file settings_gui.cpp.
References GetGameSettings(), RM_ADVANCED, RM_ALL, RM_BASIC, SC_ADVANCED_LIST, and SC_BASIC_LIST.
| void SettingEntry::SetButtons | ( | byte | new_val | ) |
Set the button-depressed flags (SEF_LEFT_DEPRESSED and SEF_RIGHT_DEPRESSED) to a specified value.
| new_val | New value for the button flags |
Definition at line 982 of file settings_gui.cpp.
Referenced by GameSettingsWindow::OnTimeout().
| void SettingEntry::SetValueDParams | ( | uint | first_param, |
| int32 | value | ||
| ) | const |
Set the DParams for drawing the value of a setting.
| first_param | First DParam to use |
| value | Setting value to set params for. |
Definition at line 1107 of file settings_gui.cpp.
References abs(), SettingDescBase::cmd, SettingDescBase::flags, SettingDescBase::min, SDT_BOOLX, SetDParam(), SGF_0ISDISABLED, SGF_DISPLAY_ABS, SGF_MULTISTRING, and SettingDescBase::str_val.
|
virtual |
Update the filter state.
| filter | Filter |
| force_visible | Whether to force all items visible, no matter what (due to filter text; not affected by restriction drop down box). |
Implements BaseSettingEntry.
Definition at line 1053 of file settings_gui.cpp.
References StringFilter::AddLine(), CLRBITS, SettingDesc::desc, Window::flags, StringFilter::GetState(), SettingDesc::GetType(), StringFilter::IsEmpty(), SettingFilter::min_cat, SettingFilter::mode, StringFilter::ResetState(), RM_ALL, SEF_FILTERED, SETBITS, SetDParam(), ST_ALL, SettingDescBase::str, SettingFilter::string, SettingFilter::type, and SettingFilter::type_hides.