9 if (!ImGui::CollapsingHeader(
"Rails and behavior",
10 ImGuiTreeNodeFlags_DefaultOpen))
13 "Choose artwork, then place it on the room canvas. "
14 "Rail behavior is stamped separately below.");
22 if (ImGui::Checkbox(
"Stamp rail behavior", &stamping)) {
34 static constexpr Behavior kBehaviors[] = {
35 {0xB0,
"Straight: horizontal"},
36 {0xB1,
"Straight: vertical"},
37 {0xB2,
"Corner: right / down"},
38 {0xB3,
"Corner: right / up"},
39 {0xB4,
"Corner: left / down"},
40 {0xB5,
"Corner: left / up"},
42 {0xB7,
"Stop: depart south"},
43 {0xB8,
"Stop: depart north"},
44 {0xB9,
"Stop: depart east"},
45 {0xBA,
"Stop: depart west"},
46 {0xBB,
"Junction: south / east / west"},
47 {0xBC,
"Junction: north / east / west"},
48 {0xBD,
"Junction: north / south / west"},
49 {0xBE,
"Junction: north / south / east"},
50 {0xD0,
"Switch: right / down"},
51 {0xD1,
"Switch: right / up"},
52 {0xD2,
"Switch: left / down"},
53 {0xD3,
"Switch: left / up"},
54 {0x00,
"Erase rail behavior"}};
55 const char* selected = kBehaviors[1].label;
56 for (
const auto& behavior : kBehaviors) {
58 selected = behavior.label;
60 ImGui::SetNextItemWidth(-1);
61 const bool open = ImGui::BeginCombo(
"##RailBehavior", selected);
64 for (
const auto& behavior : kBehaviors) {
65 if (ImGui::Selectable(behavior.label,
75 "Upper layer only. Hover to preview; click to stamp. "
76 "Each click is one Undo step. Click the room canvas, then Escape "
79 "Ordinary rails preserve stops, switches and other "
80 "collision. Use a stop or switch tool to change its direction. "
81 "Erase rail behavior removes rails, stops and switches only; "
82 "artwork is unchanged.");