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

feat(editor): Signals mode of the Tracks window (H): semaphores, block, warning, shunting, stop, substitute signals and repeaters placed by the track from the templates of the scenery, described by //$e signal: (kind, mount, lamps, lean, the event the train reads them by) which tools/editor/signal_headers.py writes into them; a click by a track puts the signal on that side 2.25 m from the axis at the rail heads, facing the trains which have it on their right, a drag along turns it to the trains going the way of the drag; its (p1)_sem_info goes to event1 or event2 of the path, warning signals and repeaters, which the train doesn't read, get none; a head leaning away from the track swapped for its counterpart; the plate named like the signal; signals dragged along the track with their event, removed with it, renamed in the node properties with it, each a single step of the undo history; Polish translation

This commit is contained in:
maj00r
2026-10-08 03:12:16 +02:00
parent 4a7d839e5d
commit b02fe0ac2b
14 changed files with 1828 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ http://mozilla.org/MPL/2.0/.
#pragma once
#include <map>
#include <memory>
#include <optional>
#include <string>
@@ -39,6 +40,11 @@ struct include_info
double turntable_length{0.0};
int turntable_angles{0};
int turntable_positions{0};
std::string signal_kind;
std::string signal_mount;
std::string signal_lamps;
std::string signal_lean;
std::string signal_read;
std::vector<include_parameter> parameters;
// description of specified parameter, created if there's none
@@ -71,7 +77,8 @@ bool complete(include_info const &Info, int Parameters, std::string *Issue = nul
// builds include directive which places specified template. Location and Yaw are the placement to pass through
// the parameters with matching roles, in the coordinates of the place the directive goes to; without Yaw the
// rotation parameters receive their default values
std::string directive(std::string const &File, include_info const &Info, int Parameters, glm::dvec3 const &Location, std::optional<float> Yaw, std::string const &Track = {}, glm::dvec2 const &Tilt = glm::dvec2{0.0});
std::string directive(std::string const &File, include_info const &Info, int Parameters, glm::dvec3 const &Location, std::optional<float> Yaw, std::string const &Track = {}, glm::dvec2 const &Tilt = glm::dvec2{0.0}, std::map<std::string, std::string> const &Values = {});
std::string substitute(std::string const &Text, std::vector<std::string> const &Values);
// splits include directive into the name of the included file and the values of the parameters, both as they're
// written. returns: false if the text isn't a complete include directive