Navigate to subtree resource when clicked in editor (#276)

Co-authored-by: Steven Schoen <digisteve5@gmail.com>
This commit is contained in:
Steven Schoen 2025-01-21 19:05:51 -05:00 committed by GitHub
parent 76e02a75e5
commit a6613c32f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -893,6 +893,14 @@ void LimboAIEditor::_on_tree_task_activated() {
Ref<Script> scr = selected->get_script(); Ref<Script> scr = selected->get_script();
if (scr.is_valid()) { if (scr.is_valid()) {
EDIT_SCRIPT(scr->get_path()); EDIT_SCRIPT(scr->get_path());
} else if (IS_CLASS(selected, BTSubtree)) {
Ref<BehaviorTree> subtree = static_cast<Ref<BTSubtree>>(selected)->get_subtree();
if (subtree.is_valid()) {
EDIT_RESOURCE(subtree);
} else {
LimboUtility::get_singleton()->open_doc_class(selected->get_class());
}
EDIT_RESOURCE(subtree);
} else { } else {
LimboUtility::get_singleton()->open_doc_class(selected->get_class()); LimboUtility::get_singleton()->open_doc_class(selected->get_class());
} }