diff --git a/src/lang/english.txt b/src/lang/english.txt index 2990575..02c926e 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -437,9 +437,10 @@ STR_TOOLBAR_SOUND_MUSIC :Sound/music ############ range for message menu starts STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT :Last message/news report -STR_NEWS_MENU_MESSAGE_SETTINGS :Message settings STR_NEWS_MENU_MESSAGE_HISTORY_MENU :Message history ############ range ends here +### Obsolete - no longer used +STR_NEWS_MENU_MESSAGE_SETTINGS :Message settings ############ range for about menu starts STR_ABOUT_MENU_LAND_BLOCK_INFO :Land area information diff --git a/src/news_func.h b/src/news_func.h index 4e15e7f..cd0862f 100644 --- a/src/news_func.h +++ b/src/news_func.h @@ -58,9 +58,6 @@ void NewsLoop(); void InitNewsItemStructs(); extern const NewsItem *_statusbar_news_item; -//TODO ER cleanup required: extern bool _news_ticker_sound; - -//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 d0b0c7e..85672c1 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -39,7 +39,6 @@ #include "table/strings.h" const NewsItem *_statusbar_news_item = NULL; -// 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 @@ -1134,273 +1133,3 @@ 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. - Dimension dim_message_opt; ///< Amount of space needed for a label such that all labels will fit. - - MessageOptionsWindow(const WindowDesc *desc) : 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].GetNewsDisplay(); - for (int i = 0; i < NT_END; 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].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; - this->OnInvalidateData(0); - } - - /** - * Setup the disabled/enabled buttons in the message window - * If the value is 'off' disable the [<] widget, and enable the [>] one - * Same-wise for all the others. Starting value of 4 is the first widget - * group. These are grouped as [<][>] .. [<][>], etc. - * @param value to set in the widget - * @param element index of the group of widget to set - */ - void SetMessageButtonStates(byte value, int element) - { - element *= MOS_WIDG_PER_SETTING; - - this->SetWidgetDisabledState(element + WID_MO_START_OPTION, value == 0); - this->SetWidgetDisabledState(element + WID_MO_START_OPTION + 2, value == 2); - } - - virtual void DrawWidget(const Rect &r, int widget) const - { - 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].GetNewsDisplay()], TC_BLACK, SA_HOR_CENTER); - } - } - - virtual void OnInit() - { - this->dim_message_opt.width = 0; - this->dim_message_opt.height = 0; - for (const StringID *str = message_opt; *str != INVALID_STRING_ID; str++) this->dim_message_opt = maxdim(this->dim_message_opt, GetStringBoundingBox(*str)); - } - - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) - { - if (widget >= WID_MO_START_OPTION && widget < WID_MO_END_OPTION) { - /* Height is the biggest widget height in a row. */ - size->height = FONT_HEIGHT_NORMAL + max(WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, WD_IMGBTN_TOP + WD_IMGBTN_BOTTOM); - - /* Compute width for the label widget only. */ - if ((widget - WID_MO_START_OPTION) % MOS_WIDG_PER_SETTING == 1) { - size->width = this->dim_message_opt.width + padding.width + MOS_BUTTON_SPACE; // A bit extra for better looks. - } - return; - } - - /* Size computations for global message options. */ - if (widget == WID_MO_DROP_SUMMARY || widget == WID_MO_LABEL_SUMMARY || widget == WID_MO_SOUNDTICKER || widget == WID_MO_SOUNDTICKER_LABEL) { - /* Height is the biggest widget height in a row. */ - size->height = FONT_HEIGHT_NORMAL + max(WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM); - - if (widget == WID_MO_DROP_SUMMARY) { - size->width = this->dim_message_opt.width + padding.width + MOS_BUTTON_SPACE; // A bit extra for better looks. - } else if (widget == WID_MO_SOUNDTICKER) { - size->width += MOS_BUTTON_SPACE; // A bit extra for better looks. - } - return; - } - } - - /** - * Some data on this window has become invalid. - * @param data Information about the changed data. - * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. - */ - virtual void OnInvalidateData(int data = 0, bool gui_scope = true) - { - if (!gui_scope) return; - /* Update the dropdown value for 'set all categories'. */ - 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. */ - // 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) - { - switch (widget) { - case WID_MO_DROP_SUMMARY: // Dropdown menu for all settings - ShowDropDownMenu(this, this->message_opt, this->state, WID_MO_DROP_SUMMARY, 0, 0); - break; - - case WID_MO_SOUNDTICKER: // Change ticker sound on/off - // TODO ER Cleanup required - _settings_client.news.sound_for_summarized_messages ^= 1; - this->InvalidateData(); - break; - - default: { // Clicked on the [<] .. [>] widgets - 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].GetNewsDisplay() + ((wid % MOS_WIDG_PER_SETTING) ? 1 : -1)) % 3; - - this->SetMessageButtonStates(val, element); - // TODO ER cleanup required *_news_type_data[element].GetNewsDisplay() = (NewsDisplay)val; - this->SetDirty(); - } - break; - } - } - } - - virtual void OnDropdownSelect(int widget, int index) - { - this->state = index; - - for (int i = 0; i < NT_END; i++) { - this->SetMessageButtonStates(index, i); - // TODO ER cleanup required: *_news_type_data[i].display = (NewsDisplay)index; - } - this->InvalidateData(); - } -}; - -const StringID MessageOptionsWindow::message_opt[] = {STR_NEWS_MESSAGES_OFF, STR_NEWS_MESSAGES_SUMMARY, STR_NEWS_MESSAGES_FULL, INVALID_STRING_ID}; - -/** Make a column with the buttons for changing each news category setting, and the global settings. */ -static NWidgetBase *MakeButtonsColumn(int *biggest_index) -{ - NWidgetVertical *vert_buttons = new NWidgetVertical; - - /* Top-part of the column, one row for each new category. */ - int widnum = WID_MO_START_OPTION; - for (int i = 0; i < NT_END; i++) { - NWidgetHorizontal *hor = new NWidgetHorizontal; - /* [<] button. */ - NWidgetLeaf *leaf = new NWidgetLeaf(WWT_PUSHARROWBTN, COLOUR_YELLOW, widnum, AWV_DECREASE, STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST); - leaf->SetFill(1, 1); - hor->Add(leaf); - /* Label. */ - leaf = new NWidgetLeaf(WWT_PUSHTXTBTN, COLOUR_YELLOW, widnum + 1, STR_EMPTY, STR_NULL); - leaf->SetFill(1, 1); - hor->Add(leaf); - /* [>] button. */ - leaf = new NWidgetLeaf(WWT_PUSHARROWBTN, COLOUR_YELLOW, widnum + 2, AWV_INCREASE, STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST); - leaf->SetFill(1, 1); - hor->Add(leaf); - vert_buttons->Add(hor); - - widnum += MOS_WIDG_PER_SETTING; - } - *biggest_index = widnum - MOS_WIDG_PER_SETTING + 2; - - /* Space between the category buttons and the global settings buttons. */ - NWidgetSpacer *spacer = new NWidgetSpacer(0, MOS_ABOVE_GLOBAL_SETTINGS); - vert_buttons->Add(spacer); - - /* Bottom part of the column with buttons for global changes. */ - NWidgetLeaf *leaf = new NWidgetLeaf(WWT_DROPDOWN, COLOUR_YELLOW, WID_MO_DROP_SUMMARY, STR_EMPTY, STR_NULL); - leaf->SetFill(1, 1); - vert_buttons->Add(leaf); - - leaf = new NWidgetLeaf(WWT_TEXTBTN_2, COLOUR_YELLOW, WID_MO_SOUNDTICKER, STR_STATION_BUILD_COVERAGE_OFF, STR_NULL); - leaf->SetFill(1, 1); - vert_buttons->Add(leaf); - - *biggest_index = max(*biggest_index, max(WID_MO_DROP_SUMMARY, WID_MO_SOUNDTICKER)); - return vert_buttons; -} - -/** Make a column with descriptions for each news category and the global settings. */ -static NWidgetBase *MakeDescriptionColumn(int *biggest_index) -{ - NWidgetVertical *vert_desc = new NWidgetVertical; - - /* Top-part of the column, one row for each new category. */ - int widnum = WID_MO_START_OPTION; - for (int i = 0; i < NT_END; i++) { - NWidgetHorizontal *hor = new NWidgetHorizontal; - - /* Descriptive text. */ - // 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); - spacer->SetFill(1, 0); - hor->Add(spacer); - vert_desc->Add(hor); - - widnum += MOS_WIDG_PER_SETTING; - } - *biggest_index = widnum - MOS_WIDG_PER_SETTING + 3; - - /* Space between the category descriptions and the global settings descriptions. */ - NWidgetSpacer *spacer = new NWidgetSpacer(0, MOS_ABOVE_GLOBAL_SETTINGS); - vert_desc->Add(spacer); - - /* Bottom part of the column with descriptions of global changes. */ - NWidgetHorizontal *hor = new NWidgetHorizontal; - NWidgetLeaf *leaf = new NWidgetLeaf(WWT_TEXT, COLOUR_YELLOW, WID_MO_LABEL_SUMMARY, STR_NEWS_MESSAGES_ALL, STR_NULL); - hor->Add(leaf); - /* Filling empty space to push text to the left. */ - spacer = new NWidgetSpacer(0, 0); - spacer->SetFill(1, 0); - hor->Add(spacer); - vert_desc->Add(hor); - - hor = new NWidgetHorizontal; - leaf = new NWidgetLeaf(WWT_TEXT, COLOUR_YELLOW, WID_MO_SOUNDTICKER_LABEL, STR_NEWS_MESSAGES_SOUND, STR_NULL); - hor->Add(leaf); - /* Filling empty space to push text to the left. */ - spacer = new NWidgetSpacer(0, 0); - leaf->SetFill(1, 0); - hor->Add(spacer); - vert_desc->Add(hor); - - *biggest_index = max(*biggest_index, max(WID_MO_LABEL_SUMMARY, WID_MO_SOUNDTICKER_LABEL)); - return vert_desc; -} - -static const NWidgetPart _nested_message_options_widgets[] = { - NWidget(NWID_HORIZONTAL), - NWidget(WWT_CLOSEBOX, COLOUR_BROWN), - NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_NEWS_MESSAGE_OPTIONS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - EndContainer(), - NWidget(WWT_PANEL, COLOUR_BROWN, WID_MO_BACKGROUND), - NWidget(NWID_HORIZONTAL), - NWidget(NWID_SPACER), SetFill(1, 0), - NWidget(WWT_LABEL, COLOUR_BROWN, WID_MO_LABEL), SetMinimalSize(0, 14), SetDataTip(STR_NEWS_MESSAGE_TYPES, STR_NULL), - NWidget(NWID_SPACER), SetFill(1, 0), - EndContainer(), - NWidget(NWID_HORIZONTAL), - NWidget(NWID_SPACER), SetMinimalSize(MOS_LEFT_EDGE, 0), - NWidgetFunction(MakeButtonsColumn), - NWidget(NWID_SPACER), SetMinimalSize(MOS_COLUMN_SPACING, 0), - NWidgetFunction(MakeDescriptionColumn), - NWidget(NWID_SPACER), SetMinimalSize(MOS_RIGHT_EDGE, 0), - EndContainer(), - NWidget(NWID_SPACER), SetMinimalSize(0, MOS_BOTTOM_EDGE), - EndContainer(), -}; - -static const WindowDesc _message_options_desc( - WDP_AUTO, 0, 0, - WC_GAME_OPTIONS, WC_NONE, - WDF_UNCLICK_BUTTONS, - _nested_message_options_widgets, lengthof(_nested_message_options_widgets) -); - -/** - * Show the settings window for news messages. - */ -void ShowMessageOptions() -{ - DeleteWindowByClass(WC_GAME_OPTIONS); - new MessageOptionsWindow(&_message_options_desc); -} diff --git a/src/news_gui.h b/src/news_gui.h index 3029d43..f0b28a7 100644 --- a/src/news_gui.h +++ b/src/news_gui.h @@ -13,7 +13,6 @@ #define NEWS_GUI_H void ShowLastNewsMessage(); -void ShowMessageOptions(); void ShowMessageHistory(); #endif /* NEWS_GUI_H */ diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq index 2b68e71..dd37c52 100644 --- a/src/script/api/game/game_window.hpp.sq +++ b/src/script/api/game/game_window.hpp.sq @@ -806,14 +806,6 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MH_STICKYBOX, "WID_MH_STICKYBOX"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MH_BACKGROUND, "WID_MH_BACKGROUND"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MH_SCROLLBAR, "WID_MH_SCROLLBAR"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_BACKGROUND, "WID_MO_BACKGROUND"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_LABEL, "WID_MO_LABEL"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_DROP_SUMMARY, "WID_MO_DROP_SUMMARY"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_LABEL_SUMMARY, "WID_MO_LABEL_SUMMARY"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_SOUNDTICKER, "WID_MO_SOUNDTICKER"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_SOUNDTICKER_LABEL, "WID_MO_SOUNDTICKER_LABEL"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_START_OPTION, "WID_MO_START_OPTION"); - SQGSWindow.DefSQConst(engine, ScriptWindow::WID_MO_END_OPTION, "WID_MO_END_OPTION"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_BO_CLASS_LIST, "WID_BO_CLASS_LIST"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_BO_SCROLLBAR, "WID_BO_SCROLLBAR"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_BO_OBJECT_MATRIX, "WID_BO_OBJECT_MATRIX"); diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp index 9d3c6c5..040230b 100644 --- a/src/script/api/script_window.hpp +++ b/src/script/api/script_window.hpp @@ -1835,19 +1835,6 @@ public: WID_MH_SCROLLBAR = ::WID_MH_SCROLLBAR, ///< Scrollbar for the list. }; - /** Widgets of the #MessageOptionsWindow class. */ - enum MessageOptionWidgets { - WID_MO_BACKGROUND = ::WID_MO_BACKGROUND, ///< Background of the window. - WID_MO_LABEL = ::WID_MO_LABEL, ///< Top label. - WID_MO_DROP_SUMMARY = ::WID_MO_DROP_SUMMARY, ///< Dropdown that adjusts at once the level for all settings. - WID_MO_LABEL_SUMMARY = ::WID_MO_LABEL_SUMMARY, ///< Label of the summary drop down. - WID_MO_SOUNDTICKER = ::WID_MO_SOUNDTICKER, ///< Button for (de)activating sound on events. - WID_MO_SOUNDTICKER_LABEL = ::WID_MO_SOUNDTICKER_LABEL, ///< Label of the soundticker button. - - WID_MO_START_OPTION = ::WID_MO_START_OPTION, ///< First widget that is part of a group [<][label][>] [description]. - WID_MO_END_OPTION = ::WID_MO_END_OPTION, ///< First widget after the groups. - }; - /* automatically generated from ../../widgets/object_widget.h */ /** Widgets of the #BuildObjectWindow class. */ enum BuildObjectWidgets { diff --git a/src/script/api/template/template_window.hpp.sq b/src/script/api/template/template_window.hpp.sq index 8fdca83..801fbfc 100644 --- a/src/script/api/template/template_window.hpp.sq +++ b/src/script/api/template/template_window.hpp.sq @@ -165,8 +165,6 @@ namespace SQConvert { template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::NewsWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptWindow::MessageHistoryWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::MessageHistoryWidgets)tmp; } template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::MessageHistoryWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } - template <> inline ScriptWindow::MessageOptionWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::MessageOptionWidgets)tmp; } - template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::MessageOptionWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptWindow::BuildObjectWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::BuildObjectWidgets)tmp; } template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::BuildObjectWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptWindow::OrderWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::OrderWidgets)tmp; } diff --git a/src/settings.cpp b/src/settings.cpp index 0c0d615..f535af9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1299,35 +1299,6 @@ static void HandleOldDiffCustom(bool savegame) } } -// 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; -//} - /** * 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. @@ -1360,57 +1331,6 @@ static void ReadOldNewsSettingOpenClose(IniFile *ini, const char *grpname) } } -///** -// * 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); @@ -1540,26 +1460,6 @@ static GRFConfig *GRFLoadConfig(IniFile *ini, const char *grpname, bool is_stati return first; } -// 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) { IniGroup *group = ini->GetGroup(grpname); @@ -1691,7 +1591,6 @@ void LoadFromConfig(bool minimal) if (!minimal) { _grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false); _grfconfig_static = GRFLoadConfig(ini, "newgrf-static", true); - // TODO ER cleanup NewsDisplayLoadConfig(ini, "news_display"); AILoadConfig(ini, "ai_players"); GameLoadConfig(ini, "game_scripts"); @@ -1723,7 +1622,6 @@ void SaveToConfig() HandleSettingDescs(ini, IniSaveSettings, IniSaveSettingList); GRFSaveConfig(ini, "newgrf", _grfconfig_newgame); GRFSaveConfig(ini, "newgrf-static", _grfconfig_static); - // 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 78ed34f..6d9e7bb 100644 --- a/src/table/misc_settings.ini +++ b/src/table/misc_settings.ini @@ -42,12 +42,6 @@ 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"" -; TODO ER cleanup required -;[SDTG_BOOL] -;name = ""news_ticker_sound"" -;var = _news_ticker_sound -;def = true - [SDTG_BOOL] name = ""fullscreen"" var = _fullscreen diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 31613f2..3b28434 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -914,7 +914,7 @@ static CallBackFunction MenuClickMusicWindow(int index) static CallBackFunction ToolbarNewspaperClick(Window *w) { - PopupMainToolbMenu(w, WID_TN_MESSAGES, STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT, 3); + PopupMainToolbMenu(w, WID_TN_MESSAGES, STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT, 2); return CBF_NONE; } @@ -928,8 +928,7 @@ static CallBackFunction MenuClickNewspaper(int index) { switch (index) { case 0: ShowLastNewsMessage(); break; - case 1: ShowMessageOptions(); break; - case 2: ShowMessageHistory(); break; + case 1: ShowMessageHistory(); break; } return CBF_NONE; } diff --git a/src/widgets/news_widget.h b/src/widgets/news_widget.h index b345246..f127866 100644 --- a/src/widgets/news_widget.h +++ b/src/widgets/news_widget.h @@ -42,18 +42,4 @@ 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. - WID_MO_LABEL, ///< Top label. - WID_MO_DROP_SUMMARY, ///< Dropdown that adjusts at once the level for all settings. - WID_MO_LABEL_SUMMARY, ///< Label of the summary drop down. - WID_MO_SOUNDTICKER, ///< Button for (de)activating sound on events. - WID_MO_SOUNDTICKER_LABEL, ///< Label of the soundticker button. - - WID_MO_START_OPTION, ///< First widget that is part of a group [<][label][>] [description]. - WID_MO_END_OPTION = WID_MO_START_OPTION + NT_END * MOS_WIDG_PER_SETTING, ///< First widget after the groups. -}; - #endif /* WIDGETS_NEWS_WIDGET_H */