mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Fixed many resource file names, removed raw-char matches input-char requirement for Linux operation.
WARNING: This version is unstable. High possibility of encountering a complete processor lockup (likely an infinite loop). Known bugs on Linux: Some fields are being drawn off-target (such as text) and they need to be fixed in order to allow compatibility. Different style files on different platforms would not be a good idea. The combined-editors are not working. When a text-replacement is made via "~", the cursor is placed before it and attempting to remove or select it causes a lockup. Symbol editor seems to be working fine. The symbol selection dialog causes a crash when used. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@194 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+8
-6
@@ -91,11 +91,12 @@ Image load_resource_image(const String& name) {
|
||||
#elif defined(__linux__)
|
||||
static String path = wxStandardPaths::Get().GetDataDir() + _("/resource/");
|
||||
String file = path + name.Lower();
|
||||
wxImage resource (file + _(".png"), wxBITMAP_TYPE_PNG);
|
||||
if (!resource.Ok()) resource.LoadFile (file + _(".bmp"), wxBITMAP_TYPE_BMP);
|
||||
if (!resource.Ok()) resource.LoadFile (file + _(".ico"), wxBITMAP_TYPE_ICO);
|
||||
if (!resource.Ok()) resource.LoadFile (file + _(".cur"), wxBITMAP_TYPE_CUR);
|
||||
if (!resource.Ok()) throw InternalError(String::Format(_("Resource not found: %s"), name.c_str()));
|
||||
wxImage resource;
|
||||
if (wxFileExists(file + _(".png"))) resource.LoadFile(file + _(".png"));
|
||||
else if (wxFileExists(file + _(".bmp"))) resource.LoadFile(file + _(".bmp"));
|
||||
else if (wxFileExists(file + _(".ico"))) resource.LoadFile(file + _(".ico"));
|
||||
else if (wxFileExists(file + _(".cur"))) resource.LoadFile(file + _(".cur"));
|
||||
if (!resource.Ok()) handle_error(InternalError(String(_("Cannot find resource file at ")) + file));
|
||||
return resource;
|
||||
#else
|
||||
#error Handling of resource loading needs to be declared.
|
||||
@@ -114,7 +115,8 @@ wxIcon load_resource_icon(const String& name) {
|
||||
#if defined(__WXMSW__)
|
||||
return wxIcon(_("icon/") + name);
|
||||
#else
|
||||
return wxIcon(_("icon/") + name + _(".ico"), wxBITMAP_TYPE_ICO);
|
||||
static String path = wxStandardPaths::Get().GetDataDir() + _("/icon/");
|
||||
return wxIcon(path + name + _(".ico"), wxBITMAP_TYPE_ICO);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user