17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-03 09:40:22 +01:00

Catenary editor: keep catenary parts out of node editing, pick and drag anchor poles

This commit is contained in:
2026-10-26 19:51:15 +01:00
parent 5f93c7c20d
commit d794b1e736
10 changed files with 142 additions and 7 deletions

View File

@@ -392,6 +392,15 @@ bool node_layers::editable(basic_node const *Node, std::string *Reason) const
{
return false;
}
if (Node->m_catenary)
{
// moved, copied or deleted by itself it would part from the catenary which keeps it (and is rebuilt from its own file)
if (Reason != nullptr)
{
*Reason = STR_C("it's a part of the catenary, which is changed with the Catenary tool (F6)");
}
return false;
}
auto const nodelayer{resolve(Node->layer())};
if (false == valid(nodelayer))
{

View File

@@ -413,6 +413,7 @@ public:
bool m_dirty { false };
bool m_layerhidden { false }; // the node was visible until the editor hid its scenery layer, or the include which defines it
bool m_preview { false }; // the node was made by the editor to show an include it placed or changed, and is replaced when the include changes
bool m_catenary { false }; // a part the catenary assembled (world/catenary_scene.cpp): it's changed by the catenary tool, not edited as a node
scene::layer_handle m_layer { null_handle }; // scenery layer this node belongs to, if any
// include of an *.inc template which defines the node; 0 if the node is defined directly by a scenery layer file.
// such nodes can't be rewritten one by one on scenery save. set only for scenery opened for editing