17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-22 15:33:21 +02:00

feat(editor): no frog, movable nose nor 3D sleeper model fields while these features are off in the build

The switch panel and the track properties show the frog and movable nose boxes only with track_features::crossings, and the
sleeper and timber model fields of the pack only with track_features::sleepers.
This commit is contained in:
maj00r
2026-10-18 00:58:55 +02:00
parent d72fa51ce5
commit e52d8d6e84
2 changed files with 12 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ http:
#include "utilities/Globals.h"
#include "rendering/renderer.h"
#include "world/Track.h"
#include "world/TrackFeatures.h"
#include "scene/scene.h"
#include "scene/scenelayers.h"
#include "simulation/simulation.h"
@@ -1039,16 +1040,17 @@ void editor_mode::render_turnout_ui()
if (set.has_value())
drive_ui(*set->second);
bool frogs{track->SwitchExtension->m_frogs};
if (ImGui::Checkbox(STR_C("Frog and check rails made from the rails"), &frogs))
if (track_features::crossings && ImGui::Checkbox(STR_C("Frog and check rails made from the rails"), &frogs))
{
auto const before{editor_track::capture(*track)};
track->SwitchExtension->m_frogs = frogs;
push_track_snapshot({{track, before}});
editor_track::commit_parameters(*track);
}
item_tooltip("Cuts the rails of the switch at its frog and lays wing rails and check rails, for rail profiles S60, UIC60 and S39.\n"
"Off for a switch whose include has its own model of them");
if (frogs)
if (track_features::crossings)
item_tooltip("Cuts the rails of the switch at its frog and lays wing rails and check rails, for rail profiles S60, UIC60 and S39.\n"
"Off for a switch whose include has its own model of them");
if (track_features::crossings && frogs)
{
bool movable{track->SwitchExtension->m_movablenose};
if (ImGui::Checkbox(STR_C("Movable nose"), &movable))