Mercurial > hg > openttd
changeset 13969:93cebbb864df draft
(svn r18507) -Change [FS#3340]: move the 'check online content' button from the AI list window to the AI configuration window
author | yexo <yexo@openttd.org> |
---|---|
date | Tue, 15 Dec 2009 00:33:44 +0000 |
parents | 070572f1272d |
children | bf79f84b8631 |
files | src/ai/ai_gui.cpp |
diffstat | 1 files changed, 17 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -38,7 +38,6 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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; } }