diff --git a/src/news_func.h b/src/news_func.h index f218db3..4e15e7f 100644 --- a/src/news_func.h +++ b/src/news_func.h @@ -58,9 +58,9 @@ void NewsLoop(); void InitNewsItemStructs(); extern const NewsItem *_statusbar_news_item; -extern bool _news_ticker_sound; +//TODO ER cleanup required: extern bool _news_ticker_sound; -extern NewsTypeData _news_type_data[]; +//TODO ER cleanup required: extern NewsTypeData _news_type_data[]; void DeleteInvalidEngineNews(); void DeleteVehicleNews(VehicleID vid, StringID news); diff --git a/src/news_gui.cpp b/src/news_gui.cpp index f01ba40..60a7efa 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -32,13 +32,14 @@ #include "core/geometry_func.hpp" #include "command_func.h" #include "company_base.h" +#include "settings_type.h" #include "widgets/news_widget.h" #include "table/strings.h" const NewsItem *_statusbar_news_item = NULL; -bool _news_ticker_sound; ///< Make a ticker sound when a news item is published. +// TODO ER cleanup required: bool _news_ticker_sound; ///< Make a ticker sound when a news item is published. static uint MIN_NEWS_AMOUNT = 30; ///< prefered minimum amount of news messages static uint _total_news = 0; ///< current number of news items @@ -222,23 +223,68 @@ const WindowDesc* GetNewsWindowLayout(NewsFlag flags) /** * Per-NewsType data */ +struct NewsTypeData { + const NewsType type; ///< Name + const byte age; ///< Maximum age of news items (in days) + const SoundFx sound; ///< Sound + + /** + * Construct this entry. + * @param type The type of this NewsTypeData. + * @param age The maximum age for these messages. + * @param sound The sound to play. + */ + NewsTypeData(NewsType type, byte age, SoundFx sound) : + type(type), + age(age), + sound(sound) + { + } + + NewsDisplay GetNewsDisplay() const + { + switch (this->type) { + case NT_ARRIVAL_COMPANY: return (NewsDisplay) _settings_client.news.arrival_player; + case NT_ARRIVAL_OTHER: return (NewsDisplay) _settings_client.news.arrival_other; + case NT_ACCIDENT: return (NewsDisplay) _settings_client.news.accident; + case NT_COMPANY_INFO: return (NewsDisplay) _settings_client.news.company_info; + case NT_INDUSTRY_OPEN: return (NewsDisplay) _settings_client.news.open; + case NT_INDUSTRY_CLOSE: return (NewsDisplay) _settings_client.news.close; + case NT_ECONOMY: return (NewsDisplay) _settings_client.news.economy; + case NT_INDUSTRY_COMPANY: return (NewsDisplay) _settings_client.news.production_player; + case NT_INDUSTRY_OTHER: return (NewsDisplay) _settings_client.news.production_other; + case NT_INDUSTRY_NOBODY: return (NewsDisplay) _settings_client.news.production_nobody; + case NT_ADVICE: return (NewsDisplay) _settings_client.news.advice; + case NT_NEW_VEHICLES: return (NewsDisplay) _settings_client.news.new_vehicles; + case NT_ACCEPTANCE: return (NewsDisplay) _settings_client.news.acceptance; + case NT_SUBSIDIES: return (NewsDisplay) _settings_client.news.subsidies; + case NT_GENERAL: return (NewsDisplay) _settings_client.news.general; + + default: NOT_REACHED(); + } + } +}; + +/** + * Per-NewsType data + */ NewsTypeData _news_type_data[] = { - /* name, age, sound, display, description */ - NewsTypeData("arrival_player", 60, SND_1D_APPLAUSE, ND_FULL, STR_NEWS_MESSAGE_TYPE_ARRIVAL_OF_FIRST_VEHICLE_OWN ), ///< NT_ARRIVAL_COMPANY - NewsTypeData("arrival_other", 60, SND_1D_APPLAUSE, ND_SUMMARY, STR_NEWS_MESSAGE_TYPE_ARRIVAL_OF_FIRST_VEHICLE_OTHER ), ///< NT_ARRIVAL_OTHER - NewsTypeData("accident", 90, SND_BEGIN, ND_FULL, STR_NEWS_MESSAGE_TYPE_ACCIDENTS_DISASTERS ), ///< NT_ACCIDENT - NewsTypeData("company_info", 60, SND_BEGIN, ND_FULL, STR_NEWS_MESSAGE_TYPE_COMPANY_INFORMATION ), ///< NT_COMPANY_INFO - NewsTypeData("open", 90, SND_BEGIN, ND_SUMMARY, STR_NEWS_MESSAGE_TYPE_INDUSTRY_OPEN ), ///< NT_INDUSTRY_OPEN - NewsTypeData("close", 90, SND_BEGIN, ND_SUMMARY, STR_NEWS_MESSAGE_TYPE_INDUSTRY_CLOSE ), ///< NT_INDUSTRY_CLOSE - NewsTypeData("economy", 30, SND_BEGIN, ND_FULL, STR_NEWS_MESSAGE_TYPE_ECONOMY_CHANGES ), ///< NT_ECONOMY - NewsTypeData("production_player", 30, SND_BEGIN, ND_SUMMARY, STR_NEWS_MESSAGE_TYPE_INDUSTRY_CHANGES_SERVED_BY_COMPANY ), ///< NT_INDUSTRY_COMPANY - NewsTypeData("production_other", 30, SND_BEGIN, ND_OFF, STR_NEWS_MESSAGE_TYPE_INDUSTRY_CHANGES_SERVED_BY_OTHER ), ///< NT_INDUSTRY_OTHER - NewsTypeData("production_nobody", 30, SND_BEGIN, ND_OFF, STR_NEWS_MESSAGE_TYPE_INDUSTRY_CHANGES_UNSERVED ), ///< NT_INDUSTRY_NOBODY - NewsTypeData("advice", 150, SND_BEGIN, ND_FULL, STR_NEWS_MESSAGE_TYPE_ADVICE_INFORMATION_ON_COMPANY ), ///< NT_ADVICE - NewsTypeData("new_vehicles", 30, SND_1E_OOOOH, ND_FULL, STR_NEWS_MESSAGE_TYPE_NEW_VEHICLES ), ///< NT_NEW_VEHICLES - NewsTypeData("acceptance", 90, SND_BEGIN, ND_FULL, STR_NEWS_MESSAGE_TYPE_CHANGES_OF_CARGO_ACCEPTANCE ), ///< NT_ACCEPTANCE - NewsTypeData("subsidies", 180, SND_BEGIN, ND_SUMMARY, STR_NEWS_MESSAGE_TYPE_SUBSIDIES ), ///< NT_SUBSIDIES - NewsTypeData("general", 60, SND_BEGIN, ND_FULL, STR_NEWS_MESSAGE_TYPE_GENERAL_INFORMATION ), ///< NT_GENERAL + /* type, age, sound, */ + NewsTypeData(NT_ARRIVAL_COMPANY, 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_COMPANY + NewsTypeData(NT_ARRIVAL_OTHER, 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_OTHER + NewsTypeData(NT_ACCIDENT, 90, SND_BEGIN ), ///< NT_ACCIDENT + NewsTypeData(NT_COMPANY_INFO, 60, SND_BEGIN ), ///< NT_COMPANY_INFO + NewsTypeData(NT_INDUSTRY_OPEN, 90, SND_BEGIN ), ///< NT_INDUSTRY_OPEN + NewsTypeData(NT_INDUSTRY_CLOSE, 90, SND_BEGIN ), ///< NT_INDUSTRY_CLOSE + NewsTypeData(NT_ECONOMY, 30, SND_BEGIN ), ///< NT_ECONOMY + NewsTypeData(NT_INDUSTRY_COMPANY, 30, SND_BEGIN ), ///< NT_INDUSTRY_COMPANY + NewsTypeData(NT_INDUSTRY_OTHER, 30, SND_BEGIN ), ///< NT_INDUSTRY_OTHER + NewsTypeData(NT_INDUSTRY_NOBODY, 30, SND_BEGIN ), ///< NT_INDUSTRY_NOBODY + NewsTypeData(NT_ADVICE, 150, SND_BEGIN ), ///< NT_ADVICE + NewsTypeData(NT_NEW_VEHICLES, 30, SND_1E_OOOOH ), ///< NT_NEW_VEHICLES + NewsTypeData(NT_ACCEPTANCE, 90, SND_BEGIN ), ///< NT_ACCEPTANCE + NewsTypeData(NT_SUBSIDIES, 180, SND_BEGIN ), ///< NT_SUBSIDIES + NewsTypeData(NT_GENERAL, 60, SND_BEGIN ), ///< NT_GENERAL }; assert_compile(lengthof(_news_type_data) == NT_END); @@ -526,7 +572,7 @@ static void ShowNewspaper(const NewsItem *ni) /** Show news item in the ticker */ static void ShowTicker(const NewsItem *ni) { - if (_news_ticker_sound) SndPlayFx(SND_16_MORSE); + if (_settings_client.news.sound_for_summarized_messages) SndPlayFx(SND_16_MORSE); _statusbar_news_item = ni; InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SHOW_TICKER); @@ -587,7 +633,7 @@ static void MoveToNextItem() /* check the date, don't show too old items */ if (_date - _news_type_data[type].age > ni->date) return; - switch (_news_type_data[type].display) { + switch (_news_type_data[type].GetNewsDisplay()) { default: NOT_REACHED(); case ND_OFF: // Off - show nothing only a small reminder in the status bar InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SHOW_REMINDER); @@ -1088,6 +1134,7 @@ void ShowMessageHistory() new MessageHistoryWindow(&_message_history_desc); } +// TODO ER Cleanup required struct MessageOptionsWindow : Window { static const StringID message_opt[]; ///< Message report options, 'off', 'summary', or 'full'. int state; ///< Option value for setting all categories at once. @@ -1097,11 +1144,11 @@ struct MessageOptionsWindow : Window { { this->InitNested(desc, WN_GAME_OPTIONS_MESSAGE_OPTION); /* Set up the initial disabled buttons in the case of 'off' or 'full' */ - NewsDisplay all_val = _news_type_data[0].display; + NewsDisplay all_val = _news_type_data[0].GetNewsDisplay(); for (int i = 0; i < NT_END; i++) { - this->SetMessageButtonStates(_news_type_data[i].display, i); + this->SetMessageButtonStates(_news_type_data[i].GetNewsDisplay(), i); /* If the value doesn't match the ALL-button value, set the ALL-button value to 'off' */ - if (_news_type_data[i].display != all_val) all_val = ND_OFF; + if (_news_type_data[i].GetNewsDisplay() != all_val) all_val = ND_OFF; } /* If all values are the same value, the ALL-button will take over this value */ this->state = all_val; @@ -1129,7 +1176,7 @@ struct MessageOptionsWindow : Window { if (widget >= WID_MO_START_OPTION && widget < WID_MO_END_OPTION && (widget - WID_MO_START_OPTION) % MOS_WIDG_PER_SETTING == 1) { /* Draw the string of each setting on each button. */ int i = (widget - WID_MO_START_OPTION) / MOS_WIDG_PER_SETTING; - DrawString(r.left, r.right, r.top + 2, this->message_opt[_news_type_data[i].display], TC_BLACK, SA_HOR_CENTER); + DrawString(r.left, r.right, r.top + 2, this->message_opt[_news_type_data[i].GetNewsDisplay()], TC_BLACK, SA_HOR_CENTER); } } @@ -1179,7 +1226,8 @@ struct MessageOptionsWindow : Window { this->GetWidget(WID_MO_DROP_SUMMARY)->widget_data = this->message_opt[this->state]; /* Update widget to reflect the value of the #_news_ticker_sound variable. */ - this->SetWidgetLoweredState(WID_MO_SOUNDTICKER, _news_ticker_sound); + // TODO ER Cleanup required: + this->SetWidgetLoweredState(WID_MO_SOUNDTICKER, _settings_client.news.sound_for_summarized_messages); } virtual void OnClick(Point pt, int widget, int click_count) @@ -1190,7 +1238,8 @@ struct MessageOptionsWindow : Window { break; case WID_MO_SOUNDTICKER: // Change ticker sound on/off - _news_ticker_sound ^= 1; + // TODO ER Cleanup required + _settings_client.news.sound_for_summarized_messages ^= 1; this->InvalidateData(); break; @@ -1198,10 +1247,10 @@ struct MessageOptionsWindow : Window { if (widget >= WID_MO_START_OPTION && widget < WID_MO_END_OPTION) { int wid = widget - WID_MO_START_OPTION; int element = wid / MOS_WIDG_PER_SETTING; - byte val = (_news_type_data[element].display + ((wid % MOS_WIDG_PER_SETTING) ? 1 : -1)) % 3; + byte val = (_news_type_data[element].GetNewsDisplay() + ((wid % MOS_WIDG_PER_SETTING) ? 1 : -1)) % 3; this->SetMessageButtonStates(val, element); - _news_type_data[element].display = (NewsDisplay)val; + // TODO ER cleanup required *_news_type_data[element].GetNewsDisplay() = (NewsDisplay)val; this->SetDirty(); } break; @@ -1215,7 +1264,7 @@ struct MessageOptionsWindow : Window { for (int i = 0; i < NT_END; i++) { this->SetMessageButtonStates(index, i); - _news_type_data[i].display = (NewsDisplay)index; + // TODO ER cleanup required: *_news_type_data[i].display = (NewsDisplay)index; } this->InvalidateData(); } @@ -1278,7 +1327,8 @@ static NWidgetBase *MakeDescriptionColumn(int *biggest_index) NWidgetHorizontal *hor = new NWidgetHorizontal; /* Descriptive text. */ - NWidgetLeaf *leaf = new NWidgetLeaf(WWT_TEXT, COLOUR_YELLOW, widnum + 3, _news_type_data[i].description, STR_NULL); + // TODO ER cleanup: + NWidgetLeaf *leaf = new NWidgetLeaf(WWT_TEXT, COLOUR_YELLOW, widnum + 3, STR_NULL, STR_NULL); hor->Add(leaf); /* Filling empty space to push text to the left. */ NWidgetSpacer *spacer = new NWidgetSpacer(0, 0); diff --git a/src/news_type.h b/src/news_type.h index 40b6e2c..7f3365d 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -106,32 +106,6 @@ enum NewsDisplay { ND_FULL, ///< Show newspaper }; -/** - * Per-NewsType data - */ -struct NewsTypeData { - const char * const name; ///< Name - const byte age; ///< Maximum age of news items (in days) - const SoundFx sound; ///< Sound - NewsDisplay display; ///< Display mode (off, summary, full) - const StringID description; ///< Description of the news type in news settings window - - /** - * Construct this entry. - * @param name The name of the type. - * @param age The maximum age for these messages. - * @param sound The sound to play. - * @param description The description for this type of messages. - */ - NewsTypeData(const char *name, byte age, SoundFx sound, NewsDisplay display, StringID description) : - name(name), - age(age), - sound(sound), - display(display), - description(description) - { - } -}; /** Information about a single item of news. */ struct NewsItem { diff --git a/src/settings.cpp b/src/settings.cpp index 8d98f8f..dd261bb 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1242,84 +1242,118 @@ static void HandleOldDiffCustom(bool savegame) } } -/** - * tries to convert newly introduced news settings based on old ones - * @param name pointer to the string defining name of the old news config - * @param value pointer to the string defining value of the old news config - * @returns true if conversion could have been made - */ -static bool ConvertOldNewsSetting(const char *name, const char *value) -{ - if (strcasecmp(name, "openclose") == 0) { - /* openclose has been split in "open" and "close". - * So the job is now to decrypt the value of the old news config - * and give it to the two newly introduced ones*/ - - NewsDisplay display = ND_OFF; // default - if (strcasecmp(value, "full") == 0) { - display = ND_FULL; - } else if (strcasecmp(value, "summarized") == 0) { - display = ND_SUMMARY; - } - /* tranfert of values */ - _news_type_data[NT_INDUSTRY_OPEN].display = display; - _news_type_data[NT_INDUSTRY_CLOSE].display = display; - return true; - } - return false; -} +// TODO ER cleanup required + +///** +// * tries to convert newly introduced news settings based on old ones +// * @param name pointer to the string defining name of the old news config +// * @param value pointer to the string defining value of the old news config +// * @returns true if conversion could have been made +// */ +//static bool ConvertOldNewsSetting(const char *name, const char *value) +//{ +// if (strcasecmp(name, "openclose") == 0) { +// /* openclose has been split in "open" and "close". +// * So the job is now to decrypt the value of the old news config +// * and give it to the two newly introduced ones*/ +// +// NewsDisplay display = ND_OFF; // default +// if (strcasecmp(value, "full") == 0) { +// display = ND_FULL; +// } else if (strcasecmp(value, "summarized") == 0) { +// display = ND_SUMMARY; +// } +// /* transfer values */ +// _settings_client.news.open = (uint8) display; +// _settings_client.news.close = (uint8) display; +// return true; +// } +// return false; +//} /** - * Load newstype settings from a configuration file. - * @param ini the configuration to read from. - * @param grpname Name of the group containing the news type settings. + * Tried to read the really old news settings variant having 'openclose' option in + * group 'news_display' and converts them into the new advanced configuration format. + * @param ini The configuration to read from. + * @param grpname The name of the group containing the news type settings. */ -static void NewsDisplayLoadConfig(IniFile *ini, const char *grpname) +static void ReadOldNewsSettingOpenClose(IniFile *ini, const char *grpname) { - - // TODO ER CLEANUP REQUIRED - IniGroup *group = ini->GetGroup(grpname); IniItem *item; - /* If no group exists, return */ if (group == NULL) return; for (item = group->item; item != NULL; item = item->next) { - int news_item = -1; - for (int i = 0; i < NT_END; i++) { - if (strcasecmp(item->name, _news_type_data[i].name) == 0) { - news_item = i; - break; + if (strcasecmp(item->name, "openclose") == 0) { + /* openclose has been split in "open" and "close". + * So the job is now to decrypt the value of the really old news config + * and give it to the two newly introduced ones*/ + NewsDisplay display = ND_OFF; // default + if (strcasecmp(item->value, "full") == 0) { + display = ND_FULL; + } else if (strcasecmp(item->value, "summarized") == 0) { + display = ND_SUMMARY; } - } - /* the config been read is not within current aceptable config */ - if (news_item == -1) { - /* if the conversion function cannot process it, advice by a debug warning*/ - if (!ConvertOldNewsSetting(item->name, item->value)) { - DEBUG(misc, 0, "Invalid display option: %s", item->name); - } - /* in all cases, there is nothing left to do */ - continue; - } - - if (StrEmpty(item->value)) { - DEBUG(misc, 0, "Empty display value for newstype %s", item->name); - continue; - } else if (strcasecmp(item->value, "full") == 0) { - _news_type_data[news_item].display = ND_FULL; - } else if (strcasecmp(item->value, "off") == 0) { - _news_type_data[news_item].display = ND_OFF; - } else if (strcasecmp(item->value, "summarized") == 0) { - _news_type_data[news_item].display = ND_SUMMARY; - } else { - DEBUG(misc, 0, "Invalid display value for newstype %s: %s", item->name, item->value); - continue; + /* transfer values */ + _settings_client.news.open = (uint8) display; + _settings_client.news.close = (uint8) display; } } } +///** +// * Load newstype settings from a configuration file. +// * @param ini the configuration to read from. +// * @param grpname Name of the group containing the news type settings. +// */ +//static void NewsDisplayLoadConfig(IniFile *ini, const char *grpname) +//{ +// +// // TODO ER CLEANUP REQUIRED +// +// IniGroup *group = ini->GetGroup(grpname); +// IniItem *item; +// +// /* If no group exists, return */ +// if (group == NULL) return; +// +// for (item = group->item; item != NULL; item = item->next) { +// int news_item = -1; +// for (int i = 0; i < NT_END; i++) { +// if (strcasecmp(item->name, _news_type_data[i].name) == 0) { +// news_item = i; +// break; +// } +// } +// +// /* the config been read is not within current aceptable config */ +// if (news_item == -1) { +// /* if the conversion function cannot process it, advice by a debug warning*/ +// if (!ConvertOldNewsSetting(item->name, item->value)) { +// DEBUG(misc, 0, "Invalid display option: %s", item->name); +// } +// /* in all cases, there is nothing left to do */ +// continue; +// } +// +// if (StrEmpty(item->value)) { +// DEBUG(misc, 0, "Empty display value for newstype %s", item->name); +// continue; +// } else if (strcasecmp(item->value, "full") == 0) { +// _news_type_data[news_item].display = ND_FULL; +// } else if (strcasecmp(item->value, "off") == 0) { +// _news_type_data[news_item].display = ND_OFF; +// } else if (strcasecmp(item->value, "summarized") == 0) { +// _news_type_data[news_item].display = ND_SUMMARY; +// } else { +// DEBUG(misc, 0, "Invalid display value for newstype %s: %s", item->name, item->value); +// continue; +// } +// } +//} + static void AILoadConfig(IniFile *ini, const char *grpname) { IniGroup *group = ini->GetGroup(grpname); @@ -1449,24 +1483,25 @@ static GRFConfig *GRFLoadConfig(IniFile *ini, const char *grpname, bool is_stati return first; } -/** - * Write newstype settings to a configuration file. - * @param ini The configuration to write to. - * @param grpname Name of the group containing the news type settings. - */ -static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname) -{ - IniGroup *group = ini->GetGroup(grpname); - - for (int i = 0; i < NT_END; i++) { - const char *value; - int v = _news_type_data[i].display; - - value = (v == ND_OFF ? "off" : (v == ND_SUMMARY ? "summarized" : "full")); - - group->GetItem(_news_type_data[i].name, true)->SetValue(value); - } -} +// TODO ER cleanup required - saving is done automatically with the rest of the advanced settings +///** +// * Write newstype settings to a configuration file. +// * @param ini The configuration to write to. +// * @param grpname Name of the group containing the news type settings. +// */ +//static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname) +//{ +// IniGroup *group = ini->GetGroup(grpname); +// +// for (int i = 0; i < NT_END; i++) { +// const char *value; +// int v = _news_type_data[i].display; +// +// value = (v == ND_OFF ? "off" : (v == ND_SUMMARY ? "summarized" : "full")); +// +// group->GetItem(_news_type_data[i].name, true)->SetValue(value); +// } +//} static void AISaveConfig(IniFile *ini, const char *grpname) { @@ -1564,6 +1599,9 @@ static void HandleSettingDescs(IniFile *ini, SettingDescProc *proc, SettingDescP proc(ini, _settings, "patches", &_settings_newgame); proc(ini, _currency_settings,"currency", &_custom_currency); proc(ini, _company_settings, "company", &_settings_client.company); + /* Try reading the old way "openclose" settings first, to ensure compatibility. + * Values due to compatibility may be overwritten by the newer options. */ + ReadOldNewsSettingOpenClose(ini, "news_display"); proc(ini, _news_settings, "news_display", NULL); #ifdef ENABLE_NETWORK @@ -1588,7 +1626,7 @@ static IniFile *IniLoadConfig() void LoadFromConfig(bool minimal) { IniFile *ini = IniLoadConfig(); - if (!minimal) ResetCurrencies(false); // Initialize the array of curencies, without preserving the custom one + if (!minimal) ResetCurrencies(false); // Initialize the array of currencies, without preserving the custom one /* Load basic settings only during bootstrap, load other settings not during bootstrap */ HandleSettingDescs(ini, IniLoadSettings, IniLoadSettingList, minimal, !minimal); @@ -1596,7 +1634,7 @@ void LoadFromConfig(bool minimal) if (!minimal) { _grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false); _grfconfig_static = GRFLoadConfig(ini, "newgrf-static", true); - NewsDisplayLoadConfig(ini, "news_display"); + // TODO ER cleanup NewsDisplayLoadConfig(ini, "news_display"); AILoadConfig(ini, "ai_players"); GameLoadConfig(ini, "game_scripts"); @@ -1606,7 +1644,7 @@ void LoadFromConfig(bool minimal) ValidateSettings(); - /* Display sheduled errors */ + /* Display scheduled errors */ extern void ScheduleErrorMessage(ErrorList &datas); ScheduleErrorMessage(_settings_error_list); if (FindWindowById(WC_ERRMSG, 0) == NULL) ShowFirstError(); @@ -1628,7 +1666,7 @@ void SaveToConfig() HandleSettingDescs(ini, IniSaveSettings, IniSaveSettingList); GRFSaveConfig(ini, "newgrf", _grfconfig_newgame); GRFSaveConfig(ini, "newgrf-static", _grfconfig_static); - NewsDisplaySaveConfig(ini, "news_display"); + // TODO ER CLEANUP: NewsDisplaySaveConfig(ini, "news_display"); AISaveConfig(ini, "ai_players"); GameSaveConfig(ini, "game_scripts"); SaveVersionInConfig(ini); diff --git a/src/table/misc_settings.ini b/src/table/misc_settings.ini index 919e964..78ed34f 100644 --- a/src/table/misc_settings.ini +++ b/src/table/misc_settings.ini @@ -42,10 +42,11 @@ var = _display_opt def = (1 << DO_SHOW_TOWN_NAMES | 1 << DO_SHOW_STATION_NAMES | 1 << DO_SHOW_SIGNS | 1 << DO_FULL_ANIMATION | 1 << DO_FULL_DETAIL | 1 << DO_SHOW_WAYPOINT_NAMES | 1 << DO_SHOW_COMPETITOR_SIGNS) full = ""SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION||FULL_DETAIL|WAYPOINTS|SHOW_COMPETITOR_SIGNS"" -[SDTG_BOOL] -name = ""news_ticker_sound"" -var = _news_ticker_sound -def = true +; TODO ER cleanup required +;[SDTG_BOOL] +;name = ""news_ticker_sound"" +;var = _news_ticker_sound +;def = true [SDTG_BOOL] name = ""fullscreen"" diff --git a/src/widgets/news_widget.h b/src/widgets/news_widget.h index 25c56e6..b345246 100644 --- a/src/widgets/news_widget.h +++ b/src/widgets/news_widget.h @@ -42,6 +42,7 @@ enum MessageHistoryWidgets { WID_MH_SCROLLBAR, ///< Scrollbar for the list. }; +// TODO ER cleanup required /** Widgets of the #MessageOptionsWindow class. */ enum MessageOptionWidgets { WID_MO_BACKGROUND, ///< Background of the window.