mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-02 06:59:13 +01:00
refactor(editor): the helpers repeated over the editor files are shared
The name of a node or "(no name)" was written out in twenty places and four local functions, a lower-case copy of a text in four files, the test for a number, the file name of a template made comparable and the heading of a direction in three and two, the green main button of a panel in five and the key=value parameters of a self-test command in five. Each of them is one helper now: name_of, tall_button_height and main_button with the panel helpers, numeric with format, normalized with the include helpers, heading_of with the plan geometry and selftest_values with the tools; lower gives way to ToLower.
This commit is contained in:
@@ -1493,7 +1493,7 @@ void editor_mode::profile_apply(bool const Terrain)
|
||||
state.status = format(STR_P("Grade line applied: %zu path changed, %zu added, largest departure %.3f m", "Grade line applied: %zu paths changed, %zu added, largest departure %.3f m", changed), changed, added, state.departure);
|
||||
if (false == scene::Layers.empty())
|
||||
state.status += STR_C("\nThe paths and the design (//$p lines) go to the scenery files on save");
|
||||
auto const name = [](TTrack const *Track) { return Track->name().empty() ? std::string{STR_C("(no name)")} : Track->name(); };
|
||||
auto const name = [](TTrack const *Track) { return name_of(*Track); };
|
||||
auto const closed{std::count_if(gaps.begin(), gaps.end(), [](auto const &Gap) { return Gap.closed; })};
|
||||
if (closed > 0)
|
||||
state.status += STR_C("\nPaths off the route brought to its height:");
|
||||
|
||||
Reference in New Issue
Block a user