Implement CSV / TSV import (#45)

- add csv/tsv importer
- add `make_map` script function
- add `alt name` field property
- add `construction script` field property
- add `construction script` game property
This commit is contained in:
GenevensiS
2025-06-09 04:53:33 +02:00
committed by GitHub
parent 6cac4ae0dc
commit 87fbc0e80e
21 changed files with 521 additions and 63 deletions
+9
View File
@@ -137,6 +137,15 @@ void uncanonical_name_form_in_place(String& str) {
}
}
String unified_form(String& str) {
str = trim(str);
for (String::iterator it = str.begin(); it != str.end(); ++it) {
if (*it == ' ') *it = '_';
else *it = toLower(*it);
}
return str;
}
String name_to_caption(const String& str) {
String ret;
ret.reserve(str.size());
+4 -1
View File
@@ -241,7 +241,10 @@ void uncanonical_name_form_in_place(String&);
inline String uncanonical_name_form(String s) {
uncanonical_name_form_in_place(s);
return s;
}
}
/// Convert a field name to canonical form, then to lower case, then trim it
String unified_form(String&);
/// Convert a field name to a string that can be shown to the user
String name_to_caption(const String&);
+3
View File
@@ -108,6 +108,9 @@ enum ChildMenuID {
ID_CARD_ROTATE_270,
// CardList
ID_SELECT_COLUMNS,
ID_CARD_ADD_CSV,
ID_CARD_ADD_CSV_SEP,
ID_CARD_ADD_CSV_BROWSE,
// Keyword menu
ID_KEYWORD_ADD = 6101,