mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user