mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
More workingness, now accepts locally-stored resources!
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1158 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+4
-2
@@ -210,8 +210,10 @@ InputStreamP load_resource_text(const String& name) {
|
||||
int len = ::SizeofResource(wxGetInstance(), hResource);
|
||||
return new_shared2<wxMemoryInputStream>(data, len);
|
||||
#else
|
||||
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/") + name;
|
||||
return new_shared1<wxFileInputStream>(path);
|
||||
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/");
|
||||
static String local_path = wxStandardPaths::Get().GetUserDataDir() + _("/resource/");
|
||||
if (wxFileExists(path + name)) return new_shared1<wxFileInputStream>(path + name);
|
||||
else return new_shared1<wxFileInputStream>(local_path + name);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user