17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 15:09:13 +01:00

feat(editor): the parallel track is a tool of its own (N) in the toolbar, its green preview only shows there, Shift+click on a straight in L opens it with that track; the norms are two buttons at the top of the Lay panel and of the Curve tool, shared by both, free hides the recommendations of the curve and its norm warnings, the duplicate transitions checkbox is gone; the Lay panel starts with the radius, the speed and the shape; the Tracks toolbar shows the tools that lay track, the ones that correct a line are under More (remembered); First steps ends with driving the track laid; self-test command tracktab

This commit is contained in:
maj00r
2026-10-12 01:52:28 +02:00
parent 7fea51ad06
commit c9f381a9c9
14 changed files with 187 additions and 57 deletions

View File

@@ -50,6 +50,8 @@ enum class icon
infra,
gauge,
turntable,
parallel,
more,
// the fields of work
work_surroundings,
work_tracks,

View File

@@ -104,6 +104,8 @@ bool editorSettings::load()
parse(value, m_palette);
else if (key == "first_steps")
m_first_steps = (value == "1");
else if (key == "track_tools_more")
m_track_tools_more = (value == "1");
else if (key.rfind(origin_prefix, 0) == 0)
{
// northing;easting
@@ -148,6 +150,7 @@ bool editorSettings::save()
stream << "nodebank_card " << m_nodebank_card << "\n";
stream << "colours " << m_palette << "\n";
stream << "first_steps " << (m_first_steps ? 1 : 0) << "\n";
stream << "track_tools_more " << (m_track_tools_more ? 1 : 0) << "\n";
stream << std::fixed << std::setprecision(3);
for (auto const &origin : m_orthophoto_origins)
stream << origin.first << " " << origin.second.first << ";" << origin.second.second << "\n";

View File

@@ -56,6 +56,8 @@ public:
bool first_steps() const { return m_first_steps; }
void first_steps(bool Show) { m_first_steps = Show; }
bool track_tools_more() const { return m_track_tools_more; }
void track_tools_more(bool Show) { m_track_tools_more = Show; }
private:
movement_scheme m_movement{movement_scheme::wsad};
@@ -67,6 +69,7 @@ private:
int m_nodebank_card{96};
int m_palette{0};
bool m_first_steps{true};
bool m_track_tools_more{false};
};
// global editor settings instance

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -321,6 +321,21 @@ def turntable(d):
line(d, [(32 + math.cos(r) * 24, 32 + math.sin(r) * 24), (32 + math.cos(r) * 31, 32 + math.sin(r) * 31)], W - 4)
def parallel(d):
# a track and a second one beside it, with the spacing between them
for x in (8, 22):
line(d, [(x, 60), (x, 4)], W - 6)
for x in (42, 56):
dashed(d, (x, 60), (x, 4), 8, 6, W - 6)
line(d, [(26, 32), (38, 32)], W - 8)
arrowhead(d, 40, 32, 0, 10)
def more(d):
for x in (12, 32, 52):
circle(d, x, 32, 6)
# the fields of work of the editor, in the row over the toolbar
@@ -366,7 +381,7 @@ def work_terrain(d):
ICONS = [select, insert, brush, area_fill, copy_to_bank, translate, rotate, scale,
local_space, ortho, perspective, sculpt, smooth, chunks, orthophoto, road,
place, lanes, lay_track, switch, straight, curve, signal, objects,
vehicle, profile, speed, joints, infra, gauge, turntable, work_surroundings,
vehicle, profile, speed, joints, infra, gauge, turntable, parallel, more, work_surroundings,
work_tracks, work_roads, work_terrain]