From 65d9d9a0d86997fd333e3f000ebccc1a9498cace Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Wed, 22 Mar 2023 21:30:42 +0100 Subject: [PATCH] Make Violet's button dialogue work in cutscene test This was easier than I expected - just add an optional buttons="1" attribute to cutscenes.xml. It's treated like the speaker attribute - it's only there as context for the translator, and for the cutscene test. --- desktop_version/lang/ca/cutscenes.xml | 2 +- desktop_version/lang/de/cutscenes.xml | 2 +- desktop_version/lang/en/cutscenes.xml | 2 +- desktop_version/lang/eo/cutscenes.xml | 2 +- desktop_version/lang/es/cutscenes.xml | 2 +- desktop_version/lang/fr/cutscenes.xml | 2 +- desktop_version/lang/it/cutscenes.xml | 2 +- desktop_version/lang/nl/cutscenes.xml | 2 +- desktop_version/lang/pt_BR/cutscenes.xml | 2 +- desktop_version/lang/pt_PT/cutscenes.xml | 2 +- desktop_version/lang/ru/cutscenes.xml | 2 +- desktop_version/lang/tr/cutscenes.xml | 2 +- desktop_version/src/LocalizationMaint.cpp | 8 +++++++- desktop_version/src/Script.cpp | 12 ++++++++++-- desktop_version/src/Script.h | 2 +- 15 files changed, 30 insertions(+), 16 deletions(-) diff --git a/desktop_version/lang/ca/cutscenes.xml b/desktop_version/lang/ca/cutscenes.xml index 957d51c6..074c76bc 100644 --- a/desktop_version/lang/ca/cutscenes.xml +++ b/desktop_version/lang/ca/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/de/cutscenes.xml b/desktop_version/lang/de/cutscenes.xml index a7943750..25f27ed3 100644 --- a/desktop_version/lang/de/cutscenes.xml +++ b/desktop_version/lang/de/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/en/cutscenes.xml b/desktop_version/lang/en/cutscenes.xml index 4fc2715c..fec382e6 100644 --- a/desktop_version/lang/en/cutscenes.xml +++ b/desktop_version/lang/en/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/eo/cutscenes.xml b/desktop_version/lang/eo/cutscenes.xml index 6c878126..2a8e01af 100644 --- a/desktop_version/lang/eo/cutscenes.xml +++ b/desktop_version/lang/eo/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/es/cutscenes.xml b/desktop_version/lang/es/cutscenes.xml index 3586b0e0..7aa80be2 100644 --- a/desktop_version/lang/es/cutscenes.xml +++ b/desktop_version/lang/es/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/fr/cutscenes.xml b/desktop_version/lang/fr/cutscenes.xml index 81d78f15..cba09ef9 100644 --- a/desktop_version/lang/fr/cutscenes.xml +++ b/desktop_version/lang/fr/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/it/cutscenes.xml b/desktop_version/lang/it/cutscenes.xml index 8f736ae7..651256db 100644 --- a/desktop_version/lang/it/cutscenes.xml +++ b/desktop_version/lang/it/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/nl/cutscenes.xml b/desktop_version/lang/nl/cutscenes.xml index 0e68f892..d708cb2f 100644 --- a/desktop_version/lang/nl/cutscenes.xml +++ b/desktop_version/lang/nl/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/pt_BR/cutscenes.xml b/desktop_version/lang/pt_BR/cutscenes.xml index 2b7728c6..27ea9f54 100644 --- a/desktop_version/lang/pt_BR/cutscenes.xml +++ b/desktop_version/lang/pt_BR/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/pt_PT/cutscenes.xml b/desktop_version/lang/pt_PT/cutscenes.xml index 46177fec..2ff2367d 100644 --- a/desktop_version/lang/pt_PT/cutscenes.xml +++ b/desktop_version/lang/pt_PT/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/ru/cutscenes.xml b/desktop_version/lang/ru/cutscenes.xml index e1a81e1a..3a1a7966 100644 --- a/desktop_version/lang/ru/cutscenes.xml +++ b/desktop_version/lang/ru/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/lang/tr/cutscenes.xml b/desktop_version/lang/tr/cutscenes.xml index 67f1811a..4599792a 100644 --- a/desktop_version/lang/tr/cutscenes.xml +++ b/desktop_version/lang/tr/cutscenes.xml @@ -80,7 +80,7 @@ - + diff --git a/desktop_version/src/LocalizationMaint.cpp b/desktop_version/src/LocalizationMaint.cpp index a5ef5270..716bd043 100644 --- a/desktop_version/src/LocalizationMaint.cpp +++ b/desktop_version/src/LocalizationMaint.cpp @@ -289,6 +289,9 @@ static void sync_lang_file(const std::string& langcode) subElem->DeleteAttribute("pad_right"); subElem->DeleteAttribute("padtowidth"); + bool buttons = subElem->BoolAttribute("buttons", false); + subElem->DeleteAttribute("buttons"); // we want this at the end... + if (format->text != NULL) subElem->SetAttribute("translation", format->text); if (format->tt) @@ -310,6 +313,8 @@ static void sync_lang_file(const std::string& langcode) } if (format->padtowidth != 0) subElem->SetAttribute("padtowidth", format->padtowidth); + if (buttons) + subElem->SetAttribute("buttons", 1); } } @@ -546,7 +551,8 @@ bool populate_cutscene_test(const char* script_id) script.add_test_line( speaker, eng, - subElem->UnsignedAttribute("case", 1) + subElem->UnsignedAttribute("case", 1), + subElem->BoolAttribute("buttons", false) ); } } diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index ffa213f3..341a5865 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3608,8 +3608,12 @@ void scriptclass::loadalts(const std::string& processed, const std::string& raw) } } -void scriptclass::add_test_line(const std::string& speaker, const std::string& english, char textcase) -{ +void scriptclass::add_test_line( + const std::string& speaker, + const std::string& english, + const char textcase, + const bool textbuttons +) { if (speaker == "gray") { add("squeak(terminal)"); @@ -3622,6 +3626,10 @@ void scriptclass::add_test_line(const std::string& speaker, const std::string& e add("text("+speaker+",0,0,1)"); add(english); add("position(center)"); + if (textbuttons) + { + add("textbuttons()"); + } add("speak_active"); } diff --git a/desktop_version/src/Script.h b/desktop_version/src/Script.h index 476d236c..023d2620 100644 --- a/desktop_version/src/Script.h +++ b/desktop_version/src/Script.h @@ -68,7 +68,7 @@ public: bool loadcustom(const std::string& t); void loadalts(const std::string& processed, const std::string& raw); - void add_test_line(const std::string& speaker, const std::string& english, char textcase); + void add_test_line(const std::string& speaker, const std::string& english, char textcase, bool textbuttons); void loadtest(const std::string& name); void inline add(const std::string& t)