mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
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.
This commit is contained in:
parent
2dc0a33eb7
commit
4976a0140e
@ -438,8 +438,9 @@ struct BuildRailToolbarWindow : Window {
|
|||||||
|
|
||||||
BuildRailToolbarWindow(WindowDesc &desc, RailType railtype) : Window(desc)
|
BuildRailToolbarWindow(WindowDesc &desc, RailType railtype) : Window(desc)
|
||||||
{
|
{
|
||||||
this->InitNested(TRANSPORT_RAIL);
|
this->CreateNestedTree();
|
||||||
this->SetupRailToolbar(railtype);
|
this->SetupRailToolbar(railtype);
|
||||||
|
this->FinishInitNested(TRANSPORT_RAIL);
|
||||||
this->DisableWidget(WID_RAT_REMOVE);
|
this->DisableWidget(WID_RAT_REMOVE);
|
||||||
this->OnInvalidateData();
|
this->OnInvalidateData();
|
||||||
this->last_user_action = INVALID_WID_RAT;
|
this->last_user_action = INVALID_WID_RAT;
|
||||||
|
@ -349,8 +349,9 @@ struct BuildRoadToolbarWindow : Window {
|
|||||||
BuildRoadToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
|
BuildRoadToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
|
||||||
{
|
{
|
||||||
this->Initialize(_cur_roadtype);
|
this->Initialize(_cur_roadtype);
|
||||||
this->InitNested(window_number);
|
this->CreateNestedTree();
|
||||||
this->SetupRoadToolbar();
|
this->SetupRoadToolbar();
|
||||||
|
this->FinishInitNested(window_number);
|
||||||
this->SetWidgetDisabledState(WID_ROT_REMOVE, true);
|
this->SetWidgetDisabledState(WID_ROT_REMOVE, true);
|
||||||
|
|
||||||
if (RoadTypeIsRoad(this->roadtype)) {
|
if (RoadTypeIsRoad(this->roadtype)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user