Implement unique IDs and card linking

This commit is contained in:
GenevensiS
2025-08-11 16:17:13 +02:00
committed by GitHub
parent 13406b946c
commit 3bf9de18b1
100 changed files with 2432 additions and 1219 deletions
+2 -2
View File
@@ -196,7 +196,7 @@ bool Package::existsIn(const String& file) {
if (filename.find(_(".mse-")) != String::npos) {
return false;
}
}
}
unique_ptr<wxInputStream> stream;
if (it != files.end() && it->second.wasWritten()) {
@@ -216,7 +216,7 @@ bool Package::existsIn(const String& file) {
return false;
}
return stream && stream->IsOk();
}
}
unique_ptr<wxInputStream> Package::openIn(const String& file) {
if (!file.empty() && file.GetChar(0) == _('/')) {
+1 -1
View File
@@ -107,7 +107,7 @@ bool PackageManager::existsInPackage(const String& name) {
}
}
throw FileNotFoundError(name, _("No package name specified, use '/package/filename'"));
}
}
pair<unique_ptr<wxInputStream>,Packaged*> PackageManager::openFileFromPackage(Packaged* package, const String& name) {
if (!name.empty() && name.GetChar(0) == _('/')) {
+4 -4
View File
@@ -357,10 +357,10 @@ template <> void Reader::handle(Vector2D& vec) {
template <> void Reader::handle(LocalFileName& f) {
f = LocalFileName::fromReadString(this->getValue());
}
String Reader::addLocale(String filename) {
return filename + _("_") + settings.locale;
}
String Reader::addLocale(String filename) {
return filename + _("_") + settings.locale;
}
// ----------------------------------------------------------------------------- : EnumReader
+4 -4
View File
@@ -116,9 +116,9 @@ public:
/// The package being read from
inline Packaged* getPackage() const { return package; }
String addLocale(String);
String addLocale(String);
/// Set the value that will be returned by the next getValue() call (may mess up the state of the reader)
inline void setValue(const String& value) { state = UNHANDLED; previous_value = value; };
@@ -180,7 +180,7 @@ private:
/** Maybe the key is "include file" */
template <typename T>
void unknownKey(T& v) {
if (key == _("include_file") || key == _("include_localized_file")) {
if (key == _("include_file") || key == _("include_localized_file")) {
value = key == _("include_localized_file") ? addLocale(value) : value;
auto [stream, include_package] = openFileFromPackage(package, value);
Reader sub_reader(*stream, include_package, value, ignore_invalid);