diff --git a/.gitattributes b/.gitattributes index e89c8a29618..d391aca0835 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10253,7 +10253,6 @@ res/images/skins/default/bg_texture.jpg -text res/images/skins/default/font1.ttf -text res/images/skins/default/grid_icons.png -text res/images/skins/default/loader.gif -text -res/images/skins/default/sprite_creatures.jpg -text res/images/skins/default/sprite_foils.png -text res/images/skins/default/sprite_icons.png -text res/images/skins/rebel/bg_match.jpg -text diff --git a/res/images/skins/default/sprite_creatures.jpg b/res/images/skins/default/sprite_creatures.jpg deleted file mode 100644 index f914b2d8d18..00000000000 Binary files a/res/images/skins/default/sprite_creatures.jpg and /dev/null differ diff --git a/src/main/java/forge/quest/data/pet/QuestPetAbstract.java b/src/main/java/forge/quest/data/pet/QuestPetAbstract.java index 31d792431ab..a8c9cf24bc8 100644 --- a/src/main/java/forge/quest/data/pet/QuestPetAbstract.java +++ b/src/main/java/forge/quest/data/pet/QuestPetAbstract.java @@ -102,7 +102,7 @@ public abstract class QuestPetAbstract implements QuestStallPurchasable { /** *

- * getImageName. + * getIcon. *

* * @return a {@link java.lang.String} object. diff --git a/src/main/java/forge/quest/data/pet/QuestPetBird.java b/src/main/java/forge/quest/data/pet/QuestPetBird.java index 8c5f3ddf005..4b494d10d02 100644 --- a/src/main/java/forge/quest/data/pet/QuestPetBird.java +++ b/src/main/java/forge/quest/data/pet/QuestPetBird.java @@ -21,8 +21,8 @@ import javax.swing.ImageIcon; import forge.AllZone; import forge.Card; -import forge.Singletons; -import forge.view.toolbox.FSkin; +import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -106,13 +106,12 @@ public class QuestPetBird extends QuestPetAbstract { /** {@inheritDoc} */ @Override public final ImageIcon[] getAllIcons() { - final FSkin skin = Singletons.getView().getSkin(); + final String address = ForgeProps.getFile(NewConstants.IMAGE_TOKEN).getAbsolutePath(); - return new ImageIcon[] { - skin.getIcon(FSkin.CreatureIcons.ICO_BIRD1), - skin.getIcon(FSkin.CreatureIcons.ICO_BIRD2), - skin.getIcon(FSkin.CreatureIcons.ICO_BIRD3), - skin.getIcon(FSkin.CreatureIcons.ICO_BIRD4) - }; + return new ImageIcon[] { null, + new ImageIcon(address + "w_0_1_bird_pet_small.jpg"), + new ImageIcon(address + "w_1_1_bird_pet_small.jpg"), + new ImageIcon(address + "w_2_1_bird_pet_small.jpg"), + new ImageIcon(address + "w_2_1_bird_pet_first_strike_small.jpg") }; } } diff --git a/src/main/java/forge/quest/data/pet/QuestPetCrocodile.java b/src/main/java/forge/quest/data/pet/QuestPetCrocodile.java index b083187bdaa..bcfea101c68 100644 --- a/src/main/java/forge/quest/data/pet/QuestPetCrocodile.java +++ b/src/main/java/forge/quest/data/pet/QuestPetCrocodile.java @@ -21,8 +21,8 @@ import javax.swing.ImageIcon; import forge.AllZone; import forge.Card; -import forge.Singletons; -import forge.view.toolbox.FSkin; +import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -102,12 +102,12 @@ public class QuestPetCrocodile extends QuestPetAbstract { /** {@inheritDoc} */ @Override public final ImageIcon[] getAllIcons() { - final FSkin skin = Singletons.getView().getSkin(); - return new ImageIcon[] { - skin.getIcon(FSkin.CreatureIcons.ICO_CROC1), - skin.getIcon(FSkin.CreatureIcons.ICO_CROC2), - skin.getIcon(FSkin.CreatureIcons.ICO_CROC3), - skin.getIcon(FSkin.CreatureIcons.ICO_CROC4) - }; + final String address = ForgeProps.getFile(NewConstants.IMAGE_TOKEN).getAbsolutePath(); + + return new ImageIcon[] { null, + new ImageIcon(address + "b_1_1_crocodile_pet_small.jpg"), + new ImageIcon(address + "b_2_1_crocodile_pet_small.jpg"), + new ImageIcon(address + "b_3_1_crocodile_pet_small.jpg"), + new ImageIcon(address + "b_3_1_crocodile_pet_swampwalk_small.jpg") }; } } diff --git a/src/main/java/forge/quest/data/pet/QuestPetHound.java b/src/main/java/forge/quest/data/pet/QuestPetHound.java index 9c144383a50..9b54f194bff 100644 --- a/src/main/java/forge/quest/data/pet/QuestPetHound.java +++ b/src/main/java/forge/quest/data/pet/QuestPetHound.java @@ -21,11 +21,11 @@ import javax.swing.ImageIcon; import forge.AllZone; import forge.Card; -import forge.Singletons; import forge.card.abilityfactory.AbilityFactory; import forge.card.trigger.Trigger; import forge.card.trigger.TriggerHandler; -import forge.view.toolbox.FSkin; +import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -118,13 +118,12 @@ public class QuestPetHound extends QuestPetAbstract { /** {@inheritDoc} */ @Override public final ImageIcon[] getAllIcons() { - final FSkin skin = Singletons.getView().getSkin(); + final String address = ForgeProps.getFile(NewConstants.IMAGE_TOKEN).getAbsolutePath(); - return new ImageIcon[] { - skin.getIcon(FSkin.CreatureIcons.ICO_HOUND1), - skin.getIcon(FSkin.CreatureIcons.ICO_HOUND2), - skin.getIcon(FSkin.CreatureIcons.ICO_HOUND3), - skin.getIcon(FSkin.CreatureIcons.ICO_HOUND4) - }; + return new ImageIcon[] { null, + new ImageIcon(address + "r_1_1_hound_pet_small.jpg"), + new ImageIcon(address + "r_1_1_hound_pet_haste_small.jpg"), + new ImageIcon(address + "r_2_1_hound_pet_small.jpg"), + new ImageIcon(address + "r_2_1_hound_pet_alone_small.jpg") }; } } diff --git a/src/main/java/forge/quest/data/pet/QuestPetPlant.java b/src/main/java/forge/quest/data/pet/QuestPetPlant.java index a75ad7ef5d7..670d10d67d4 100644 --- a/src/main/java/forge/quest/data/pet/QuestPetPlant.java +++ b/src/main/java/forge/quest/data/pet/QuestPetPlant.java @@ -22,12 +22,12 @@ import javax.swing.ImageIcon; import forge.AllZone; import forge.Card; import forge.Constant; -import forge.Singletons; import forge.card.cost.Cost; import forge.card.spellability.AbilityActivated; import forge.card.spellability.SpellAbility; +import forge.properties.ForgeProps; +import forge.properties.NewConstants; import forge.quest.data.bazaar.QuestStallManager; -import forge.view.toolbox.FSkin; /** *

@@ -122,10 +122,8 @@ public class QuestPetPlant extends QuestPetAbstract { *

*/ public QuestPetPlant() { - super( - "Plant", - "Start each of your battles with this lush, verdant plant on your side. Excellent at blocking the nastiest of critters!", - 6); + super("Plant", "Start each of your battles with this lush, verdant plant on your side." + + "Excellent at blocking the nastiest of critters!", 6); } /** {@inheritDoc} */ @@ -154,16 +152,15 @@ public class QuestPetPlant extends QuestPetAbstract { /** {@inheritDoc} */ @Override public final ImageIcon[] getAllIcons() { - final FSkin skin = Singletons.getView().getSkin(); + final String address = ForgeProps.getFile(NewConstants.IMAGE_TOKEN).getAbsolutePath(); - return new ImageIcon[] { - skin.getIcon(FSkin.CreatureIcons.ICO_PLANT1), - skin.getIcon(FSkin.CreatureIcons.ICO_PLANT2), - skin.getIcon(FSkin.CreatureIcons.ICO_PLANT3), - skin.getIcon(FSkin.CreatureIcons.ICO_PLANT4), - skin.getIcon(FSkin.CreatureIcons.ICO_PLANT5), - skin.getIcon(FSkin.CreatureIcons.ICO_PLANT6) - }; + return new ImageIcon[] { null, + new ImageIcon(address + "g_0_1_plant_wall_small.jpg"), + new ImageIcon(address + "g_0_2_plant_wall_small.jpg"), + new ImageIcon(address + "g_0_3_plant_wall_small.jpg"), + new ImageIcon(address + "g_1_3_plant_wall_small.jpg"), + new ImageIcon(address + "g_1_3_plant_wall_deathtouch_small.jpg"), + new ImageIcon(address + "g_1_4_plant_wall_small.jpg") }; } /** {@inheritDoc} */ diff --git a/src/main/java/forge/quest/data/pet/QuestPetWolf.java b/src/main/java/forge/quest/data/pet/QuestPetWolf.java index 1cfa9204283..49085697a32 100644 --- a/src/main/java/forge/quest/data/pet/QuestPetWolf.java +++ b/src/main/java/forge/quest/data/pet/QuestPetWolf.java @@ -21,8 +21,8 @@ import javax.swing.ImageIcon; import forge.AllZone; import forge.Card; -import forge.Singletons; -import forge.view.toolbox.FSkin; +import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -103,12 +103,12 @@ public class QuestPetWolf extends QuestPetAbstract { /** {@inheritDoc} */ @Override public final ImageIcon[] getAllIcons() { - final FSkin skin = Singletons.getView().getSkin(); - return new ImageIcon[] { - skin.getIcon(FSkin.CreatureIcons.ICO_WOLF1), - skin.getIcon(FSkin.CreatureIcons.ICO_WOLF2), - skin.getIcon(FSkin.CreatureIcons.ICO_WOLF3), - skin.getIcon(FSkin.CreatureIcons.ICO_WOLF4) - }; + final String address = ForgeProps.getFile(NewConstants.IMAGE_TOKEN).getAbsolutePath(); + + return new ImageIcon[] { null, + new ImageIcon(address + "g_1_1_wolf_pet_small.jpg"), + new ImageIcon(address + "g_1_2_wolf_pet_small.jpg"), + new ImageIcon(address + "g_2_2_wolf_pet_small.jpg"), + new ImageIcon(address + "g_2_2_wolf_pet_flanking_small.jpg") }; } } diff --git a/src/main/java/forge/view/toolbox/FSkin.java b/src/main/java/forge/view/toolbox/FSkin.java index 152ac9a505a..45fa9d87f88 100644 --- a/src/main/java/forge/view/toolbox/FSkin.java +++ b/src/main/java/forge/view/toolbox/FSkin.java @@ -240,42 +240,6 @@ public class FSkin { public int[] getCoords() { return coords; } } - /** */ - public enum CreatureIcons implements SkinProp, Coords { /** */ - ICO_BIRD1 (new int[] {0, 2280, 400, 570}), /** */ - ICO_BIRD2 (new int[] {400, 2280, 400, 570}), /** */ - ICO_BIRD3 (new int[] {800, 2280, 400, 570}), /** */ - ICO_BIRD4 (new int[] {1200, 2280, 400, 570}), /** */ - - ICO_PLANT1 (new int[] {0, 0, 400, 570}), /** */ - ICO_PLANT2 (new int[] {400, 0, 400, 570}), /** */ - ICO_PLANT3 (new int[] {800, 0, 400, 570}), /** */ - ICO_PLANT4 (new int[] {1200, 0, 400, 570}), /** */ - ICO_PLANT5 (new int[] {0, 570, 400, 570}), /** */ - ICO_PLANT6 (new int[] {400, 570, 400, 570}), /** */ - - ICO_HOUND1 (new int[] {0, 1710, 400, 570}), /** */ - ICO_HOUND2 (new int[] {400, 1710, 400, 570}), /** */ - ICO_HOUND3 (new int[] {800, 1710, 400, 570}), /** */ - ICO_HOUND4 (new int[] {1200, 1710, 400, 570}), /** */ - - ICO_CROC1 (new int[] {0, 2850, 400, 570}), /** */ - ICO_CROC2 (new int[] {400, 2850, 400, 570}), /** */ - ICO_CROC3 (new int[] {800, 2850, 400, 570}), /** */ - ICO_CROC4 (new int[] {1200, 2850, 400, 570}), /** */ - - ICO_WOLF1 (new int[] {0, 1140, 400, 570}), /** */ - ICO_WOLF2 (new int[] {400, 1140, 400, 570}), /** */ - ICO_WOLF3 (new int[] {800, 1140, 400, 570}), /** */ - ICO_WOLF4 (new int[] {1200, 1140, 400, 570}); - - private int[] coords; - /** @param xy   int[] coordinates */ - CreatureIcons(int[] xy) { this.coords = xy; } - /** @return int[] */ - public int[] getCoords() { return coords; } - } - /** */ public enum ForgeIcons implements SkinProp, Coords { /** */ ICO_EDIT (new int[] {640, 500, 20, 20}), /** */ @@ -353,7 +317,6 @@ public class FSkin { FILE_SKINS_DIR = "res/images/skins/", FILE_ICON_SPRITE = "sprite_icons.png", FILE_FOIL_SPRITE = "sprite_foils.png", - FILE_CREATURE_SPRITE = "sprite_creatures.jpg", FILE_FONT = "font1.ttf", FILE_SPLASH = "bg_splash.png", FILE_MATCH_BG = "bg_match.jpg", @@ -364,7 +327,7 @@ public class FSkin { private final String defaultDir; private final String preferredName; private Font font; - private BufferedImage bimDefaultSprite, bimPreferredSprite, bimFoils, bimCreatures; + private BufferedImage bimDefaultSprite, bimPreferredSprite, bimFoils; private int preferredH, preferredW; private FProgressBar barProgress; @@ -447,20 +410,17 @@ public class FSkin { }); // Grab and test various sprite files. - barProgress.setMaximum(4); + barProgress.setMaximum(3); final File f1 = new File(defaultDir + FILE_ICON_SPRITE); final File f2 = new File(preferredDir + FILE_ICON_SPRITE); - final File f3 = new File(defaultDir + FILE_CREATURE_SPRITE); - final File f4 = new File(defaultDir + FILE_FOIL_SPRITE); + final File f3 = new File(defaultDir + FILE_FOIL_SPRITE); try { bimDefaultSprite = ImageIO.read(f1); barProgress.increment(); bimPreferredSprite = ImageIO.read(f2); barProgress.increment(); - bimCreatures = ImageIO.read(f3); - barProgress.increment(); - bimFoils = ImageIO.read(f4); + bimFoils = ImageIO.read(f3); barProgress.increment(); preferredH = bimPreferredSprite.getHeight(); @@ -485,27 +445,11 @@ public class FSkin { // Exceptions handled inside method. this.font = GuiUtils.newFont(FILE_SKINS_DIR + preferredName + "/" + FILE_FONT); plainFonts = new HashMap(); - setFont(10); - setFont(11); - setFont(12); - setFont(13); - setFont(14); - setFont(15); - setFont(16); - setFont(18); - setFont(20); - setFont(22); - boldFonts = new HashMap(); - setBoldFont(12); - setBoldFont(14); - setBoldFont(16); - setBoldFont(18); - setBoldFont(20); - italicFonts = new HashMap(); - setItalicFont(12); - setItalicFont(14); + for (int i = 10; i <= 22; i++) { setFont(i); } + for (int i = 10; i <= 20; i += 2) { setBoldFont(i); } + for (int i = 12; i <= 14; i += 2) { setItalicFont(i); } // Put various images into map (except sprite and splash). // Exceptions handled inside method. @@ -524,17 +468,14 @@ public class FSkin { for (ColorlessManaImages e : ColorlessManaImages.values()) { this.setImage(e); } for (GameplayImages e : GameplayImages.values()) { this.setImage(e); } - // Foils and creatures have a separate sprite, so use specific methods. + // Foils have a separate sprite, so uses a specific method. for (Foils e : Foils.values()) { this.setFoil(e); } - for (CreatureIcons e : CreatureIcons.values()) { this.setCreature(e); } // Clear references to buffered images - this.bimCreatures.flush(); this.bimDefaultSprite.flush(); this.bimFoils.flush(); this.bimPreferredSprite.flush(); - this.bimCreatures = null; this.bimDefaultSprite = null; this.bimFoils = null; this.bimPreferredSprite = null; @@ -748,16 +689,6 @@ public class FSkin { this.images.put(s0, bimFoils.getSubimage(x0, y0, w0, h0)); } - private void setCreature(final SkinProp s0) { - int[] coords = ((Coords) s0).getCoords(); - int x0 = coords[0]; - int y0 = coords[1]; - int w0 = coords[2]; - int h0 = coords[3]; - - this.icons.put(s0, new ImageIcon(bimCreatures.getSubimage(x0, y0, w0, h0))); - } - private void setColor(final SkinProp s0) { int[] coords = ((Coords) s0).getCoords(); int x0 = coords[0];