diff --git a/forge-core/src/main/java/forge/item/PaperCard.java b/forge-core/src/main/java/forge/item/PaperCard.java index 7ecbce6c09b..258d8d1977c 100644 --- a/forge-core/src/main/java/forge/item/PaperCard.java +++ b/forge-core/src/main/java/forge/item/PaperCard.java @@ -356,8 +356,8 @@ public class PaperCard implements Comparable, InventoryItemFromSet, @Override public String getImageKey(boolean altState) { - String noramlizedName = StringUtils.stripAccents(name); - String imageKey = ImageKeys.CARD_PREFIX + noramlizedName + CardDb.NameSetSeparator + String normalizedName = StringUtils.stripAccents(name); + String imageKey = ImageKeys.CARD_PREFIX + normalizedName + CardDb.NameSetSeparator + edition + CardDb.NameSetSeparator + artIndex; if (altState) { imageKey += ImageKeys.BACKFACE_POSTFIX; diff --git a/forge-gui-mobile/src/forge/adventure/data/AdventureEventData.java b/forge-gui-mobile/src/forge/adventure/data/AdventureEventData.java index 6c82dcc0e0b..eafd98fb022 100644 --- a/forge-gui-mobile/src/forge/adventure/data/AdventureEventData.java +++ b/forge-gui-mobile/src/forge/adventure/data/AdventureEventData.java @@ -365,15 +365,15 @@ public class AdventureEventData implements Serializable { for (PrintSheet ps : c.getPrintSheetsBySection()) { //exclude block with sets containing P9 cards.. if (ps.containsCardNamed("Black Lotus", 1) - || ps.containsCardNamed("Mox Emerald", 1) - || ps.containsCardNamed("Mox Pearl", 1) - || ps.containsCardNamed("Mox Ruby", 1) - || ps.containsCardNamed("Mox Sapphire", 1) - || ps.containsCardNamed("Mox Jet", 1) - || ps.containsCardNamed("Ancestral Recall", 1) - || ps.containsCardNamed("Timetwister", 1) - || ps.containsCardNamed("Time Walk", 1)) { - isOkay = false; + || ps.containsCardNamed("Mox Emerald", 1) + || ps.containsCardNamed("Mox Pearl", 1) + || ps.containsCardNamed("Mox Ruby", 1) + || ps.containsCardNamed("Mox Sapphire", 1) + || ps.containsCardNamed("Mox Jet", 1) + || ps.containsCardNamed("Ancestral Recall", 1) + || ps.containsCardNamed("Timetwister", 1) + || ps.containsCardNamed("Time Walk", 1)) { + isOkay = false; break; } } diff --git a/forge-gui-mobile/src/forge/adventure/data/RewardData.java b/forge-gui-mobile/src/forge/adventure/data/RewardData.java index 1e95f6ae534..1184270922d 100644 --- a/forge-gui-mobile/src/forge/adventure/data/RewardData.java +++ b/forge-gui-mobile/src/forge/adventure/data/RewardData.java @@ -3,17 +3,20 @@ package forge.adventure.data; import com.badlogic.gdx.utils.Array; import com.google.common.collect.Iterables; import forge.StaticData; -import forge.adventure.util.CardUtil; -import forge.adventure.util.Config; -import forge.adventure.util.Current; -import forge.adventure.util.Reward; +import forge.adventure.util.*; import forge.adventure.world.WorldSave; +import forge.card.CardEdition; import forge.deck.Deck; import forge.item.PaperCard; +import forge.model.FModel; +import forge.util.Aggregates; import forge.util.IterableUtil; +import forge.util.StreamUtil; import java.io.Serializable; import java.util.*; +import java.util.function.Predicate; + /** * Data class that will be used to read Json configuration files @@ -216,6 +219,38 @@ public class RewardData implements Serializable { } } break; + case "cardPackShop": + { + if(colors == null) { + CardEdition.Collection editions = FModel.getMagicDb().getEditions(); + Predicate filter = CardEdition.Predicates.CAN_MAKE_BOOSTER; + List allEditions = new ArrayList<>(); + StreamUtil.stream(editions) + .filter(filter) + .filter(CardEdition::hasBoosterTemplate) + .forEach(allEditions::add); + ConfigData configData = Config.instance().getConfigData(); + for (String restricted : configData.restrictedEditions) { + allEditions.removeIf(q -> q.getName().equals(restricted)); + } + System.out.println(allEditions); + for(int i=0;i cards = BoosterPack.fromColor(color).getCards(); + Deck output = new Deck(); + output.getMain().add(cards); + String editionName = color + " Booster Pack"; + output.setName(editionName); + output.setComment(color); + return output; + } public List getJumpstartBoosters(CardBlock block, int count) { //Get all candidates then remove at random until no more than count are included diff --git a/forge-gui-mobile/src/forge/adventure/util/CardUtil.java b/forge-gui-mobile/src/forge/adventure/util/CardUtil.java index f1e87bb344d..95735027514 100644 --- a/forge-gui-mobile/src/forge/adventure/util/CardUtil.java +++ b/forge-gui-mobile/src/forge/adventure/util/CardUtil.java @@ -400,6 +400,11 @@ public class CardUtil { return reward.getCount()*500; if(reward.getType()== Reward.Type.Gold) return reward.getCount(); + /*if(reward.getType() == Reward.Type.CardPack) + return reward.getDeck().get(DeckSection.Main).countAll()*70;*/ + //TODO: Heitor - Price by card count and type of boosterPack. + + return 1000; } diff --git a/forge-gui-mobile/src/forge/adventure/util/RewardActor.java b/forge-gui-mobile/src/forge/adventure/util/RewardActor.java index e657e168f3b..9b3959cc24f 100644 --- a/forge-gui-mobile/src/forge/adventure/util/RewardActor.java +++ b/forge-gui-mobile/src/forge/adventure/util/RewardActor.java @@ -38,6 +38,7 @@ import forge.assets.FSkinImage; import forge.assets.ImageCache; import forge.card.CardImageRenderer; import forge.card.CardRenderer; +import forge.deck.DeckSection; import forge.game.card.CardView; import forge.gui.GuiBase; import forge.item.PaperCard; @@ -51,6 +52,9 @@ import forge.util.ImageUtil; import org.apache.commons.lang3.StringUtils; import java.io.File; +import java.util.Scanner; + +import static forge.localinstance.properties.ForgeConstants.IMAGE_LIST_QUEST_BOOSTERS_FILE; /** * Render the rewards as a card on the reward scene. @@ -80,7 +84,8 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb boolean alternate = false, shown = false; boolean isRewardShop, showOverlay, isLoot; TextraLabel overlayLabel; - + int artIndex = 1; + String imageKey = ""; public int renderedCount = 0; //Counter for cards that require rendering a preview. static final ImageFetcher fetcher = GuiBase.getInterface().getImageFetcher(); RewardImage toolTipImage; @@ -114,66 +119,83 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb @Override public void onImageFetched() { ImageCache.getInstance().clear(); - String imageKey = reward.getCard().getImageKey(false); - PaperCard card = ImageUtil.getPaperCardFromImageKey(imageKey); - imageKey = card.getCardImageKey(); - int count = 0; - if (StringUtils.isBlank(imageKey)) - return; - File imageFile = ImageKeys.getImageFile(imageKey); - if (imageFile == null || !imageFile.exists()) - return; - Texture replacement = Forge.getAssets().manager().get(imageFile.getPath(), Texture.class, false); - if (replacement == null) { - try { - Forge.getAssets().manager().load(imageFile.getPath(), Texture.class, Forge.getAssets().getTextureFilter()); - Forge.getAssets().manager().finishLoadingAsset(imageFile.getPath()); - replacement = Forge.getAssets().manager().get(imageFile.getPath(), Texture.class, false); - } catch (Exception e) { - //e.printStackTrace(); + + + + if(reward.type.equals(Reward.Type.Card)) { + imageKey = reward.getCard().getImageKey(false); + PaperCard card = ImageUtil.getPaperCardFromImageKey(imageKey); + imageKey = card.getCardImageKey(); + + + int count = 0; + if (StringUtils.isBlank(imageKey)) return; - } - } - if (replacement == null) - return; - count += 1; - image = replacement; - loaded = true; - if (toolTipImage != null) { - if (toolTipImage.getDrawable() instanceof TextureRegionDrawable) { - ((TextureRegionDrawable) toolTipImage.getDrawable()).getRegion().getTexture().dispose(); - } - toolTipImage.remove(); - toolTipImage = new RewardImage(processDrawable(image)); - if (GuiBase.isAndroid() || Forge.hasGamepad()) { - if (holdTooltip != null) { - if (shown) { - holdTooltip.getTouchDownTarget().fire(RewardScene.eventTouchUp()); - Gdx.input.setInputProcessor(null); - } - if (holdTooltip.getImage() != null && holdTooltip.getImage().getDrawable() instanceof TextureRegionDrawable) { - try { // if texture is null either it's not initialized or already disposed - ((TextureRegionDrawable) holdTooltip.getImage().getDrawable()).getRegion().getTexture().dispose(); - } catch (Exception e) { - e.printStackTrace(); - } - } - holdTooltip.hide(); - holdTooltip.tooltip_actor = new ComplexTooltip(toolTipImage); + File imageFile = ImageKeys.getImageFile(imageKey); + + if (imageFile == null || !imageFile.exists()) + return; + Texture replacement = Forge.getAssets().manager().get(imageFile.getPath(), Texture.class, false); + if (replacement == null) { + try { + Forge.getAssets().manager().load(imageFile.getPath(), Texture.class, Forge.getAssets().getTextureFilter()); + Forge.getAssets().manager().finishLoadingAsset(imageFile.getPath()); + replacement = Forge.getAssets().manager().get(imageFile.getPath(), Texture.class, false); + } catch (Exception e) { + //e.printStackTrace(); + return; } - } else { - tooltip.setActor(new ComplexTooltip(toolTipImage)); + } + if (replacement == null) + return; + count += 1; + image = replacement; + loaded = true; + if (toolTipImage != null) { + if (toolTipImage.getDrawable() instanceof TextureRegionDrawable) { + ((TextureRegionDrawable) toolTipImage.getDrawable()).getRegion().getTexture().dispose(); + } + toolTipImage.remove(); + toolTipImage = new RewardImage(processDrawable(image)); + if (GuiBase.isAndroid() || Forge.hasGamepad()) { + if (holdTooltip != null) { + if (shown) { + holdTooltip.getTouchDownTarget().fire(RewardScene.eventTouchUp()); + Gdx.input.setInputProcessor(null); + } + if (holdTooltip.getImage() != null && holdTooltip.getImage().getDrawable() instanceof TextureRegionDrawable) { + try { // if texture is null either it's not initialized or already disposed + ((TextureRegionDrawable) holdTooltip.getImage().getDrawable()).getRegion().getTexture().dispose(); + } catch (Exception e) { + e.printStackTrace(); + } + } + holdTooltip.hide(); + holdTooltip.tooltip_actor = new ComplexTooltip(toolTipImage); + } + } else { + tooltip.setActor(new ComplexTooltip(toolTipImage)); + } + } + if (T != null) + T.dispose(); + if (alternate && Talt != null) + Talt.dispose(); + ImageCache.getInstance().updateSynqCount(imageFile, count); + if (Forge.getCurrentScene() instanceof RewardScene) + RewardScene.instance().reactivateInputs(); + else if (Forge.getCurrentScene() instanceof UIScene) { + (Forge.getCurrentScene()).updateInput(); } } - if (T != null) - T.dispose(); - if (alternate && Talt != null) - Talt.dispose(); - ImageCache.getInstance().updateSynqCount(imageFile, count); - if (Forge.getCurrentScene() instanceof RewardScene) - RewardScene.instance().reactivateInputs(); - else if (Forge.getCurrentScene() instanceof UIScene) { - (Forge.getCurrentScene()).updateInput(); + if(reward.type.equals(Reward.Type.CardPack)) + { + Texture t = ImageCache.getInstance().getImage(imageKey, false, true); + Sprite backSprite = Config.instance().getItemSprite("CardBack"); + Sprite item = new Sprite(new TextureRegion(t)); + setItemTooltips(item, backSprite, true); + //processSprite(backSprite, item, Controls.newTextraLabel("[%200]" + reward.getDeck().getComment() + " " + + // "Booster"), 0, -10, true); } Gdx.graphics.requestRendering(); } @@ -352,38 +374,80 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb processSprite(backSprite, null, null, 0, 0, false); break; } - - - String imageKey = ""; + boolean isBooster = false; + imageKey = ""; String editionCode = ""; try { editionCode = reward.getDeck().getComment(); - int artIndex = 1; + + artIndex = 1; if (SealedProduct.specialSets.contains(editionCode) || editionCode.equals("?")) { - imageKey = "b:" + getName().substring(0, getName().indexOf("Booster Pack") - 1); + imageKey = "b:" + reward.getDeck().getName().substring(0, reward.getDeck().getName().indexOf("Booster Pack") - 1); + artIndex = 0; + } else { int maxIdx = StaticData.instance().getEditions().get(editionCode).getCntBoosterPictures(); artIndex = Aggregates.randomInt(1, 2);//MyRandom.getRandom().nextInt(maxIdx) + 1; imageKey = ImageKeys.BOOSTER_PREFIX + editionCode + ((1 >= maxIdx) ? "" : ("_" + artIndex)); + } } catch (Exception e) { //Comment did not contain the edition code, this is not a basic booster pack } - boolean isBooster = false; - Sprite item; - Texture t = ImageCache.getInstance().getImage(imageKey, false, true); - if (t != null) { - item = new Sprite(new TextureRegion(t)); - isBooster = true; - } else { - item = Config.instance().getItemSprite("Deck"); - } - setItemTooltips(item, backSprite, isBooster); + Sprite item = null; + boolean found = false; + if (imageKey != "") { + isBooster = true; + File file = new File(IMAGE_LIST_QUEST_BOOSTERS_FILE); + try { + Scanner scanner = new Scanner(file); + String boosterPath = ""; + while(scanner.hasNextLine()) + { + boosterPath = scanner.nextLine(); + if(boosterPath.contains(imageKey.substring(2))) { + imageKey = imageKey + boosterPath.substring(boosterPath.length() - 4); + found = true; + break; + } + } + } + catch (Exception e) + { + System.out.println(e.getMessage()); + break; + } + } + if(found) { + Texture t = ImageCache.getInstance().getImage(imageKey, false, true); + isBooster = true; + if (t != null) { + + item = new Sprite(new TextureRegion(t)); + + + //setCardImage(t); + onImageFetched(); + } + else { + fetcher.fetchImage(imageKey, this); + item = Config.instance().getItemSprite("Deck"); + setItemTooltips(item, backSprite, isBooster); + } + } + else{ + + + item = Config.instance().getItemSprite("Deck"); + setItemTooltips(item, backSprite, isBooster); + } if (isBooster) - processSprite(backSprite, item, Controls.newTextraLabel("[%200]" + editionCode + " Booster"), 0, -10, isBooster); + processSprite(backSprite, item, Controls.newTextraLabel("[%200]" + editionCode + " Booster"), 0, + -10, isBooster); else - processSprite(backSprite, item, Controls.newTextraLabel("[%200]Event Reward Pack"), 0, -10, isBooster); + processSprite(backSprite, item, Controls.newTextraLabel("[%200]Event Reward Pack"), 0, -10, + isBooster); needsToBeDisposed = true; break; } @@ -670,11 +734,20 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb getGraphics().drawImage(backSprite, 0, 0, preview_w, preview_h); if (!isBooster) getGraphics().drawImage(icon, preview_w / 2f - 75, 160, 160, 160); - else - getGraphics().drawImage(icon, 0, 0, preview_w, preview_h); + else //if(loaded) + getGraphics().drawImage(icon, 74, 100, 345, 480); + /* else + getGraphics().drawImage(icon, 0, 0, preview_w, preview_h);*/ float div = (float) preview_h / preview_w; BitmapFont font = Controls.getBitmapFont("default", 4 / div); - layout.setText(font, itemExists ? item.name : getReward().type.name(), Color.WHITE, preview_w - 64, Align.center, true); + if(reward.getType().equals(Reward.Type.CardPack)) { + layout.setText(font, reward.getDeck().get(DeckSection.Main).countAll() +" Cards", + Color.WHITE, + preview_w - 64, + Align.center, true); + } + else + layout.setText(font, itemExists ? item.name : getReward().type.name(), Color.WHITE, preview_w - 64, Align.center, true); getGraphics().drawText(font, layout, 32, preview_h - 70); align = itemExists ? Align.topLeft : Align.top; if (itemExists) { @@ -886,7 +959,8 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb T = renderPlaceholder(new Graphics(), reward.getCard(), false); drawCard(batch, T, x, width); } - } else if (image != null) { + } + else if (image != null) { batch.draw(image, x, -getHeight() / 2, width, getHeight()); } } @@ -1017,8 +1091,18 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb cLabel.setAlignment(align); cLabel.setWrap(true); cLabel.setWidth(width); + + if(reward.type.equals(Reward.Type.CardPack)) + { + + cLabel.setY(y-70); + } + else + { + cLabel.setY(y); + } cLabel.setX(x); - cLabel.setY(y); + addActorAt(0, cImage); addActorAt(1, cLabel); } diff --git a/forge-gui-mobile/src/forge/assets/ImageCache.java b/forge-gui-mobile/src/forge/assets/ImageCache.java index 294de8d5a37..9ea9214595c 100644 --- a/forge-gui-mobile/src/forge/assets/ImageCache.java +++ b/forge-gui-mobile/src/forge/assets/ImageCache.java @@ -258,6 +258,7 @@ public class ImageCache { } } + Texture image; File imageFile = ImageKeys.getImageFile(imageKey); if (useDefaultIfNotFound) { diff --git a/forge-gui/release-files/CHANGES.txt b/forge-gui/release-files/CHANGES.txt index 05f0bf1829e..00d9ec2e98d 100644 --- a/forge-gui/release-files/CHANGES.txt +++ b/forge-gui/release-files/CHANGES.txt @@ -1,2 +1,2 @@ -- Bug fixes - -As always, this release of Forge features an assortment of bug fixes and improvements based on user feedback during the previous release run. +- Bug fixes - +As always, this release of Forge features an assortment of bug fixes and improvements based on user feedback during the previous release run. diff --git a/forge-gui/res/adventure/Shandalar/world/shops.json b/forge-gui/res/adventure/Shandalar/world/shops.json index e916bdc6252..86d64fbd429 100644 --- a/forge-gui/res/adventure/Shandalar/world/shops.json +++ b/forge-gui/res/adventure/Shandalar/world/shops.json @@ -5502,5 +5502,113 @@ "minDate": "2021-09-09" }] }] -} +}, + { + "name": "BoosterPackShop", + "description":"Pack To Basics", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShop", + "rewards": [ + { + "type": "cardPackShop", + "count": 8 + }] + }, + { + "name": "WhiteBoosterPackShop", + "description":"Blessed Boosters", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShopW", + "rewards": [ + { + "type": "cardPackShop", + "count": 4, + "colors":["White"] + }, + { + "type": "cardPackShop", + "count": 4 + }] + + }, + { + "name": "BlueBoosterPackShop", + "description":"Counter Packs", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShopU", + "rewards": [ + { + "type": "cardPackShop", + "count": 4, + "colors":["Blue"] + }, + { + "type": "cardPackShop", + "count": 4 + }] + }, + { + "name": "BlackBoosterPackShop", + "description":"Graveyard Goods", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShopB", + "rewards": [ + { + "type": "cardPackShop", + "count": 4, + "colors":["Black"] + }, + { + "type": "cardPackShop", + "count": 4 + }] + }, + { + "name": "RedBoosterPackShop", + "description":"Wildfire Wonders", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShopR", + "rewards": [ + { + "type": "cardPackShop", + "count": 4, + "colors":["Red"] + }, + { + "type": "cardPackShop", + "count": 4 + }] + }, + { + "name": "GreenBoosterPackShop", + "description":"Nature’s Nurture Packs", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShopG", + "rewards": [ + { + "type": "cardPackShop", + "count": 4, + "colors":["Green"] + }, + { + "type": "cardPackShop", + "count": 4 + }] + }, + { + "name": "ColorlessBoosterPackShop", + "description":"Pack to the Future", + "spriteAtlas":"maps/tileset/buildings.atlas", + "sprite": "CarShopC", + "rewards": [ + { + "type": "cardPackShop", + "count": 4, + "colors":["Colorless"] + }, + { + "type": "cardPackShop", + "count": 4 + }] + } ] diff --git a/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx b/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx index 4314184d357..ddbafda13be 100644 --- a/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx +++ b/forge-gui/res/adventure/common/maps/map/main_story/forest_capital.tmx @@ -37,7 +37,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -132,7 +132,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -219,7 +219,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/main_story/island_capital.tmx b/forge-gui/res/adventure/common/maps/map/main_story/island_capital.tmx index 080e09508b4..eafa323d078 100644 --- a/forge-gui/res/adventure/common/maps/map/main_story/island_capital.tmx +++ b/forge-gui/res/adventure/common/maps/map/main_story/island_capital.tmx @@ -42,7 +42,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -97,7 +97,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -218,7 +218,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/main_story/mountain_capital.tmx b/forge-gui/res/adventure/common/maps/map/main_story/mountain_capital.tmx index b1cca3a0bf8..25e8e297476 100644 --- a/forge-gui/res/adventure/common/maps/map/main_story/mountain_capital.tmx +++ b/forge-gui/res/adventure/common/maps/map/main_story/mountain_capital.tmx @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -199,7 +199,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/main_story/plains_capital.tmx b/forge-gui/res/adventure/common/maps/map/main_story/plains_capital.tmx index abea18d7658..3f37a23d04f 100644 --- a/forge-gui/res/adventure/common/maps/map/main_story/plains_capital.tmx +++ b/forge-gui/res/adventure/common/maps/map/main_story/plains_capital.tmx @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -222,7 +222,7 @@ - + @@ -231,7 +231,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/main_story/swamp_capital.tmx b/forge-gui/res/adventure/common/maps/map/main_story/swamp_capital.tmx index 4688d16cf9d..36ff4478d1d 100644 --- a/forge-gui/res/adventure/common/maps/map/main_story/swamp_capital.tmx +++ b/forge-gui/res/adventure/common/maps/map/main_story/swamp_capital.tmx @@ -125,7 +125,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -212,7 +212,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/forest_town.tmx b/forge-gui/res/adventure/common/maps/map/towns/forest_town.tmx index 7e1e803b403..6c433602229 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/forest_town.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/forest_town.tmx @@ -32,32 +32,32 @@ - + - + - + - + - + - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/forest_town_generic.tmx b/forge-gui/res/adventure/common/maps/map/towns/forest_town_generic.tmx index 31306e7e29f..c22c5691593 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/forest_town_generic.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/forest_town_generic.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/forest_town_identity.tmx b/forge-gui/res/adventure/common/maps/map/towns/forest_town_identity.tmx index fcf939ccede..794d1371420 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/forest_town_identity.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/forest_town_identity.tmx @@ -32,7 +32,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/forest_town_tribal.tmx b/forge-gui/res/adventure/common/maps/map/towns/forest_town_tribal.tmx index bba0eedea21..ec1ea2fb704 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/forest_town_tribal.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/forest_town_tribal.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/island_town.tmx b/forge-gui/res/adventure/common/maps/map/towns/island_town.tmx index 5f6a428e29b..bc7a34478ed 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/island_town.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/island_town.tmx @@ -32,32 +32,32 @@ - + - + - + - + - + - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/island_town_generic.tmx b/forge-gui/res/adventure/common/maps/map/towns/island_town_generic.tmx index f3e7824850e..b4adcf3bf03 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/island_town_generic.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/island_town_generic.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -102,7 +102,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/island_town_identity.tmx b/forge-gui/res/adventure/common/maps/map/towns/island_town_identity.tmx index e5d057e85b0..b5ba5fafc62 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/island_town_identity.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/island_town_identity.tmx @@ -32,7 +32,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/island_town_tribal.tmx b/forge-gui/res/adventure/common/maps/map/towns/island_town_tribal.tmx index b6d2ec977a5..49b26437dd7 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/island_town_tribal.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/island_town_tribal.tmx @@ -33,7 +33,8 @@ - + @@ -41,7 +42,8 @@ - + @@ -49,7 +51,8 @@ - + @@ -57,7 +60,8 @@ - + @@ -65,7 +69,8 @@ - + @@ -73,7 +78,8 @@ - + @@ -94,7 +100,8 @@ - + @@ -102,7 +109,8 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/mountain_town.tmx b/forge-gui/res/adventure/common/maps/map/towns/mountain_town.tmx index fcbe0c0a9d6..74ae6986b1a 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/mountain_town.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/mountain_town.tmx @@ -32,32 +32,32 @@ - + - + - + - + - + - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/mountain_town_generic.tmx b/forge-gui/res/adventure/common/maps/map/towns/mountain_town_generic.tmx index 49266221510..44bd0afb270 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/mountain_town_generic.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/mountain_town_generic.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -107,7 +107,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/mountain_town_identity.tmx b/forge-gui/res/adventure/common/maps/map/towns/mountain_town_identity.tmx index 7ecb70c38fa..15f7d856c89 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/mountain_town_identity.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/mountain_town_identity.tmx @@ -32,7 +32,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -104,7 +104,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/mountain_town_tribal.tmx b/forge-gui/res/adventure/common/maps/map/towns/mountain_town_tribal.tmx index 60013f67f71..a43b2f50df2 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/mountain_town_tribal.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/mountain_town_tribal.tmx @@ -33,7 +33,8 @@ - + @@ -41,7 +42,8 @@ - + @@ -49,7 +51,8 @@ - + @@ -57,7 +60,8 @@ - + @@ -65,7 +69,8 @@ - + @@ -73,7 +78,8 @@ - + @@ -99,7 +105,8 @@ - + @@ -107,7 +114,8 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/plains_town.tmx b/forge-gui/res/adventure/common/maps/map/towns/plains_town.tmx index 09b0fc20437..5bcda622c41 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/plains_town.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/plains_town.tmx @@ -32,22 +32,22 @@ - + - + - + - + @@ -60,22 +60,22 @@ - + - + - + - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/plains_town_generic.tmx b/forge-gui/res/adventure/common/maps/map/towns/plains_town_generic.tmx index 4280e35c8d7..1864f1d9550 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/plains_town_generic.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/plains_town_generic.tmx @@ -33,15 +33,15 @@ - - - + + + - + @@ -49,7 +49,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -98,7 +98,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/plains_town_identity.tmx b/forge-gui/res/adventure/common/maps/map/towns/plains_town_identity.tmx index a855226ebd9..543a32fbccb 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/plains_town_identity.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/plains_town_identity.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -90,7 +90,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/plains_town_tribal.tmx b/forge-gui/res/adventure/common/maps/map/towns/plains_town_tribal.tmx index f95dbc49592..b764f604f92 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/plains_town_tribal.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/plains_town_tribal.tmx @@ -33,7 +33,8 @@ - + @@ -41,7 +42,7 @@ - + @@ -49,7 +50,7 @@ - + @@ -57,7 +58,7 @@ - + @@ -74,7 +75,7 @@ - + @@ -82,7 +83,7 @@ - + @@ -90,7 +91,7 @@ - + @@ -98,7 +99,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/swamp_town.tmx b/forge-gui/res/adventure/common/maps/map/towns/swamp_town.tmx index 6d0332dda61..22adf5631a3 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/swamp_town.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/swamp_town.tmx @@ -32,22 +32,22 @@ - + - + - + - + @@ -57,7 +57,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/swamp_town_generic.tmx b/forge-gui/res/adventure/common/maps/map/towns/swamp_town_generic.tmx index f91ea4085e9..40cbd22cf00 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/swamp_town_generic.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/swamp_town_generic.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -103,7 +103,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/swamp_town_identity.tmx b/forge-gui/res/adventure/common/maps/map/towns/swamp_town_identity.tmx index 371bcdb1b9c..f0473389ffa 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/swamp_town_identity.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/swamp_town_identity.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -94,7 +94,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/swamp_town_tribal.tmx b/forge-gui/res/adventure/common/maps/map/towns/swamp_town_tribal.tmx index cb4c64d4043..c638bfe52a6 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/swamp_town_tribal.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/swamp_town_tribal.tmx @@ -33,7 +33,8 @@ - + @@ -41,7 +42,7 @@ - + @@ -49,7 +50,7 @@ - + @@ -57,7 +58,7 @@ - + @@ -65,7 +66,7 @@ - + @@ -73,7 +74,7 @@ - + @@ -94,7 +95,7 @@ - + @@ -103,7 +104,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/waste_town.tmx b/forge-gui/res/adventure/common/maps/map/towns/waste_town.tmx index 62280dcdc1a..de84487811c 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/waste_town.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/waste_town.tmx @@ -32,42 +32,44 @@ - + - + - + - + - + - + - + - + @@ -78,7 +80,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/waste_town_generic.tmx b/forge-gui/res/adventure/common/maps/map/towns/waste_town_generic.tmx index 013bc827d46..b1d46cc2ef7 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/waste_town_generic.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/waste_town_generic.tmx @@ -36,7 +36,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -81,7 +81,8 @@ - + @@ -89,7 +90,7 @@ - + @@ -98,13 +99,13 @@ - + - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/waste_town_identity.tmx b/forge-gui/res/adventure/common/maps/map/towns/waste_town_identity.tmx index 2bbc88f0aff..92c971d4eab 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/waste_town_identity.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/waste_town_identity.tmx @@ -33,7 +33,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -107,7 +107,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/map/towns/waste_town_tribal.tmx b/forge-gui/res/adventure/common/maps/map/towns/waste_town_tribal.tmx index 25821b177b8..79bdbb6e7d1 100644 --- a/forge-gui/res/adventure/common/maps/map/towns/waste_town_tribal.tmx +++ b/forge-gui/res/adventure/common/maps/map/towns/waste_town_tribal.tmx @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -104,7 +104,7 @@ - + diff --git a/forge-gui/res/adventure/common/maps/tileset/buildings.atlas b/forge-gui/res/adventure/common/maps/tileset/buildings.atlas index 9f8a0e80bce..85e77505f0f 100644 --- a/forge-gui/res/adventure/common/maps/tileset/buildings.atlas +++ b/forge-gui/res/adventure/common/maps/tileset/buildings.atlas @@ -140,7 +140,28 @@ UBShop size: 16, 16 NobleShop xy: 320, 944 - size: 16, 16 + size: 16, 16 +CarShop + xy: 384,944 + size:16, 16 +CarShopW + xy: 288,960 + size:16,16 +CarShopU + xy: 304,960 + size:16,16 +CarShopB + xy: 320,960 + size:16,16 +CarShopR + xy: 336,960 + size:16,16 +CarShopG + xy: 352,960 + size:16,16 +CarShopC + xy: 368,960 + size:16,16 MerfolkShop xy: 368, 768 size: 16, 16 @@ -348,7 +369,7 @@ LegendShop ShardTrader xy: 288, 896 size: 16, 16 -Waypoint +Waypoint xy: 288, 912 size: 16, 16 Overlay8Black diff --git a/forge-gui/res/adventure/common/maps/tileset/buildings.png b/forge-gui/res/adventure/common/maps/tileset/buildings.png index d89c47f85d6..3f2b2726e2a 100644 Binary files a/forge-gui/res/adventure/common/maps/tileset/buildings.png and b/forge-gui/res/adventure/common/maps/tileset/buildings.png differ diff --git a/forge-gui/res/adventure/common/maps/tileset/buildings1.png b/forge-gui/res/adventure/common/maps/tileset/buildings1.png new file mode 100644 index 00000000000..d89c47f85d6 Binary files /dev/null and b/forge-gui/res/adventure/common/maps/tileset/buildings1.png differ diff --git a/forge-gui/res/adventure/common/maps/tileset/buildings2.png b/forge-gui/res/adventure/common/maps/tileset/buildings2.png new file mode 100644 index 00000000000..9931a1c14f9 Binary files /dev/null and b/forge-gui/res/adventure/common/maps/tileset/buildings2.png differ diff --git a/forge-gui/src/main/java/forge/util/ImageFetcher.java b/forge-gui/src/main/java/forge/util/ImageFetcher.java index 63722f1df2a..875a8b78aaf 100644 --- a/forge-gui/src/main/java/forge/util/ImageFetcher.java +++ b/forge-gui/src/main/java/forge/util/ImageFetcher.java @@ -93,7 +93,22 @@ public abstract class ImageFetcher { // Fake card (like the ante prompt) trying to be "fetched" if (imageKey.length() < 2) return; + if (imageKey.startsWith(ImageKeys.BOOSTER_PREFIX)) + { + final ArrayList downloadUrls = new ArrayList<>(); + final String filename = imageKey.substring(ImageKeys.BOOSTER_PREFIX.length()); + downloadUrls.add("https://downloads.cardforge.org/images/products/boosters/"+ filename); + System.out.println("Fetching from "+downloadUrls); + + FileUtil.ensureDirectoryExists(ForgeConstants.CACHE_BOOSTER_PICS_DIR); + File destFile = new File(ForgeConstants.CACHE_BOOSTER_PICS_DIR, filename); + System.out.println("Destination File "+ destFile.getAbsolutePath()+" exists: " + destFile.exists()); + if(destFile.exists()) + return; + setupObserver(destFile.getAbsolutePath(),callback,downloadUrls); + return; + } if (imageKey.equalsIgnoreCase("t:null")) return;