Merge branch upstream/master
This commit is contained in:
@@ -1519,7 +1519,7 @@ public:
|
||||
break;
|
||||
|
||||
case WID_BRAS_NEWST_LIST: {
|
||||
int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BRAS_NEWST_LIST, 0, this->line_height);
|
||||
int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_BRAS_NEWST_LIST);
|
||||
if (y >= (int)this->station_classes.size()) return;
|
||||
StationClassID station_class_id = this->station_classes[y];
|
||||
if (_railstation.station_class != station_class_id) {
|
||||
@@ -1609,17 +1609,17 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_HORIZONTAL), SetPadding(2, 0, 0, 2),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BRAS_FILTER_CONTAINER),
|
||||
NWidget(NWID_HORIZONTAL), SetPadding(2, 2, 0, 5),
|
||||
NWidget(NWID_HORIZONTAL), SetPadding(0, 5, 2, 0),
|
||||
NWidget(WWT_TEXT, COLOUR_DARK_GREEN), SetFill(0, 1), SetDataTip(STR_LIST_FILTER_TITLE, STR_NULL),
|
||||
NWidget(WWT_EDITBOX, COLOUR_GREY, WID_BRAS_FILTER_EDITBOX), SetFill(1, 0), SetResize(1, 0),
|
||||
SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BRAS_SHOW_NEWST_ADDITIONS),
|
||||
NWidget(NWID_HORIZONTAL), SetPIP(7, 0, 7), SetPadding(2, 0, 1, 0),
|
||||
NWidget(NWID_HORIZONTAL), SetPadding(0, 5, 2, 0),
|
||||
NWidget(WWT_MATRIX, COLOUR_GREY, WID_BRAS_NEWST_LIST), SetMinimalSize(122, 71), SetFill(1, 0),
|
||||
SetMatrixDataTip(1, 0, STR_STATION_BUILD_STATION_CLASS_TOOLTIP), SetScrollbar(WID_BRAS_NEWST_SCROLL),
|
||||
NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_BRAS_NEWST_SCROLL),
|
||||
@@ -1627,7 +1627,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetMinimalSize(144, 11), SetDataTip(STR_STATION_BUILD_ORIENTATION, STR_NULL), SetPadding(1, 2, 0, 2),
|
||||
NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetMinimalSize(144, 11), SetDataTip(STR_STATION_BUILD_ORIENTATION, STR_NULL), SetPadding(1, 2, 0, 0),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(7, 0), SetFill(1, 0),
|
||||
NWidget(WWT_PANEL, COLOUR_GREY, WID_BRAS_PLATFORM_DIR_X), SetSizingType(NWST_BUTTON), SetMinimalSize(66, 60), SetFill(0, 0), SetDataTip(0x0, STR_STATION_BUILD_RAILROAD_ORIENTATION_TOOLTIP), EndContainer(),
|
||||
@@ -1671,7 +1671,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 2),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetMinimalSize(144, 11), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetPadding(3, 2, 0, 2),
|
||||
NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetMinimalSize(144, 11), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetPadding(3, 2, 0, 0),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(2, 0), SetFill(1, 0),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BRAS_HIGHLIGHT_OFF), SetMinimalSize(60, 12),
|
||||
@@ -1689,7 +1689,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetScrollbar(WID_BRAS_MATRIX_SCROLL),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, WID_BRAS_MATRIX), SetScrollbar(WID_BRAS_MATRIX_SCROLL), SetPIP(0, 2, 0), SetPadding(2, 0, 0, 0),
|
||||
NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, WID_BRAS_MATRIX), SetScrollbar(WID_BRAS_MATRIX_SCROLL), SetPIP(0, 2, 0),
|
||||
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BRAS_IMAGE), SetMinimalSize(66, 60),
|
||||
SetFill(0, 0), SetResize(0, 0), SetDataTip(0x0, STR_STATION_BUILD_STATION_TYPE_TOOLTIP), SetScrollbar(WID_BRAS_MATRIX_SCROLL),
|
||||
EndContainer(),
|
||||
@@ -1704,7 +1704,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_BRAS_COVERAGE_TEXTS), SetFill(1, 1), SetResize(1, 0),
|
||||
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_BRAS_COVERAGE_TEXTS), SetPadding(2, 5, 0, 1), SetFill(1, 1), SetResize(1, 0),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BRAS_SHOW_NEWST_RESIZE),
|
||||
NWidget(NWID_VERTICAL),
|
||||
NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetFill(0, 1), EndContainer(),
|
||||
@@ -2260,17 +2260,16 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
}
|
||||
|
||||
Dimension d = { 0, 0 };
|
||||
RailType rt;
|
||||
/* Get largest icon size, to ensure text is aligned on each menu item. */
|
||||
if (!for_replacement) {
|
||||
FOR_ALL_SORTED_RAILTYPES(rt) {
|
||||
for (const auto &rt : _sorted_railtypes) {
|
||||
if (!HasBit(used_railtypes, rt)) continue;
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(rt);
|
||||
d = maxdim(d, GetSpriteSize(rti->gui_sprites.build_x_rail));
|
||||
}
|
||||
}
|
||||
|
||||
FOR_ALL_SORTED_RAILTYPES(rt) {
|
||||
for (const auto &rt : _sorted_railtypes) {
|
||||
/* If it's not used ever, don't show it to the user. */
|
||||
if (!HasBit(used_railtypes, rt)) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user