mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-20 17:24:53 +02:00
fix(editor): signals move along their track again, and the editor finds the descriptions of the templates beside the game data
- a press on the mast of a selected signal grabbed the gizmo, whose up axis runs along the mast, and lifted the signal instead of moving it along the track; the gizmo gives way over a signal and while one is dragged - dragged beside its track, off every track, the signal follows the nearest place of the track it stands by instead of staying put - a drop away from any track, and a signal in a file the editor doesn't change, say so instead of doing nothing - a template without a //$e description of its own takes it from editor/templates/<its path in the scenery folder>; the header scripts write there with --sidecar, leaving the templates alone, so a check of the game files by the store doesn't take the descriptions away (the descriptions written into the templates on 8.10 and 11.10 were gone, and with them every signal and drive the editor knew)
This commit is contained in:
@@ -129,6 +129,14 @@ bool read_template(std::string const &File, template_text &Text, std::string &Er
|
||||
}
|
||||
linebegin = next;
|
||||
}
|
||||
// a template without a description of its own may have one beside the game data, in editor/templates, where the
|
||||
// scripts of tools/editor write it with --sidecar: a check of the game files doesn't take it away
|
||||
if (Text.yaml.empty())
|
||||
{
|
||||
std::ifstream beside{"editor/templates/" + File, std::ios_base::binary};
|
||||
if (beside.is_open())
|
||||
Text.yaml.assign(std::istreambuf_iterator<char>(beside), std::istreambuf_iterator<char>());
|
||||
}
|
||||
if (false == is_utf8(Text.yaml, extended))
|
||||
{
|
||||
Text.yaml = win1250_to_utf8(Text.yaml);
|
||||
@@ -752,7 +760,7 @@ include_entry examine(std::string const &File)
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
entry.described = false == text.lines.empty();
|
||||
entry.described = false == text.yaml.empty();
|
||||
if (false == entry.described)
|
||||
{
|
||||
entry.issue = "the template has no description";
|
||||
|
||||
Reference in New Issue
Block a user