diff --git a/.gitmodules b/.gitmodules index 12549cf..1cb6db1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -21,4 +21,4 @@ url = https://github.com/santaclose/ImGuiColorTextEdit [submodule "story-editor/externals/ImNodeFlow"] path = story-editor/externals/ImNodeFlow - url = https://github.com/Fattorino/ImNodeFlow + url = https://github.com/arabine/ImNodeFlow diff --git a/story-editor/externals/ImNodeFlow b/story-editor/externals/ImNodeFlow index 9eb4094..1d06616 160000 --- a/story-editor/externals/ImNodeFlow +++ b/story-editor/externals/ImNodeFlow @@ -1 +1 @@ -Subproject commit 9eb4094aa9e5b2a826078b4371aa61318e4062a2 +Subproject commit 1d06616de63ab497f18e9403b128b6eccef3115d diff --git a/story-editor/src/node_editor/node_editor_page.h b/story-editor/src/node_editor/node_editor_page.h index 2012146..6d72edd 100644 --- a/story-editor/src/node_editor/node_editor_page.h +++ b/story-editor/src/node_editor/node_editor_page.h @@ -56,7 +56,7 @@ public: } } - std::shared_ptr Widget() { + std::shared_ptr GetWidget() { return m_widget; } @@ -114,7 +114,7 @@ struct NodeEditorPage : public ImFlow::BaseNode if (delegate == nullptr) continue; - nlist.push_back(delegate->Widget()); + nlist.push_back(delegate->GetWidget()); } return nlist; @@ -211,6 +211,29 @@ struct NodeEditorPage : public ImFlow::BaseNode std::shared_ptr selected; + updatePublicStatus(); + + // if (mINF.on_selected_node()) + { + // Loop all nodes, get first selected + for (auto &node : mINF.getNodes()) + { + if (node.second->isSelected()) + { + // cast to delegate + auto delegate = dynamic_cast(node.second.get()); + if (delegate) + { + //get widget + selected = delegate->GetWidget(); + } + break; + } + } + } + + + // if (ed::GetSelectedObjectCount() > 0) // { // ed::NodeId nId;