Support custom achievement images for mobile app

This commit is contained in:
drdev
2014-09-17 03:04:18 +00:00
parent d8cc47c8a3
commit 6d0f1364be
2 changed files with 20 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package forge.achievement;
import org.w3c.dom.Element;
import forge.FThreads;
import forge.GuiBase;
import forge.assets.FSkinProp;
import forge.assets.ISkinImage;
@@ -91,9 +92,14 @@ public abstract class Achievement {
customImage = null;
return;
}
String filename = ForgeConstants.CACHE_ACHIEVEMENT_PICS_DIR + imagePrefix + "_" + suffix + ".png";
final String filename = ForgeConstants.CACHE_ACHIEVEMENT_PICS_DIR + imagePrefix + "_" + suffix + ".png";
if (FileUtil.doesFileExist(filename)) {
customImage = GuiBase.getInterface().getUnskinnedIcon(filename);
FThreads.invokeInEdtNowOrLater(GuiBase.getInterface(), new Runnable() {
@Override
public void run() {
customImage = GuiBase.getInterface().getUnskinnedIcon(filename);
}
});
return;
}
customImage = null;