summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/ai_gui.cpp35
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;
}
}