@@ -1968,25 +1968,25 @@ struct GameSettingsWindow : QueryStringB
SettingEntry *clicked_entry; ///< If non-NULL, pointer to a clicked numeric setting (with a depressed left or right button).
SettingEntry *last_clicked; ///< If non-NULL, pointer to the last clicked setting.
SettingEntry *valuedropdown_entry; ///< If non-NULL, pointer to the value for which a dropdown window is currently opened.
bool closing_dropdown; ///< True, if the dropdown list is currently closing.
StringFilter string_filter; ///< Text filter for settings.
bool manually_changed_folding; ///< Whether the user expanded/collapsed something manually.
RestrictionMode cur_restriction_mode; ///< Currently selected index of the drop down list for the restrict drop down.
Scrollbar *vscroll;
GameSettingsWindow(const WindowDesc *desc) : QueryStringBaseWindow(50), cur_restriction_mode(RM_BASIC)
GameSettingsWindow(const WindowDesc *desc) : QueryStringBaseWindow(50), cur_restriction_mode((RestrictionMode)_settings_client.gui.settings_restriction_mode)
{
static bool first_time = true;
settings_ptr = &GetGameSettings();
/* Build up the dynamic settings-array only once per OpenTTD session */
if (first_time) {
_settings_main_page.Init();
first_time = false;
} else {
_settings_main_page.FoldAll(); // Close all sub-pages
}
@@ -2328,31 +2328,36 @@ struct GameSettingsWindow : QueryStringB
if ((sd->desc.flags & SGF_PER_COMPANY) != 0) {
SetCompanySetting(this->valuewindow_entry->d.entry.index, value);
SetSettingValue(this->valuewindow_entry->d.entry.index, value);
this->SetDirty();
virtual void OnDropdownSelect(int widget, int index)
if (widget == WID_GS_RESTRICT_DROPDOWN) {
this->cur_restriction_mode = (RestrictionMode)index;
if (!this->manually_changed_folding &&
(this->cur_restriction_mode == RM_CHANGED_AGAINST_DEFAULT ||
if (this->cur_restriction_mode == RM_CHANGED_AGAINST_DEFAULT ||
this->cur_restriction_mode == RM_CHANGED_AGAINST_DEFAULT_WO_LOCAL ||
this->cur_restriction_mode == RM_CHANGED_AGAINST_NEW)) {
/* Expand all when selecting 'changes'. Update the filter state first, in case it becomes less restrictive in some cases. */
_settings_main_page.UpdateFilterState(string_filter, false, this->cur_restriction_mode);
_settings_main_page.UnFoldAll();
this->cur_restriction_mode == RM_CHANGED_AGAINST_NEW) {
if (!this->manually_changed_folding) {
/* Non-'changes' filter. Save as default. */
_settings_client.gui.settings_restriction_mode = this->cur_restriction_mode;
this->InvalidateData();
return;
/* Deal with drop down boxes on the panel. */
assert(this->valuedropdown_entry != NULL);
const SettingDesc *sd = this->valuedropdown_entry->d.entry.setting;
assert(sd->desc.flags & SGF_MULTISTRING);
SetCompanySetting(this->valuedropdown_entry->d.entry.index, index);
@@ -122,24 +122,25 @@ struct GUISettings {
uint16 console_backlog_length; ///< the minimum amount of items in the console backlog before items will be removed.
#ifdef ENABLE_NETWORK
uint16 network_chat_box_width; ///< width of the chat box in pixels
uint8 network_chat_box_height; ///< height of the chat box in lines
uint16 network_chat_timeout; ///< timeout of chat messages in seconds
#endif
uint8 developer; ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2)
bool show_date_in_logs; ///< whether to show dates in console logs
bool newgrf_developer_tools; ///< activate NewGRF developer tools and allow modifying NewGRFs in an existing game
bool ai_developer_tools; ///< activate AI developer tools
bool scenario_developer; ///< activate scenario developer: allow modifying NewGRFs in an existing game
uint8 settings_restriction_mode; ///< selected restriction mode in adv. settings GUI. @see RestrictionMode
bool newgrf_show_old_versions; ///< whether to show old versions in the NewGRF list
uint8 newgrf_default_palette; ///< default palette to use for NewGRFs without action 14 palette information
/**
* Returns true when the user has sufficient privileges to edit newgrfs on a running game
* @return whether the user has sufficient privileges to edit newgrfs in an existing game
*/
bool UserIsAllowedToChangeNewGRFs() const
return this->scenario_developer || this->newgrf_developer_tools;
};
@@ -2806,24 +2806,32 @@ proc = RedrawScreen
ifdef = DEDICATED
var = gui.show_date_in_logs
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
def = true
[SDTC_BOOL]
ifndef = DEDICATED
def = false
[SDTC_VAR]
var = gui.settings_restriction_mode
type = SLE_UINT8
def = 0
min = 0
max = 2
var = gui.developer
def = 1
cat = SC_EXPERT
var = gui.newgrf_developer_tools
Status change: