Added error messages when loading maps and dialogues.

This commit is contained in:
Kapendev 2024-06-28 15:48:27 +03:00
parent cdf4bf6107
commit 5deea003c1
2 changed files with 6 additions and 0 deletions

View file

@ -57,6 +57,10 @@ struct Dialogue {
load(path);
}
bool isEmpty() {
return units.length == 0;
}
bool hasChoices() {
return menu.length != 0;
}
@ -296,6 +300,7 @@ struct Dialogue {
if (path.length != 0) {
parse(loadTempText(path));
}
if (isEmpty) printfln("Error: The file `{}` does not exist.", path);
}
void free() {

View file

@ -468,6 +468,7 @@ struct TileMap {
if (path.length != 0) {
parse(loadTempText(path));
}
if (isEmpty) printfln("Error: The file `{}` does not exist.", path);
}
}