Update header when clicked

This commit is contained in:
Serhii Snitsaruk 2022-11-22 22:58:53 +01:00
parent 81e672b4d2
commit ce2041391a
2 changed files with 3 additions and 2 deletions

View File

@ -525,7 +525,7 @@ void LimboAIEditor::_add_task(const Ref<BTTask> &p_task) {
task_tree->update_tree(); task_tree->update_tree();
} }
void LimboAIEditor::_update_header() { void LimboAIEditor::_update_header() const {
String text = task_tree->get_bt()->get_path(); String text = task_tree->get_bt()->get_path();
if (text.empty()) { if (text.empty()) {
text = TTR("New Behavior Tree"); text = TTR("New Behavior Tree");
@ -731,6 +731,7 @@ void LimboAIEditor::_on_visibility_changed() const {
} }
void LimboAIEditor::_on_header_pressed() const { void LimboAIEditor::_on_header_pressed() const {
_update_header();
task_tree->deselect(); task_tree->deselect();
editor->edit_resource(task_tree->get_bt()); editor->edit_resource(task_tree->get_bt());
} }

View File

@ -136,7 +136,7 @@ private:
void _add_task(const Ref<BTTask> &p_task); void _add_task(const Ref<BTTask> &p_task);
_FORCE_INLINE_ void _add_task_with_prototype(const Ref<BTTask> &p_prototype) { _add_task(p_prototype->clone()); } _FORCE_INLINE_ void _add_task_with_prototype(const Ref<BTTask> &p_prototype) { _add_task(p_prototype->clone()); }
void _update_header(); void _update_header() const;
void _update_history_buttons(); void _update_history_buttons();
void _new_bt(); void _new_bt();
void _save_bt(String p_path); void _save_bt(String p_path);