Public Member Functions | |
SettingEntry (const char *nm) | |
Constructor for a single setting in the 'advanced settings' window. | |
SettingEntry (SettingsPage *sub, StringID title) | |
Constructor for a sub-page in the 'advanced settings' window. | |
void | Init (byte level, bool last_field) |
Initialization of a setting entry. | |
void | FoldAll () |
Recursively close all folds of sub-pages. | |
void | SetButtons (byte new_val) |
Set the button-depressed flags (SEF_LEFT_DEPRESSED and SEF_RIGHT_DEPRESSED) to a specified value. | |
uint | Length () const |
Return numbers of rows needed to display the entry. | |
SettingEntry * | FindEntry (uint row, uint *cur_row) |
Find setting entry at row row_num. | |
uint | Draw (GameSettings *settings_ptr, int base_x, int base_y, uint first_row, uint max_row, uint cur_row, uint parent_last) |
Draw a row in the settings panel. | |
Data Fields | |
byte | flags |
Flags of the setting entry. | |
byte | level |
Nesting level of this setting entry. | |
union { | |
SettingEntrySetting entry | |
Data fields if entry is a setting. | |
SettingEntrySubtree sub | |
Data fields if entry is a sub-page. | |
} | d |
Data fields for each kind. | |
Private Member Functions | |
void | DrawSetting (GameSettings *settings_ptr, const SettingDesc *sd, int x, int y, int state) |
Private function to draw setting value (button + text + current value). |
Definition at line 633 of file settings_gui.cpp.
SettingEntry::SettingEntry | ( | const char * | nm | ) |
Constructor for a single setting in the 'advanced settings' window.
nm | Name of the setting in the setting table |
Definition at line 678 of file settings_gui.cpp.
References d, flags, level, and SEF_SETTING_KIND.
SettingEntry::SettingEntry | ( | SettingsPage * | sub, | |
StringID | title | |||
) |
Constructor for a sub-page in the 'advanced settings' window.
sub | Sub-page | |
title | Title of the sub-page |
Definition at line 692 of file settings_gui.cpp.
References d, flags, level, and SEF_SUBTREE_KIND.
void SettingEntry::Init | ( | byte | level, | |
bool | last_field | |||
) |
Initialization of a setting entry.
level | Page nesting level of this entry | |
last_field | Boolean indicating this entry is the last at the (sub-)page |
Definition at line 706 of file settings_gui.cpp.
References d, flags, GetSettingFromName(), SEF_KIND_MASK, SEF_LAST_FIELD, SEF_SETTING_KIND, and SEF_SUBTREE_KIND.
Referenced by SettingsPage::Init().
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 745 of file settings_gui.cpp.
References flags, and SEF_BUTTONS_MASK.
SettingEntry * SettingEntry::FindEntry | ( | uint | row_num, | |
uint * | cur_row | |||
) |
Find setting entry at row row_num.
row_num | Index of entry to return | |
cur_row | Current row number |
NULL
if it not found Definition at line 771 of file settings_gui.cpp.
References d, flags, SEF_KIND_MASK, SEF_SETTING_KIND, and SEF_SUBTREE_KIND.
Referenced by SettingsPage::FindEntry().
uint SettingEntry::Draw | ( | GameSettings * | settings_ptr, | |
int | base_x, | |||
int | base_y, | |||
uint | first_row, | |||
uint | max_row, | |||
uint | cur_row, | |||
uint | parent_last | |||
) |
Draw a row in the settings panel.
See SettingsPage::Draw() for an explanation about how drawing is performed.
The parent_last parameter ensures that the vertical lines at the left are only drawn when another entry follows, that it prevents output like
* |-- setting * |-- (-) - Title * | |-- setting * | |-- setting *
settings_ptr | Pointer to current values of all settings | |
base_x | Left-most position in window/panel to start drawing first_row | |
base_y | Upper-most position in window/panel to start drawing first_row | |
first_row | First row number to draw | |
max_row | Row-number to stop drawing (the row-number of the row below the last row to draw) | |
cur_row | Current row number (internal variable) | |
parent_last | Last-field booleans of parent page level (page level i sets bit i to 1 if it is its last field) |
Definition at line 817 of file settings_gui.cpp.
References _colour_gradient, d, DrawSetting(), DrawSprite(), DrawString(), flags, HasBit(), level, SEF_BUTTONS_MASK, SEF_KIND_MASK, SEF_LAST_FIELD, SEF_SETTING_KIND, SEF_SUBTREE_KIND, and SetBit().
Referenced by SettingsPage::Draw().
void SettingEntry::DrawSetting | ( | GameSettings * | settings_ptr, | |
const SettingDesc * | sd, | |||
int | x, | |||
int | y, | |||
int | state | |||
) | [private] |
Private function to draw setting value (button + text + current value).
settings_ptr | Pointer to current values of all settings | |
sd | Pointer to value description of setting to draw | |
x | Left-most position in window/panel to start drawing | |
y | Upper-most position in window/panel to start drawing | |
state | State of the left + right arrow buttons to draw for the setting |
Definition at line 876 of file settings_gui.cpp.
References _networking, DrawArrowButtons(), DrawFrameRect(), DrawString(), FR_LOWERED, GetVariableAddress(), ReadValue(), SDT_BOOLX, SGF_0ISDISABLED, SGF_CURRENCY, SGF_MULTISTRING, SGF_NETWORK_ONLY, SGF_NO_NETWORK, SGF_NOCOMMA, and SLF_NETWORK_NO.
Referenced by Draw().
byte SettingEntry::flags |
Flags of the setting entry.
Definition at line 634 of file settings_gui.cpp.
Referenced by Draw(), FindEntry(), FoldAll(), Init(), Length(), SetButtons(), and SettingEntry().