mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
nested folder error message
This commit is contained in:
+10
-2
@@ -227,8 +227,16 @@ unique_ptr<wxInputStream> Package::openIn(const String& file) {
|
||||
FileInfos::iterator it = files.find(normalize_internal_filename(file));
|
||||
if (it == files.end()) {
|
||||
// does it look like a relative filename?
|
||||
if (filename.find(_(".mse-")) != String::npos) {
|
||||
throw PackageError(_ERROR_2_("file not found package like", file, filename));
|
||||
if (size_t pos = filename.find(_(".mse-")) != String::npos) {
|
||||
// check for nested folder
|
||||
pos = filename.find_last_of(_("/\\"));
|
||||
String nestedFilename = filename + filename.SubString(pos, filename.size()) + wxFileName::GetPathSeparator() + file;
|
||||
if (wxFileExists(nestedFilename)) {
|
||||
throw PackageError(_ERROR_1_("nested folder", filename));
|
||||
}
|
||||
else {
|
||||
throw PackageError(_ERROR_2_("file not found package like", file, filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
unique_ptr<wxInputStream> stream;
|
||||
|
||||
Reference in New Issue
Block a user