mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Add dark icon property
This commit is contained in:
+13
-3
@@ -572,6 +572,7 @@ IMPLEMENT_REFLECTION(Packaged) {
|
||||
REFLECT(full_name);
|
||||
REFLECT(folder_name);
|
||||
REFLECT_N("icon", icon_filename);
|
||||
REFLECT_N("dark_icon", dark_icon_filename);
|
||||
REFLECT_NO_SCRIPT(position_hint);
|
||||
REFLECT(installer_group);
|
||||
REFLECT(version);
|
||||
@@ -584,9 +585,18 @@ Packaged::Packaged()
|
||||
, fully_loaded(true)
|
||||
{}
|
||||
|
||||
unique_ptr<wxInputStream> Packaged::openIconFile() {
|
||||
if (!icon_filename.empty()) {
|
||||
return openIn(icon_filename);
|
||||
unique_ptr<wxInputStream> Packaged::openIconFile() {
|
||||
String filename = icon_filename;
|
||||
if (!dark_icon_filename.empty()) {
|
||||
if (settings.darkMode()) {
|
||||
wxFileName fn (dark_icon_filename);
|
||||
String extension = fn.GetExt();
|
||||
filename = dark_icon_filename.Replace(extension, _("")) + "_dark" + extension;
|
||||
}
|
||||
else filename = dark_icon_filename;
|
||||
}
|
||||
if (!filename.empty()) {
|
||||
return openIn(filename);
|
||||
} else {
|
||||
return unique_ptr<wxInputStream>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user