mirror of
https://github.com/open-goal/jak-project
synced 2026-05-22 22:44:32 -04:00
Fail building custom level if long_name is too long (#3966)
If long_name is too long, it will result in the level being invisible but the collide loading, lets detect this and point the user in correct direction to solve it with a clear error message. --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
// The "in-game" name of the level. Should be lower case, with dashes (GOAL symbol name)
|
||||
// the name of this file, and the folder this file is in must have the same name.
|
||||
// The long_name must also be 10 characters or fewer.
|
||||
"long_name": "test-zone",
|
||||
// The file name, should be upper case and 8 characters or less.
|
||||
"iso_name": "TESTZONE",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
// The "in-game" name of the level. Should be lower case, with dashes (GOAL symbol name)
|
||||
// the name of this file, and the folder this file is in must have the same name.
|
||||
// The long_name must also be 10 characters or fewer.
|
||||
"long_name": "test-zone",
|
||||
// The file name, should be upper case and 8 characters or less.
|
||||
"iso_name": "TESTZONE",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
// The "in-game" name of the level. Should be lower case, with dashes (GOAL symbol name)
|
||||
// the name of this file, and the folder this file is in must have the same name.
|
||||
// The long_name must also be 10 characters or fewer.
|
||||
"long_name": "test-zone",
|
||||
// The file name, should be upper case and 8 characters or less.
|
||||
"iso_name": "TESTZONE",
|
||||
|
||||
@@ -48,6 +48,9 @@ bool run_build_level(const std::string& input_file,
|
||||
// unk zero
|
||||
// name
|
||||
file.name = level_json.at("long_name").get<std::string>();
|
||||
ASSERT_MSG(file.name.size() <= 10,
|
||||
fmt::format("long_name over 10 characters ({} characters): '{}'", file.name.size(),
|
||||
file.name));
|
||||
// nick
|
||||
file.nickname = level_json.at("nickname").get<std::string>();
|
||||
// vis infos
|
||||
|
||||
@@ -42,6 +42,9 @@ bool run_build_level(const std::string& input_file,
|
||||
// unk zero
|
||||
// name
|
||||
file.name = level_json.at("long_name").get<std::string>();
|
||||
ASSERT_MSG(file.name.size() <= 10,
|
||||
fmt::format("long_name over 10 characters ({} characters): '{}'", file.name.size(),
|
||||
file.name));
|
||||
// nick
|
||||
file.nickname = level_json.at("nickname").get<std::string>();
|
||||
// vis infos
|
||||
|
||||
@@ -40,6 +40,9 @@ bool run_build_level(const std::string& input_file,
|
||||
// unk zero
|
||||
// name
|
||||
file.name = level_json.at("long_name").get<std::string>();
|
||||
ASSERT_MSG(file.name.size() <= 10,
|
||||
fmt::format("long_name over 10 characters ({} characters): '{}'", file.name.size(),
|
||||
file.name));
|
||||
// nick
|
||||
file.nickname = level_json.at("nickname").get<std::string>();
|
||||
// vis infos
|
||||
|
||||
Reference in New Issue
Block a user