mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-24 08:13:20 +02:00
feat(editor): labels for a layman, light at the start; whole sceneries fitted to the terrain model
Labels: - every button, field, tooltip and message of the editor reread for a beginner: short nouns for the fields with the sentence in the tooltip, the less used options under More settings, one glossary (field of work, template, track, grade), sides told from directions, degrees and per mille as signs, messages built from one format string - plural forms through STR_P; the last entry of a po file is read too, and the Polish plural rule is in the header - lang/editor_pl.po: the code pass entries merged, 391 entries no code uses and 3 duplicates dropped - roads: the notes and errors naming a road translated; the build options and the layout fold the texture length, kerb sizes, traffic share, roundabout part, height over the ground and junction speed limit under More settings, the lanes start folded Grade lines fitted to the terrain model (NMT), a line or the whole scenery at once: - fit_ground: a robust fit on nodes 5 m apart; the ground parting from the line (a bridge, a viaduct, a wall) is gone past rather than followed, the bends keep off the switches as far as their curves reach, a run of bends the same way is one point of intersection, a curve with no room is as sharp as the room lets it be - the ends of the line and the other paths of its switches leading into lines fitted already bound the line by what the tracks between can climb; ends meeting in the plan, laid apart in height by hand, are joined before the run - apply_profile: the paths are split where split_path takes the parameter (a straight was cut in the wrong place, into pieces of a few centimetres the game takes for zero length), no piece shorter than the margin; the paths off the ends of the route are brought to its height - Bytom: 1600 lines, grade breaks at the joints 89 -> 20; Tarnowskie Gory: 848 lines, 223 -> 3; no step over 2 cm
This commit is contained in:
@@ -134,7 +134,9 @@ std::vector<std::string> drift_notes(record_drift const &Drift)
|
||||
if (Drift.followed > 0)
|
||||
notes.push_back(STR("The kept design of the line went along with its paths"));
|
||||
if (Drift.departed > 0)
|
||||
notes.push_back(format(STR_C("%d path(s) left the design kept in %s, by up to %.2f m: Ctrl+Z takes it back, the route design lays them by the design again or forgets it"), Drift.departed, Drift.layer.c_str(), Drift.departure));
|
||||
notes.push_back(format(STR_P("%d path left the design kept in %s, by up to %.2f m: Ctrl+Z takes it back, the Plan tool (G) lays it by the design again or forgets the design",
|
||||
"%d paths left the design kept in %s, by up to %.2f m: Ctrl+Z takes it back, the Plan tool (G) lays them by the design again or forgets it", Drift.departed),
|
||||
Drift.departed, Drift.layer.c_str(), Drift.departure));
|
||||
if (Drift.cant > 5.0)
|
||||
notes.push_back(format(STR_C("The cant differs from the kept design by up to %.0f mm"), Drift.cant));
|
||||
return notes;
|
||||
@@ -160,7 +162,8 @@ switch_store::record switch_entry(editor_track::switch_template const &Shape)
|
||||
}
|
||||
else
|
||||
{
|
||||
entry.type = "-";
|
||||
// Rz, Rlj or Rld, as classify finds it by the shape
|
||||
entry.type = "Rz";
|
||||
entry.radius = Shape.radius;
|
||||
entry.ratio = Shape.ratio;
|
||||
entry.source = "measured";
|
||||
@@ -379,24 +382,35 @@ void editor_mode::render_switch_record(TTrack const &Track) const
|
||||
}
|
||||
auto entry{*known};
|
||||
ImGui::Text(STR_C("Type kept in the scenery: %s"), switch_store::label(entry).c_str());
|
||||
if (entry.kind == "switch" && entry.main_radius != 0.0)
|
||||
ImGui::TextDisabled(STR_C("Diverging track R %.0f m: the R %.0f m of the type bent with the main track"), switch_store::branch_radius(entry), entry.radius);
|
||||
if (entry.source == "measured")
|
||||
ImGui::TextDisabled("%s", STR_C("Copied from a switch of the scenery: the size is measured from its shape"));
|
||||
ImGui::PushItemWidth(100.0f);
|
||||
bool changed{edit_dashed<32>(STR_C("Number##switchnumber"), entry.number)};
|
||||
item_tooltip("Number of the switch in the station, as the plans of the station give it");
|
||||
ImGui::SameLine();
|
||||
changed |= edit_dashed<16>(STR_C("Rail##switchrail"), entry.rail);
|
||||
item_tooltip("Rail of the switch: 60E1, 49E1...");
|
||||
auto km{entry.km.has_value() ? *entry.km / 1000.0 : 0.0};
|
||||
if (ImGui::InputDouble(STR_C("Km of the start##switchkm"), &km, 0.0, 0.0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue))
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
entry.km = km * 1000.0;
|
||||
changed = true;
|
||||
std::string text;
|
||||
if (entry.kind == "switch" && entry.main_radius != 0.0)
|
||||
text = format(STR_C("Diverging track R %.0f m: the R %.0f m of the type bent with the main track"), switch_store::branch_radius(entry), entry.radius);
|
||||
if (entry.source == "measured")
|
||||
text += (text.empty() ? "" : "\n") + std::string{STR_C("The size is measured from the shape of the switch, it's of no template of the catalogue")};
|
||||
if (false == text.empty())
|
||||
ImGui::SetTooltip("%s", text.c_str());
|
||||
}
|
||||
bool changed{false};
|
||||
if (begin_fields("##switchrecord", 0.4f))
|
||||
{
|
||||
field_row("Number##switchnumber");
|
||||
changed |= edit_dashed<32>("##switchnumber", entry.number);
|
||||
item_tooltip("Number of the switch in the station, as the plans of the station give it");
|
||||
field_row("Rail##switchrail");
|
||||
changed |= edit_dashed<16>("##switchrail", entry.rail);
|
||||
item_tooltip("Rail of the switch: 60E1, 49E1...");
|
||||
auto km{entry.km.has_value() ? *entry.km / 1000.0 : 0.0};
|
||||
field_row("Km of the start##switchkm");
|
||||
if (ImGui::InputDouble("##switchkm", &km, 0.0, 0.0, "%.3f", ImGuiInputTextFlags_EnterReturnsTrue))
|
||||
{
|
||||
entry.km = km * 1000.0;
|
||||
changed = true;
|
||||
}
|
||||
item_tooltip("Chainage of the start of the switch; taken from the horizontal alignment kept in the scenery when the switch lies on one");
|
||||
ImGui::EndTable();
|
||||
}
|
||||
item_tooltip("Chainage of the start of the switch; taken from the horizontal alignment kept in the scenery when the switch lies on one");
|
||||
ImGui::PopItemWidth();
|
||||
if (changed)
|
||||
{
|
||||
switch_store::put(entry, entry.layer);
|
||||
|
||||
Reference in New Issue
Block a user