Fix broken bottom panel switching

This commit is contained in:
Silc Renew 2023-01-31 05:50:00 +09:00
parent 551f5191e5
commit fc22583b34
2 changed files with 6 additions and 0 deletions

View File

@ -581,6 +581,7 @@ void EditorNode::_notification(int p_what) {
ResourceImporterTexture::get_singleton()->update_imports(); ResourceImporterTexture::get_singleton()->update_imports();
bottom_panel_updating = false;
} break; } break;
case NOTIFICATION_ENTER_TREE: { case NOTIFICATION_ENTER_TREE: {
@ -5601,12 +5602,16 @@ void EditorNode::remove_bottom_panel_item(Control *p_item) {
} }
void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
if (bottom_panel_updating) {
return;
}
ERR_FAIL_INDEX(p_idx, bottom_panel_items.size()); ERR_FAIL_INDEX(p_idx, bottom_panel_items.size());
if (bottom_panel_items[p_idx].control->is_visible() == p_enable) { if (bottom_panel_items[p_idx].control->is_visible() == p_enable) {
return; return;
} }
bottom_panel_updating = true;
if (p_enable) { if (p_enable) {
for (int i = 0; i < bottom_panel_items.size(); i++) { for (int i = 0; i < bottom_panel_items.size(); i++) {
bottom_panel_items[i].button->set_pressed(i == p_idx); bottom_panel_items[i].button->set_pressed(i == p_idx);

View File

@ -460,6 +460,7 @@ private:
EditorToaster *editor_toaster = nullptr; EditorToaster *editor_toaster = nullptr;
LinkButton *version_btn = nullptr; LinkButton *version_btn = nullptr;
Button *bottom_panel_raise = nullptr; Button *bottom_panel_raise = nullptr;
bool bottom_panel_updating = false;
Tree *disk_changed_list = nullptr; Tree *disk_changed_list = nullptr;
ConfirmationDialog *disk_changed = nullptr; ConfirmationDialog *disk_changed = nullptr;