18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-28 01:07:07 +01:00

feat(ui): names and texts of the data shown with their letters

MaSzyna-EU07/maszyna#94. What the panels took the marks off, they show as written, in utf-8:

- timetable panel: the relation, the train, the station rows (the column cut and filled by characters, a
  letter being more than one byte now)
- transcripts of the sounds and the assignment of a trainset, which lost their polish letters when read
- debug panel (event of the current signal, scan table) and the editor panels (names of nodes, layers,
  events, tracks and include files), which went through Bezogonkow()

Bezogonkow() and win1250_to_ascii() are left where the ascii form is what is wanted: file names, the python
dictionary, the multiplayer packets, the search key of the editor's station list.
This commit is contained in:
jerrrrycho
2026-11-18 23:50:07 +01:00
parent 022e59fde3
commit 4e0c2f71bb
4 changed files with 25 additions and 24 deletions

View File

@@ -38,8 +38,8 @@ TTranscripts::Add( std::string const &txt, bool /*backgorund*/ ) {
if( true == txt.empty() ) { return; }
std::string asciitext{ txt }; win1250_to_ascii( asciitext ); // TODO: launch relevant conversion table based on language
cParser parser( asciitext );
// the captions are read as their files have them (windows-1250, the newer ones utf-8) and shown with their letters
cParser parser( txt );
while( true == parser.getTokens( 3, false, "[]\n" ) ) {
float begin{ 0.f };
@@ -49,14 +49,14 @@ TTranscripts::Add( std::string const &txt, bool /*backgorund*/ ) {
>> begin
>> end
>> transcript;
AddLine( transcript, static_cast<float>(0.10 * begin), static_cast<float>(0.12 * end), false );
AddLine( data_text_to_utf8( transcript ), static_cast<float>(0.10 * begin), static_cast<float>(0.12 * end), false );
}
// try to handle malformed(?) cases with no show/hide times
std::string transcript; parser >> transcript;
while( false == transcript.empty() ) {
// WriteLog( "Transcript text with no display/hide times: \"" + transcript + "\"" );
AddLine( transcript, 0.0, static_cast<float>(0.12 * static_cast<double>(transcript.size())), false );
AddLine( data_text_to_utf8( transcript ), 0.0, static_cast<float>(0.12 * static_cast<double>(transcript.size())), false );
transcript = ""; parser >> transcript;
}
}