17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00

feat(editor): keep content added by the editor ahead of FirstInit

This commit is contained in:
2026-10-03 01:59:13 +02:00
parent ced26d171f
commit 521c4f9ebb
6 changed files with 266 additions and 50 deletions

View File

@@ -1404,9 +1404,9 @@ void layers_panel::render_list()
ImGui::SameLine();
if (ImGui::RadioButton("##active", isactive) && false == isactive)
{
if (isremoved || false == iswritable)
if (std::string reason; false == scene::Layers.accepts(handle, &reason))
{
report("Layer \"" + layer_name(handle) + "\" can't take new nodes" + (isremoved ? "" : ": " + readonly), true);
report("Layer \"" + layer_name(handle) + "\" can't take new nodes" + (reason.empty() ? "" : ": " + reason), true);
}
else
{
@@ -1431,6 +1431,10 @@ void layers_panel::render_list()
{
label += " [read-only]";
}
else if (layer.late)
{
label += " [after FirstInit]";
}
if (ImGui::Selectable(label.c_str(), handle == m_selected))
{
m_selected = handle;
@@ -1446,6 +1450,10 @@ void layers_panel::render_list()
{
content += "\nread-only: " + readonly;
}
if (layer.late)
{
content += "\nloaded after the scenario initialization (FirstInit): takes no new nodes, only vehicles belong there";
}
if (auto const items{layer_content(layer)}; false == items.empty())
{
content += "\n" + items;