From c4f055cc1158a50b98db5f94ed4859619f37b37b Mon Sep 17 00:00:00 2001 From: alberth Date: Fri, 14 Aug 2009 19:02:20 +0000 Subject: [PATCH] (svn r17172) -Codechange: Move the _message_opt variable into the MessageOptionsWindow struct. --- src/news_gui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 4c73c72231..b0207ad610 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -938,9 +938,8 @@ enum NewsSettingsWidgets { WIDGET_NEWSOPT_START_OPTION, ///< First widget that is part of a group [<] .. [.] }; -static const StringID _message_opt[] = {STR_NEWS_MESSAGES_OFF, STR_NEWS_MESSAGES_SUMMARY, STR_NEWS_MESSAGES_FULL, INVALID_STRING_ID}; - 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. MessageOptionsWindow(const WindowDesc *desc) : Window(desc) @@ -980,13 +979,13 @@ struct MessageOptionsWindow : Window { { if (_news_ticker_sound) this->LowerWidget(WIDGET_NEWSOPT_SOUNDTICKER); - this->widget[WIDGET_NEWSOPT_DROP_SUMMARY].data = _message_opt[this->state]; + this->widget[WIDGET_NEWSOPT_DROP_SUMMARY].data = this->message_opt[this->state]; this->DrawWidgets(); /* Draw the string of each setting on each button. */ for (int i = 0; i < NT_END; i++) { DrawString(this->widget[WIDGET_NEWSOPT_START_OPTION + 1].left, this->widget[WIDGET_NEWSOPT_START_OPTION + 1].right, - this->widget[WIDGET_NEWSOPT_START_OPTION + NB_WIDG_PER_SETTING * i + 1].top + 1, _message_opt[_news_type_data[i].display], TC_BLACK, SA_CENTER); + this->widget[WIDGET_NEWSOPT_START_OPTION + NB_WIDG_PER_SETTING * i + 1].top + 1, this->message_opt[_news_type_data[i].display], TC_BLACK, SA_CENTER); } } @@ -994,7 +993,7 @@ struct MessageOptionsWindow : Window { { switch (widget) { case WIDGET_NEWSOPT_DROP_SUMMARY: // Dropdown menu for all settings - ShowDropDownMenu(this, _message_opt, this->state, WIDGET_NEWSOPT_DROP_SUMMARY, 0, 0); + ShowDropDownMenu(this, this->message_opt, this->state, WIDGET_NEWSOPT_DROP_SUMMARY, 0, 0); break; case WIDGET_NEWSOPT_SOUNDTICKER: // Change ticker sound on/off @@ -1030,6 +1029,7 @@ struct MessageOptionsWindow : Window { } }; +const StringID MessageOptionsWindow::message_opt[] = {STR_NEWS_MESSAGES_OFF, STR_NEWS_MESSAGES_SUMMARY, STR_NEWS_MESSAGES_FULL, INVALID_STRING_ID}; /* * The news settings window widgets