From 9c2e5ec04ed600e9b6ea64fa1afd9a946cb1013f Mon Sep 17 00:00:00 2001 From: nivaturimika <159065448+Nivaturimika@users.noreply.github.com> Date: Tue, 9 Jul 2024 05:09:46 +0100 Subject: [PATCH] sense --- src/gui/gui_element_types.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/gui_element_types.cpp b/src/gui/gui_element_types.cpp index 6441e588a..fdb079744 100644 --- a/src/gui/gui_element_types.cpp +++ b/src/gui/gui_element_types.cpp @@ -1119,16 +1119,6 @@ void window_element_base::on_create(sys::state& state) noexcept { if(base_data.get_element_type() == element_type::window) { auto first_child = base_data.data.window.first_child; auto num_children = base_data.data.window.num_children; - for(uint32_t i = num_children; i-- > 0;) { - auto child_tag = dcon::gui_def_id(dcon::gui_def_id::value_base_t(i + first_child.index())); - auto ch_res = make_child(state, parsers::lowercase_str(state.to_string_view(state.ui_defs.gui[child_tag].name)), child_tag); - if(!ch_res) { - ch_res = ui::make_element_immediate(state, child_tag); - } - if(ch_res) { - this->add_child_to_back(std::move(ch_res)); - } - } for(auto ex : state.ui_defs.extensions) { if(ex.window == base_data.name) { auto ch_res = make_child(state, parsers::lowercase_str(state.to_string_view(state.ui_defs.gui[ex.child].name)), ex.child); @@ -1136,10 +1126,20 @@ void window_element_base::on_create(sys::state& state) noexcept { ch_res = ui::make_element_immediate(state, ex.child); } if(ch_res) { - this->add_child_to_front(std::move(ch_res)); + this->add_child_to_back(std::move(ch_res)); } } } + for(uint32_t i = num_children; i-- > 0;) { + auto child_tag = dcon::gui_def_id(dcon::gui_def_id::value_base_t(i + first_child.index())); + auto ch_res = make_child(state, parsers::lowercase_str(state.to_string_view(state.ui_defs.gui[child_tag].name)), child_tag); + if(!ch_res) { + ch_res = ui::make_element_immediate(state, child_tag); + } + if(ch_res) { + this->add_child_to_back(std::move(ch_res)); + } + } } }