Add selection for property display

This commit is contained in:
anthony@rabine.fr 2025-09-04 13:17:26 +02:00
parent 600a80d529
commit fc37a9ffa1
3 changed files with 27 additions and 4 deletions

2
.gitmodules vendored
View file

@ -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

@ -1 +1 @@
Subproject commit 9eb4094aa9e5b2a826078b4371aa61318e4062a2
Subproject commit 1d06616de63ab497f18e9403b128b6eccef3115d

View file

@ -56,7 +56,7 @@ public:
}
}
std::shared_ptr<BaseNodeWidget> Widget() {
std::shared_ptr<BaseNodeWidget> 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<BaseNodeWidget> 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<NodeDelegate*>(node.second.get());
if (delegate)
{
//get widget
selected = delegate->GetWidget();
}
break;
}
}
}
// if (ed::GetSelectedObjectCount() > 0)
// {
// ed::NodeId nId;