subtitles: Add more cutscenes to subtitle editor (#1588)

* fix repl-history saving

* subtitles: fix `\"` edge-case

* subtitles: add almost every remaining (current) cutscene

* merge: master

* subtitles: fix some crashes and disable `Remove Line` as it is broken
This commit is contained in:
Tyler Wilding
2022-07-02 15:32:52 -04:00
committed by GitHub
parent f763eb6bf0
commit 34d93e59ed
7 changed files with 405 additions and 56 deletions
+4 -8
View File
@@ -57,13 +57,9 @@ void ReplWrapper::add_to_history(const std::string& line) {
}
void ReplWrapper::save_history() {
std::filesystem::path path = file_util::get_user_config_dir();
file_util::create_dir_if_needed(path);
if (exists(path)) {
repl.history_save((path / ".opengoal.repl.history").string());
} else {
fmt::print("Couldn't save REPL history file to '{}'", path.string());
}
std::filesystem::path path = file_util::get_user_config_dir() / ".opengoal.repl.history";
file_util::create_dir_if_needed_for_file(path.string());
repl.history_save(path.string());
}
void ReplWrapper::load_history() {
@@ -71,7 +67,7 @@ void ReplWrapper::load_history() {
if (std::filesystem::exists(path)) {
repl.history_load(path.string());
} else {
fmt::print("Couldn't locate REPL history file at '{}'", path.string());
fmt::print("Couldn't locate REPL history file at '{}'\n", path.string());
}
}
+2 -1
View File
@@ -186,7 +186,8 @@ std::string get_file_path(const std::vector<std::string>& input) {
bool create_dir_if_needed(const std::filesystem::path& path) {
if (!std::filesystem::is_directory(path)) {
return std::filesystem::create_directories(path);
std::filesystem::create_directories(path);
return true;
}
return false;
}
+3
View File
@@ -189,6 +189,9 @@ std::string GameTextFontBank::convert_utf8_to_game_with_escape(const std::string
ASSERT(value < 256);
newstr.push_back(char(value));
i += 3;
} else if (p == '"') {
newstr.push_back(p);
i += 1;
} else {
throw std::runtime_error("unknown string escape code");
}