Merge branch 'save_ext' into enhanced_viewport_overlay

# Conflicts:
#	src/smallmap_gui.cpp
This commit is contained in:
Jonathan G Rennison
2017-09-04 01:04:04 +01:00
265 changed files with 4275 additions and 2654 deletions

View File

@@ -381,18 +381,38 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b
/* Check if the dropdown will fully fit below the widget */
if (top + height + 4 >= screen_bottom) {
/* If not, check if it will fit above the widget */
if (w->top + wi_rect.top - height > GetMainViewTop()) {
int screen_top = GetMainViewTop();
if (w->top + wi_rect.top > screen_top + height) {
top = w->top + wi_rect.top - height - 4;
} else {
/* ... and lastly if it won't, enable the scroll bar and fit the
* list in below the widget */
/* If it doesn't fit above the widget, we need to enable a scrollbar... */
int avg_height = height / (int)list->Length();
int rows = (screen_bottom - 4 - top) / avg_height;
height = rows * avg_height;
scroll = true;
/* ... and choose whether to put the list above or below the widget. */
bool put_above = false;
int available_height = screen_bottom - w->top - wi_rect.bottom;
if (w->top + wi_rect.top - screen_top > available_height) {
// Put it above.
available_height = w->top + wi_rect.top - screen_top;
put_above = true;
}
/* Check at least there is space for one item. */
assert(available_height >= avg_height);
/* And lastly, fit the list... */
int rows = available_height / avg_height;
height = rows * avg_height;
/* Add space for the scroll bar if we automatically determined
* the width of the list. */
max_item_width += NWidgetScrollbar::GetVerticalDimension().width;
/* ... and set the top position if needed. */
if (put_above) {
top = w->top + wi_rect.top - height - 4;
}
}
}

View File

@@ -32,6 +32,7 @@ enum GroupListWidgets {
WID_GL_DELETE_GROUP, ///< Delete group button.
WID_GL_RENAME_GROUP, ///< Rename group button.
WID_GL_REPLACE_PROTECTION, ///< Replace protection button.
WID_GL_INFO, ///< Group info.
};
#endif /* WIDGETS_GROUP_WIDGET_H */

View File

@@ -24,8 +24,10 @@ enum SelectGameIntroWidgets {
WID_SGI_ARCTIC_LANDSCAPE, ///< Select arctic landscape button.
WID_SGI_TROPIC_LANDSCAPE, ///< Select tropic landscape button.
WID_SGI_TOYLAND_LANDSCAPE, ///< Select toyland landscape button.
WID_SGI_BASESET_SELECTION, ///< Baseset selection.
WID_SGI_BASESET, ///< Baseset errors.
WID_SGI_TRANSLATION_SELECTION, ///< Translation selection.
WID_SGI_TRANSLATION, ///< Translation.
WID_SGI_TRANSLATION, ///< Translation errors.
WID_SGI_OPTIONS, ///< Options button.
WID_SGI_HIGHSCORE, ///< Highscore button.
WID_SGI_SETTINGS_OPTIONS, ///< Settings button.