mirror of https://github.com/OpenTTD/OpenTTD
Codefix: [UI] Incorrect initialisation order for rail/road toolbars. (#12843)
The toolbar state was set after the widget tree is created, during which toolbar state is needed.pull/12844/head
parent
2dc0a33eb7
commit
4976a0140e
|
@ -438,8 +438,9 @@ struct BuildRailToolbarWindow : Window {
|
|||
|
||||
BuildRailToolbarWindow(WindowDesc &desc, RailType railtype) : Window(desc)
|
||||
{
|
||||
this->InitNested(TRANSPORT_RAIL);
|
||||
this->CreateNestedTree();
|
||||
this->SetupRailToolbar(railtype);
|
||||
this->FinishInitNested(TRANSPORT_RAIL);
|
||||
this->DisableWidget(WID_RAT_REMOVE);
|
||||
this->OnInvalidateData();
|
||||
this->last_user_action = INVALID_WID_RAT;
|
||||
|
|
|
@ -349,8 +349,9 @@ struct BuildRoadToolbarWindow : Window {
|
|||
BuildRoadToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
|
||||
{
|
||||
this->Initialize(_cur_roadtype);
|
||||
this->InitNested(window_number);
|
||||
this->CreateNestedTree();
|
||||
this->SetupRoadToolbar();
|
||||
this->FinishInitNested(window_number);
|
||||
this->SetWidgetDisabledState(WID_ROT_REMOVE, true);
|
||||
|
||||
if (RoadTypeIsRoad(this->roadtype)) {
|
||||
|
|
Loading…
Reference in New Issue