Fix a41738e: Picker item recolour depends on gamemode (#14929)
This commit is contained in:
@@ -339,8 +339,8 @@ void PickerWindow::DrawWidget(const Rect &r, WidgetID widget) const
|
|||||||
int by = ir.Height() - ScaleGUITrad(12);
|
int by = ir.Height() - ScaleGUITrad(12);
|
||||||
|
|
||||||
GrfSpecFeature feature = this->callbacks.GetFeature();
|
GrfSpecFeature feature = this->callbacks.GetFeature();
|
||||||
/* Houses have recolours but not related to the company colour. */
|
/* Houses have recolours but not related to the company colour and other items depend on gamemode. */
|
||||||
PaletteID palette = feature == GSF_HOUSES ? PAL_NONE : GetCompanyPalette(_local_company);
|
PaletteID palette = _game_mode != GM_NORMAL || feature == GSF_HOUSES ? PAL_NONE : GetCompanyPalette(_local_company);
|
||||||
DrawBadgeColumn({0, by, ir.Width() - 1, ir.Height() - 1}, 0, this->badge_classes, this->callbacks.GetTypeBadges(item.class_index, item.index), feature, std::nullopt, palette);
|
DrawBadgeColumn({0, by, ir.Width() - 1, ir.Height() - 1}, 0, this->badge_classes, this->callbacks.GetTypeBadges(item.class_index, item.index), feature, std::nullopt, palette);
|
||||||
|
|
||||||
if (this->callbacks.saved.contains(item)) {
|
if (this->callbacks.saved.contains(item)) {
|
||||||
@@ -449,8 +449,8 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (IsInsideMM(widget, this->badge_filters.first, this->badge_filters.second)) {
|
if (IsInsideMM(widget, this->badge_filters.first, this->badge_filters.second)) {
|
||||||
/* Houses have recolours but not related to the company colour. */
|
/* Houses have recolours but not related to the company colour and other items depend on gamemode. */
|
||||||
PaletteID palette = this->callbacks.GetFeature() == GSF_HOUSES ? PAL_NONE : GetCompanyPalette(_local_company);
|
PaletteID palette = _game_mode != GM_NORMAL || this->callbacks.GetFeature() == GSF_HOUSES ? PAL_NONE : GetCompanyPalette(_local_company);
|
||||||
ShowDropDownList(this, this->GetWidget<NWidgetBadgeFilter>(widget)->GetDropDownList(palette), -1, widget, 0);
|
ShowDropDownList(this, this->GetWidget<NWidgetBadgeFilter>(widget)->GetDropDownList(palette), -1, widget, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user