mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Fix: change all Company planes on paint, not only the first that needs changing
Otherwise it can take a few OnPaint() calls before all planes are set correctly when switching companies.
This commit is contained in:
parent
dff7ee8e1c
commit
fc474b02fa
@ -2294,7 +2294,7 @@ struct CompanyWindow : Window
|
|||||||
if (plane != wi->shown_plane) {
|
if (plane != wi->shown_plane) {
|
||||||
wi->SetDisplayedPlane(plane);
|
wi->SetDisplayedPlane(plane);
|
||||||
this->InvalidateData();
|
this->InvalidateData();
|
||||||
return;
|
reinit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build HQ button handling. */
|
/* Build HQ button handling. */
|
||||||
@ -2302,8 +2302,7 @@ struct CompanyWindow : Window
|
|||||||
wi = this->GetWidget<NWidgetStacked>(WID_C_SELECT_VIEW_BUILD_HQ);
|
wi = this->GetWidget<NWidgetStacked>(WID_C_SELECT_VIEW_BUILD_HQ);
|
||||||
if (plane != wi->shown_plane) {
|
if (plane != wi->shown_plane) {
|
||||||
wi->SetDisplayedPlane(plane);
|
wi->SetDisplayedPlane(plane);
|
||||||
this->SetDirty();
|
reinit = true;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this->SetWidgetDisabledState(WID_C_VIEW_HQ, c->location_of_HQ == INVALID_TILE);
|
this->SetWidgetDisabledState(WID_C_VIEW_HQ, c->location_of_HQ == INVALID_TILE);
|
||||||
@ -2313,8 +2312,7 @@ struct CompanyWindow : Window
|
|||||||
wi = this->GetWidget<NWidgetStacked>(WID_C_SELECT_RELOCATE);
|
wi = this->GetWidget<NWidgetStacked>(WID_C_SELECT_RELOCATE);
|
||||||
if (plane != wi->shown_plane) {
|
if (plane != wi->shown_plane) {
|
||||||
wi->SetDisplayedPlane(plane);
|
wi->SetDisplayedPlane(plane);
|
||||||
this->SetDirty();
|
reinit = true;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Owners of company */
|
/* Owners of company */
|
||||||
|
Loading…
Reference in New Issue
Block a user