diff options
author | yexo <yexo@openttd.org> | 2009-12-15 00:33:44 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-12-15 00:33:44 +0000 |
commit | 619e70f94a459954b4ba1c6e41921d4d9813cb45 (patch) | |
tree | 038d0f7953941c7f6feac376af3718594499ab5e | |
parent | 3e6c530e1ea1139d18ebe31fa6e99460cdfbce6e (diff) | |
download | openttd-619e70f94a459954b4ba1c6e41921d4d9813cb45.tar.xz |
(svn r18507) -Change [FS#3340]: move the 'check online content' button from the AI list window to the AI configuration window
-rw-r--r-- | src/ai/ai_gui.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 8e90972ff..a46e81654 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -38,7 +38,6 @@ enum AIListWindowWidgets { AIL_WIDGET_INFO_BG, ///< Panel to draw some AI information on AIL_WIDGET_ACCEPT, ///< Accept button AIL_WIDGET_CANCEL, ///< Cancel button - AIL_WIDGET_CONTENT_DOWNLOAD, ///< Download content button }; /** @@ -170,16 +169,6 @@ struct AIListWindow : public Window { case AIL_WIDGET_CANCEL: delete this; break; - - case AIL_WIDGET_CONTENT_DOWNLOAD: - if (!_network_available) { - ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0); - } else { -#if defined(ENABLE_NETWORK) - ShowNetworkContentListWindow(NULL, CONTENT_TYPE_AI); -#endif - } - break; } } @@ -217,12 +206,11 @@ static const NWidgetPart _nested_ai_list_widgets[] = { EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE, AIL_WIDGET_INFO_BG), SetMinimalTextLines(8, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 0), EndContainer(), - NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), - NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_ACCEPT), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_LIST_ACCEPT, STR_AI_LIST_ACCEPT_TOOLTIP), - NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_CANCEL), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_LIST_CANCEL, STR_AI_LIST_CANCEL_TOOLTIP), - EndContainer(), - NWidget(NWID_HORIZONTAL), - NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_CONTENT_DOWNLOAD), SetMinimalSize(188, 12), SetResize(1, 0), SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT), + NWidget(NWID_HORIZONTAL), + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), + NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_ACCEPT), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_LIST_ACCEPT, STR_AI_LIST_ACCEPT_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_CANCEL), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_LIST_CANCEL, STR_AI_LIST_CANCEL_TOOLTIP), + EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; @@ -461,6 +449,7 @@ enum AIConfigWindowWidgets { AIC_WIDGET_CHANGE, ///< Select another AI button AIC_WIDGET_CONFIGURE, ///< Change AI settings button AIC_WIDGET_CLOSE, ///< Close window button + AIC_WIDGET_CONTENT_DOWNLOAD, ///< Download content button }; static const NWidgetPart _nested_ai_config_widgets[] = { @@ -487,7 +476,7 @@ static const NWidgetPart _nested_ai_config_widgets[] = { NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL), EndContainer(), - NWidget(NWID_SPACER), SetMinimalSize(0, 9), + NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CONTENT_DOWNLOAD), SetFill(1, 0), SetMinimalSize(279, 12), SetPadding(0, 5, 9, 5), SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT), EndContainer(), }; @@ -610,6 +599,16 @@ struct AIConfigWindow : public Window { case AIC_WIDGET_CLOSE: delete this; break; + + case AIC_WIDGET_CONTENT_DOWNLOAD: + if (!_network_available) { + ShowErrorMessage(STR_NETWORK_ERROR_NOTAVAILABLE, INVALID_STRING_ID, 0, 0); + } else { +#if defined(ENABLE_NETWORK) + ShowNetworkContentListWindow(NULL, CONTENT_TYPE_AI); +#endif + } + break; } } |