From 7e046f112be42d9a4b8c7ed819f968e1e9c482da Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 3 Dec 2025 14:38:03 +0000 Subject: [PATCH] Fix #14844: Use company colour remap for badges in picker window. (#14849) (Except for houses, which are not company-owned.) --- src/picker_gui.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/picker_gui.cpp b/src/picker_gui.cpp index 4fc2172cd0..d73b2a5dd1 100644 --- a/src/picker_gui.cpp +++ b/src/picker_gui.cpp @@ -341,7 +341,9 @@ void PickerWindow::DrawWidget(const Rect &r, WidgetID widget) const int by = ir.Height() - ScaleGUITrad(12); GrfSpecFeature feature = this->callbacks.GetFeature(); - DrawBadgeColumn({0, by, ir.Width() - 1, ir.Height() - 1}, 0, this->badge_classes, this->callbacks.GetTypeBadges(item.class_index, item.index), feature, std::nullopt, PAL_NONE); + /* Houses have recolours but not related to the company colour. */ + PaletteID palette = 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); if (this->callbacks.saved.contains(item)) { DrawSprite(SPR_BLOT, PALETTE_TO_YELLOW, 0, 0); @@ -447,7 +449,9 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int) default: if (IsInsideMM(widget, this->badge_filters.first, this->badge_filters.second)) { - ShowDropDownList(this, this->GetWidget(widget)->GetDropDownList(), -1, widget, 0); + /* Houses have recolours but not related to the company colour. */ + PaletteID palette = this->callbacks.GetFeature() == GSF_HOUSES ? PAL_NONE : GetCompanyPalette(_local_company); + ShowDropDownList(this, this->GetWidget(widget)->GetDropDownList(palette), -1, widget, 0); } break; }