sundry tweaks

- prevent infinite loop and warn when a game has no card fields
- choice fields are no longer ignored if they have no choices defined
- templates can now have the same name as their game folder (no hyphen needed)
- indent made by 4 spaces is now considered a tab (but will still produce a warning let's no kid ourselves)
This commit is contained in:
GenevensiS
2025-11-28 19:12:33 +01:00
parent 46ffe62f15
commit 614f69ab47
5 changed files with 15 additions and 7 deletions
+4 -4
View File
@@ -208,10 +208,10 @@ void Reader::readLine(bool in_string) {
size_t pos = line.find_first_of(_(':'), indent);
key = line.substr(indent, pos - indent);
if (!ignore_invalid && !in_string && starts_with(key, _(" "))) {
warning(_("key: '") + key + _("' starts with a space; only use TABs for indentation!"), 0, false);
// try to fix up: 8 spaces is a tab
while (starts_with(key, _(" "))) {
key = key.substr(8);
warning(String(_("key: '")) << key << _("' on line number ") << line_number << _(" starts with a space; only use TABs for indentation!"), 0, false);
// try to fix up: 4 spaces is a tab
while (starts_with(key, _(" "))) {
key = key.substr(4);
indent += 1;
}
}