diff --git a/forge-gui-desktop/src/main/java/forge/GuiDesktop.java b/forge-gui-desktop/src/main/java/forge/GuiDesktop.java index 76fe004e9e8..b8837cb5611 100644 --- a/forge-gui-desktop/src/main/java/forge/GuiDesktop.java +++ b/forge-gui-desktop/src/main/java/forge/GuiDesktop.java @@ -121,6 +121,12 @@ public class GuiDesktop implements IGuiBase { return Singletons.getControl().mayShowCard(card); } + @Override + public ISkinImage getSkinIcon(FSkinProp skinProp) { + if (skinProp == null) { return null; } + return FSkin.getIcon(skinProp); + } + @Override public ISkinImage getUnskinnedIcon(String path) { return new FSkin.UnskinnedIcon(path); diff --git a/forge-gui-mobile/src/forge/GuiMobile.java b/forge-gui-mobile/src/forge/GuiMobile.java index 0ec2edd8b7a..805681885d8 100644 --- a/forge-gui-mobile/src/forge/GuiMobile.java +++ b/forge-gui-mobile/src/forge/GuiMobile.java @@ -52,7 +52,7 @@ import forge.util.WaitRunnable; import forge.util.gui.SGuiChoose; public class GuiMobile implements IGuiBase { - + private final String assetsDir; public GuiMobile(String assetsDir0) { @@ -99,6 +99,12 @@ public class GuiMobile implements IGuiBase { return FControl.mayShowCard(card); } + @Override + public ISkinImage getSkinIcon(FSkinProp skinProp) { + if (skinProp == null) { return null; } + return FSkin.getImages().get(skinProp); + } + @Override public ISkinImage getUnskinnedIcon(String path) { return new FTextureImage(new Texture(path)); diff --git a/forge-gui/res/quest/bazaar/index.xml b/forge-gui/res/quest/bazaar/index.xml index 12954447173..a568699b28c 100644 --- a/forge-gui/res/quest/bazaar/index.xml +++ b/forge-gui/res/quest/bazaar/index.xml @@ -4,14 +4,14 @@ 80 - + The walls of this alchemist's stall are covered with shelves with potions, oils, powders, poultices and elixirs, each meticulously labeled. Elixir of Life Pound of Flesh - + A large book large enough to be seen from the outside rests on the Banker's desk. Bank Membership @@ -20,13 +20,13 @@ Cash Stakes - + Tomes of different sizes are stacked in man-high towers. Sleight - + This adventurer's market has a tool for every need ... or so the plaque on the wall claims. Map @@ -34,13 +34,13 @@ Charm of Vigor - + The smells of the one hundred and one different plants forms a unique fragrance. Plant - + This large menagerie echoes with a multitude of animal noises. Ape @@ -52,28 +52,28 @@ - + These volumes explain how to perform the most difficult of sleights. Effect: Your first mulligan is free. - + These ancient charts should facilitate navigation during your travels significantly. Effect: Quest challenges become available more frequently - + This coin is believed to give good luck to its owner. Effect: Improves the chance of getting a random rare after each match by 15%. - + Land owners have a strong voice in community matters. Effect: Gives a bonus of %d%% to match winnings. Effect: Improves sell percentage by %.2f%%. - + This extremely comfortable airship allows for more efficient and safe travel to faraway destinations. @@ -81,32 +81,32 @@ Effect: Quest challenges become available more frequently. Effect: +3 life Effect: Activate once for a new set of challenges (re-fuels after a challenge is attempted). - + The Alchemist welcomes contributions to his famous Elixir. But beware, you may build an immunity to its effects... Effect: Alchemist gives you %d credits. Effect: Reduces maximum life by 1." - + A salty sweet smell rises from the vials bubbling behind the counter. Effect: Gives +1 to maximum life. Fine Print: Loses effectiveness after 15 uses. + itemType="CHARM" icon="ICO_QUEST_CHARM"> A charm to ward off the fatigue of battle. Effect: You may have each match be best of 5 instead of 3. - + A written agreement with the Spell Shop to acquire cards you lose in an ante match from quest opponents. Effect: Cards lost in an ante match will be available immediately following the match in the Card Shop. - + A token certifying you as a member of the bank, giving you a greater selection of booster packs when you win. diff --git a/forge-gui/src/main/java/forge/interfaces/IGuiBase.java b/forge-gui/src/main/java/forge/interfaces/IGuiBase.java index effbb90e88e..a97fd1bb4b9 100644 --- a/forge-gui/src/main/java/forge/interfaces/IGuiBase.java +++ b/forge-gui/src/main/java/forge/interfaces/IGuiBase.java @@ -38,6 +38,7 @@ public interface IGuiBase { boolean isGuiThread(); String getAssetsDir(); boolean mayShowCard(Card card); + ISkinImage getSkinIcon(FSkinProp skinProp); ISkinImage getUnskinnedIcon(String path); void showBugReportDialog(String title, String text, boolean showExitAppBtn); int showOptionDialog(String message, String title, FSkinProp icon, String[] options, int defaultOption); diff --git a/forge-gui/src/main/java/forge/quest/bazaar/QuestItemBasic.java b/forge-gui/src/main/java/forge/quest/bazaar/QuestItemBasic.java index 959c270b61c..27acf8b7c7e 100644 --- a/forge-gui/src/main/java/forge/quest/bazaar/QuestItemBasic.java +++ b/forge-gui/src/main/java/forge/quest/bazaar/QuestItemBasic.java @@ -19,6 +19,8 @@ package forge.quest.bazaar; import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import forge.GuiBase; +import forge.assets.FSkinProp; import forge.assets.ISkinImage; import forge.quest.data.QuestAssets; @@ -66,6 +68,9 @@ public class QuestItemBasic implements IQuestBazaarItem { return this.basePrice; } + @XStreamAsAttribute + private final FSkinProp icon = null; + /** *

* Constructor for QuestItemAbstract. @@ -163,7 +168,7 @@ public class QuestItemBasic implements IQuestBazaarItem { */ @Override public ISkinImage getIcon(QuestAssets qA) { - return null; + return GuiBase.getInterface().getSkinIcon(icon); } /** diff --git a/forge-gui/src/main/java/forge/quest/bazaar/QuestStallDefinition.java b/forge-gui/src/main/java/forge/quest/bazaar/QuestStallDefinition.java index 50a02adbb30..2b9ad6ae48d 100644 --- a/forge-gui/src/main/java/forge/quest/bazaar/QuestStallDefinition.java +++ b/forge-gui/src/main/java/forge/quest/bazaar/QuestStallDefinition.java @@ -20,6 +20,8 @@ package forge.quest.bazaar; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import forge.GuiBase; +import forge.assets.FSkinProp; import forge.assets.ISkinImage; import java.util.ArrayList; @@ -45,7 +47,7 @@ public class QuestStallDefinition { private final String displayName; @XStreamAsAttribute - private final ISkinImage icon; + private final FSkinProp icon; private final String description; @@ -88,7 +90,7 @@ public class QuestStallDefinition { * @return the icon */ public ISkinImage getIcon() { - return icon; + return GuiBase.getInterface().getSkinIcon(icon); } /**