Add cutscene test menu

This allows translators to test all text boxes in the scripts. It
doesn't run the scripts themselves - it only shows the basic appearance
of each text box individually, so context may be lost but it's good to
have a way to see any text boxes that might otherwise not be easily
seen because they require specific circumstances to appear.
This commit is contained in:
Dav999-v
2022-12-24 04:16:56 +01:00
committed by Misa Elizabeth Kai
parent 0ed7717dd5
commit 3937a12a85
18 changed files with 282 additions and 22 deletions

View File

@@ -14,6 +14,7 @@
#include "Graphics.h"
#include "KeyPoll.h"
#include "Localization.h"
#include "LocalizationMaint.h"
#include "LocalizationStorage.h"
#include "Map.h"
#include "Music.h"
@@ -2810,6 +2811,16 @@ void scriptclass::startgamemode(const enum StartMode mode)
}
#endif /* NO_CUSTOM_LEVELS */
case Start_CUTSCENETEST:
music.fadeout();
game.translator_exploring = true;
game.translator_cutscene_test = true;
game.startspecial(2);
game.mapheld = true;
loadtest(game.cutscenetest_menu_play_id);
break;
case Start_QUIT:
VVV_unreachable();
}
@@ -3056,6 +3067,7 @@ void scriptclass::hardreset(void)
game.translator_exploring = game.start_translator_exploring;
game.start_translator_exploring = false;
game.translator_exploring_allowtele = false;
game.translator_cutscene_test = false;
game.totalflips = 0;
game.hardestroom = loc::gettext_roomname(false, 13, 5, "Welcome Aboard", false);
@@ -3490,3 +3502,34 @@ void scriptclass::loadcustom(const std::string& t)
add("untilbars()");
}
}
void scriptclass::add_test_line(const std::string& speaker, const std::string& english, char textcase)
{
if (speaker == "gray")
{
add("squeak(terminal)");
}
else
{
add("squeak("+speaker+")");
}
add("textcase("+help.String(textcase)+")");
add("text("+speaker+",0,0,1)");
add(english);
add("position(center)");
add("speak_active");
}
void scriptclass::loadtest(const std::string& name)
{
// Another magic function, that turns language files into a demo script
position = 0;
commands.clear();
scriptname = name;
running = true;
loc::populate_cutscene_test(name.c_str());
add("endtext");
add("gamestate(3100)");
}