mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
subtitles-editor: Allow removing lines and fix some issues (#2573)
Allows for removing a line in the subtitle editor finally, also fixed the following: - The path the editor used didn't include the game name - Loading the subtitle project is too slow to do on startup now (4-5seconds in a debug build), do it on demand now
This commit is contained in:
@@ -468,7 +468,7 @@ void open_text_project(const std::string& kind,
|
||||
});
|
||||
}
|
||||
|
||||
GameSubtitleDB load_subtitle_project() {
|
||||
GameSubtitleDB load_subtitle_project(GameVersion game_version) {
|
||||
// Load the subtitle files
|
||||
GameSubtitleDB db;
|
||||
db.m_subtitle_groups = std::make_unique<GameSubtitleGroups>();
|
||||
@@ -476,8 +476,9 @@ GameSubtitleDB load_subtitle_project() {
|
||||
try {
|
||||
goos::Reader reader;
|
||||
std::vector<std::string> inputs;
|
||||
std::string subtitle_project =
|
||||
(file_util::get_jak_project_dir() / "game" / "assets" / "game_subtitle.gp").string();
|
||||
std::string subtitle_project = (file_util::get_jak_project_dir() / "game" / "assets" /
|
||||
version_to_game_name(game_version) / "game_subtitle.gp")
|
||||
.string();
|
||||
open_text_project("subtitle", subtitle_project, inputs);
|
||||
for (auto& filename : inputs) {
|
||||
auto code = reader.read_from_file({filename});
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/util/FontUtils.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
/*!
|
||||
* The text bank contains all lines (accessed with an ID) for a language.
|
||||
@@ -191,4 +192,4 @@ GameTextVersion parse_text_only_version(const goos::Object& data);
|
||||
void open_text_project(const std::string& kind,
|
||||
const std::string& filename,
|
||||
std::vector<std::string>& inputs);
|
||||
GameSubtitleDB load_subtitle_project();
|
||||
GameSubtitleDB load_subtitle_project(GameVersion game_version);
|
||||
|
||||
Reference in New Issue
Block a user