Changeset - r28272:4f0d8f9e8e65
[Not reviewed]
master
0 2 0
Peter Nelson - 12 months ago 2023-12-09 21:01:46
peter1138@openttd.org
Codechange: Set displayed plane earlier to avoid ReInit.
2 files changed with 7 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -403,16 +403,13 @@ public:
 

	
 
		this->CreateNestedTree();
 
		this->vscroll = this->GetScrollbar(WID_DPI_SCROLLBAR);
 
		/* Show scenario editor tools in editor. */
 
		if (_game_mode != GM_EDITOR) {
 
			this->GetWidget<NWidgetStacked>(WID_DPI_SCENARIO_EDITOR_PANE)->SetDisplayedPlane(SZSP_HORIZONTAL);
 
		}
 
		this->FinishInitNested(0);
 

	
 
		this->SetButtons();
 

	
 
		/* Show scenario editor tools in editor. */
 
		if (_game_mode != GM_EDITOR) {
 
			auto *se_tools = this->GetWidget<NWidgetStacked>(WID_DPI_SCENARIO_EDITOR_PANE);
 
			se_tools->SetDisplayedPlane(SZSP_HORIZONTAL);
 
			this->ReInit();
 
		}
 
	}
 

	
 
	void OnInit() override
src/tree_gui.cpp
Show inline comments
 
@@ -141,17 +141,15 @@ class BuildTreesWindow : public Window
 
public:
 
	BuildTreesWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc), tree_to_plant(-1), mode(PM_NORMAL)
 
	{
 
		this->InitNested(window_number);
 
		this->CreateNestedTree();
 
		ResetObjectToPlace();
 

	
 
		this->LowerWidget(WID_BT_MODE_NORMAL);
 

	
 
		/* Show scenario editor tools in editor */
 
		auto *se_tools = this->GetWidget<NWidgetStacked>(WID_BT_SE_PANE);
 
		if (_game_mode != GM_EDITOR) {
 
			se_tools->SetDisplayedPlane(SZSP_HORIZONTAL);
 
			this->ReInit();
 
			this->GetWidget<NWidgetStacked>(WID_BT_SE_PANE)->SetDisplayedPlane(SZSP_HORIZONTAL);
 
		}
 
		this->FinishInitNested(window_number);
 
	}
 

	
 
	void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
0 comments (0 inline, 0 general)