This commit is contained in:
2026-01-12 22:15:39 +00:00
parent 5fa86e6abc
commit 60372a4a58
2 changed files with 68 additions and 34 deletions

View File

@@ -263,6 +263,8 @@ struct SelectGameWindow : public Window {
bool missing_lang = _current_language->missing >= _settings_client.gui.missing_strings_threshold && !IsReleasedVersion();
this->GetWidget<NWidgetStacked>(WID_SGI_TRANSLATION_SELECTION)->SetDisplayedPlane(missing_lang ? 0 : SZSP_NONE);
this->GetWidget<NWidgetMatrix>(WID_SGI_SERVER_LIST)->SetCount(10);
}
void DrawWidget(const Rect &r, WidgetID widget) const override
@@ -342,9 +344,28 @@ struct SelectGameWindow : public Window {
case WID_SGI_EXIT: HandleExitGameRequest(); break;
}
}
void UpdateWidgetSize(WidgetID widget, Dimension &size, const Dimension &padding, Dimension &fill, Dimension &resize)
{
switch (widget) {
/* */
case WID_SGI_SERVER_LIST:
/* At least two items wide. */
size.width += resize.width;
fill.width = resize.width;
fill.height = 1;
/* Resizing in X direction only at blob size, but at pixel level in Y. */
resize.height = 1;
break;
}
}
};
static constexpr std::initializer_list<NWidgetPart> _nested_select_game_widgets = {
NWidget(NWID_HORIZONTAL_LTR), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0),
NWidget(NWID_VERTICAL),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_INTRO_CAPTION),
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.sparse),
@@ -388,6 +409,17 @@ static constexpr std::initializer_list<NWidgetPart> _nested_select_game_widgets
EndContainer(),
EndContainer(),
EndContainer(),
EndContainer(),
NWidget(NWID_VERTICAL),
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_INTRO_CAPTION),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.sparse),
NWidget(NWID_MATRIX, COLOUR_BLUE, WID_SGI_SERVER_LIST), SetPIP(0, 2, 0),
EndContainer(),
EndContainer(),
EndContainer(),
EndContainer(),
EndContainer(),
};
static WindowDesc _select_game_desc(

View File

@@ -27,6 +27,8 @@ enum SelectGameIntroWidgets : WidgetID {
WID_SGI_HELP, ///< Help and manuals button.
WID_SGI_CONTENT_DOWNLOAD, ///< Content Download button.
WID_SGI_EXIT, ///< Exit button.
WID_SGI_SERVER_LIST,
};
#endif /* WIDGETS_INTRO_WIDGET_H */