From 8ccdabcdf67ba63ae9ea1879ff73b651e0047819 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Fri, 14 Apr 2023 02:49:09 +0800 Subject: [PATCH] update GameHUD, InventoryScene - can equip activatable items for quick access on GameHUD --- .../adventure/player/AdventurePlayer.java | 577 ++++++++++-------- .../forge/adventure/scene/InventoryScene.java | 11 +- .../forge/adventure/scene/MapViewScene.java | 12 +- .../src/forge/adventure/stage/GameHUD.java | 123 ++-- .../util/AdventureQuestController.java | 1 - .../Shandalar/ui/deck_selector_portrait.json | 3 - .../adventure/Shandalar/ui/hud_landscape.json | 46 +- .../adventure/Shandalar/ui/hud_portrait.json | 53 +- .../adventure/Shandalar/ui/inn_portrait.json | 3 - .../res/adventure/Shandalar/ui/inventory.json | 18 + .../Shandalar/ui/inventory_portrait.json | 32 +- .../Shandalar/ui/items_portrait.json | 2 - .../adventure/Shandalar/ui/map_portrait.json | 1 - .../Shandalar/ui/new_game_portrait.json | 2 - .../Shandalar/ui/quests_portrait.json | 2 - .../Shandalar/ui/save_load_portrait.json | 2 - .../Shandalar/ui/settings_portrait.json | 1 - .../Shandalar/ui/shardtrader_portrait.json | 3 - .../Shandalar/ui/spellsmith_portrait.json | 3 - .../Shandalar/ui/start_menu_portrait.json | 1 - .../Shandalar/ui/statistic_portrait.json | 2 - .../res/adventure/Shandalar/world/items.json | 13 +- 22 files changed, 490 insertions(+), 421 deletions(-) diff --git a/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java b/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java index 59064e3587c..aefb53e2a8b 100644 --- a/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java +++ b/forge-gui-mobile/src/forge/adventure/player/AdventurePlayer.java @@ -26,7 +26,7 @@ import java.util.*; * Class that represents the player (not the player sprite) */ public class AdventurePlayer implements Serializable, SaveFileContent { - public static final int NUMBER_OF_DECKS=10; + public static final int NUMBER_OF_DECKS = 10; // Player profile data. private String name; private int heroRace; @@ -43,53 +43,57 @@ public class AdventurePlayer implements Serializable, SaveFileContent { // Game data. private float worldPosX; private float worldPosY; - private int gold = 0; - private int maxLife= 20; - private int life = 20; + private int gold = 0; + private int maxLife = 20; + private int life = 20; private int shards = 0; private EffectData blessing; //Blessing to apply for next battle. - private final PlayerStatistic statistic = new PlayerStatistic(); + private final PlayerStatistic statistic = new PlayerStatistic(); private final Map questFlags = new HashMap<>(); - private final Array inventoryItems=new Array<>(); - private final HashMap equippedItems=new HashMap<>(); - private List quests= new ArrayList<>(); + private final Array inventoryItems = new Array<>(); + private final HashMap equippedItems = new HashMap<>(); + private final List quests = new ArrayList<>(); // Fantasy/Chaos mode settings. - private boolean fantasyMode = false; + private boolean fantasyMode = false; private boolean announceFantasy = false; private boolean usingCustomDeck = false; private boolean announceCustom = false; // Signals final SignalList onLifeTotalChangeList = new SignalList(); - final SignalList onShardsChangeList = new SignalList(); - final SignalList onGoldChangeList = new SignalList(); - final SignalList onPlayerChangeList = new SignalList(); - final SignalList onEquipmentChange = new SignalList(); - final SignalList onBlessing = new SignalList(); + final SignalList onShardsChangeList = new SignalList(); + final SignalList onGoldChangeList = new SignalList(); + final SignalList onPlayerChangeList = new SignalList(); + final SignalList onEquipmentChange = new SignalList(); + final SignalList onBlessing = new SignalList(); - public AdventurePlayer() { clear(); } + public AdventurePlayer() { + clear(); + } - public PlayerStatistic getStatistic(){ return statistic; } + public PlayerStatistic getStatistic() { + return statistic; + } private void clearDecks() { - for(int i=0; i < NUMBER_OF_DECKS; i++) decks[i] = new Deck("Empty Deck"); - deck = decks[0]; + for (int i = 0; i < NUMBER_OF_DECKS; i++) decks[i] = new Deck("Empty Deck"); + deck = decks[0]; selectedDeckIndex = 0; } private void clear() { //Ensure sensitive gameplay data is properly reset between games. //Reset all properties HERE. - fantasyMode = false; - announceFantasy = false; - usingCustomDeck = false; - blessing = null; - gold = 0; - maxLife = 20; - life = 20; - shards = 0; + fantasyMode = false; + announceFantasy = false; + usingCustomDeck = false; + blessing = null; + gold = 0; + maxLife = 20; + life = 20; + shards = 0; clearDecks(); inventoryItems.clear(); equippedItems.clear(); @@ -105,33 +109,33 @@ public class AdventurePlayer implements Serializable, SaveFileContent { return WorldSave.getCurrentSave().getPlayer(); } - private final CardPool cards=new CardPool(); - private final ItemPool newCards=new ItemPool<>(InventoryItem.class); + private final CardPool cards = new CardPool(); + private final ItemPool newCards = new ItemPool<>(InventoryItem.class); - public void create(String n, Deck startingDeck, boolean male, int race, int avatar, boolean isFantasy, boolean isUsingCustomDeck, DifficultyData difficultyData) { + public void create(String n, Deck startingDeck, boolean male, int race, int avatar, boolean isFantasy, boolean isUsingCustomDeck, DifficultyData difficultyData) { clear(); announceFantasy = fantasyMode = isFantasy; //Set Chaos mode first. announceCustom = usingCustomDeck = isUsingCustomDeck; - deck = startingDeck; + deck = startingDeck; decks[0] = deck; cards.addAllFlat(deck.getAllCardsInASinglePool().toFlatList()); - this.difficultyData.startingLife = difficultyData.startingLife; - this.difficultyData.staringMoney = difficultyData.staringMoney; + this.difficultyData.startingLife = difficultyData.startingLife; + this.difficultyData.staringMoney = difficultyData.staringMoney; this.difficultyData.startingDifficulty = difficultyData.startingDifficulty; - this.difficultyData.name = difficultyData.name; - this.difficultyData.spawnRank = difficultyData.spawnRank; - this.difficultyData.enemyLifeFactor = difficultyData.enemyLifeFactor; - this.difficultyData.sellFactor = difficultyData.sellFactor; - this.difficultyData.shardSellRatio = difficultyData.shardSellRatio; + this.difficultyData.name = difficultyData.name; + this.difficultyData.spawnRank = difficultyData.spawnRank; + this.difficultyData.enemyLifeFactor = difficultyData.enemyLifeFactor; + this.difficultyData.sellFactor = difficultyData.sellFactor; + this.difficultyData.shardSellRatio = difficultyData.shardSellRatio; - gold = difficultyData.staringMoney; - name = n; - heroRace = race; + gold = difficultyData.staringMoney; + name = n; + heroRace = race; avatarIndex = avatar; - isFemale = !male; + isFemale = !male; setColorIdentity(DeckProxy.getColorIdentity(deck)); @@ -145,12 +149,13 @@ public class AdventurePlayer implements Serializable, SaveFileContent { } public void setSelectedDeckSlot(int slot) { - if(slot>=0&&slot= 0 && slot < NUMBER_OF_DECKS) { selectedDeckIndex = slot; deck = decks[selectedDeckIndex]; setColorIdentity(DeckProxy.getColorIdentity(deck)); } } + public void updateDifficulty(DifficultyData diff) { maxLife = diff.startingLife; this.difficultyData.startingShards = diff.startingShards; @@ -166,28 +171,71 @@ public class AdventurePlayer implements Serializable, SaveFileContent { } //Getters - public int getSelectedDeckIndex() { return selectedDeckIndex; } - public Deck getSelectedDeck() { return deck; } - public Array getItems() { return inventoryItems; } - public Deck getDeck(int index) { return decks[index]; } - public CardPool getCards() { return cards; } - public String getName() { return name; } - public float getWorldPosX() { return worldPosX; } - public float getWorldPosY() { return worldPosY; } - public int getGold() { return gold; } - public int getLife() { return life; } - public int getMaxLife() { return maxLife; } - public int getShards() { return shards; } - public @Null EffectData getBlessing() { return blessing; } + public int getSelectedDeckIndex() { + return selectedDeckIndex; + } - public Collection getEquippedItems() { return equippedItems.values(); } - public ItemPool getNewCards() { return newCards; } + public Deck getSelectedDeck() { + return deck; + } - public ColorSet getColorIdentity(){ + public Array getItems() { + return inventoryItems; + } + + public Deck getDeck(int index) { + return decks[index]; + } + + public CardPool getCards() { + return cards; + } + + public String getName() { + return name; + } + + public float getWorldPosX() { + return worldPosX; + } + + public float getWorldPosY() { + return worldPosY; + } + + public int getGold() { + return gold; + } + + public int getLife() { + return life; + } + + public int getMaxLife() { + return maxLife; + } + + public int getShards() { + return shards; + } + + public @Null EffectData getBlessing() { + return blessing; + } + + public Collection getEquippedItems() { + return equippedItems.values(); + } + + public ItemPool getNewCards() { + return newCards; + } + + public ColorSet getColorIdentity() { return colorIdentity; } - public String getColorIdentityLong(){ + public String getColorIdentityLong() { return colorIdentity.toString(); } @@ -196,62 +244,61 @@ public class AdventurePlayer implements Serializable, SaveFileContent { public void setWorldPosX(float worldPosX) { this.worldPosX = worldPosX; } + public void setWorldPosY(float worldPosY) { this.worldPosY = worldPosY; } - public void setColorIdentity(String C){ - colorIdentity= ColorSet.fromNames(C.toCharArray()); + public void setColorIdentity(String C) { + colorIdentity = ColorSet.fromNames(C.toCharArray()); } - public void setColorIdentity(ColorSet set){ + public void setColorIdentity(ColorSet set) { this.colorIdentity = set; } - - @Override public void load(SaveFileData data) { clear(); //Reset player data. this.statistic.load(data.readSubData("statistic")); - this.difficultyData.startingLife=data.readInt("startingLife"); - this.difficultyData.staringMoney=data.readInt("staringMoney"); - this.difficultyData.startingDifficulty=data.readBool("startingDifficulty"); - this.difficultyData.name=data.readString("difficultyName"); - this.difficultyData.enemyLifeFactor=data.readFloat("enemyLifeFactor"); - this.difficultyData.sellFactor=data.readFloat("sellFactor"); - if(this.difficultyData.sellFactor==0) - this.difficultyData.sellFactor=0.2f; + this.difficultyData.startingLife = data.readInt("startingLife"); + this.difficultyData.staringMoney = data.readInt("staringMoney"); + this.difficultyData.startingDifficulty = data.readBool("startingDifficulty"); + this.difficultyData.name = data.readString("difficultyName"); + this.difficultyData.enemyLifeFactor = data.readFloat("enemyLifeFactor"); + this.difficultyData.sellFactor = data.readFloat("sellFactor"); + if (this.difficultyData.sellFactor == 0) + this.difficultyData.sellFactor = 0.2f; - this.difficultyData.shardSellRatio=data.readFloat("sellFactor"); - if(this.difficultyData.shardSellRatio==0) - this.difficultyData.shardSellRatio=0.8f; + this.difficultyData.shardSellRatio = data.readFloat("sellFactor"); + if (this.difficultyData.shardSellRatio == 0) + this.difficultyData.shardSellRatio = 0.8f; - name = data.readString("name"); - heroRace = data.readInt("heroRace"); + name = data.readString("name"); + heroRace = data.readInt("heroRace"); avatarIndex = data.readInt("avatarIndex"); - isFemale = data.readBool("isFemale"); - if(data.containsKey("colorIdentity")) + isFemale = data.readBool("isFemale"); + if (data.containsKey("colorIdentity")) setColorIdentity(data.readString("colorIdentity")); else colorIdentity = ColorSet.ALL_COLORS; - gold = data.readInt("gold"); - maxLife = data.readInt("maxLife"); - life = data.readInt("life"); - shards = data.containsKey("shards")?data.readInt("shards"):0; - worldPosX = data.readFloat("worldPosX"); - worldPosY = data.readFloat("worldPosY"); + gold = data.readInt("gold"); + maxLife = data.readInt("maxLife"); + life = data.readInt("life"); + shards = data.containsKey("shards") ? data.readInt("shards") : 0; + worldPosX = data.readFloat("worldPosX"); + worldPosY = data.readFloat("worldPosY"); - if(data.containsKey("blessing")) blessing = (EffectData)data.readObject("blessing"); + if (data.containsKey("blessing")) blessing = (EffectData) data.readObject("blessing"); - if(data.containsKey("inventory")) { - String[] inv=(String[])data.readObject("inventory"); + if (data.containsKey("inventory")) { + String[] inv = (String[]) data.readObject("inventory"); //Prevent items with wrong names from getting through. Hell breaks loose if it causes null pointers. //This only needs to be done on load. - for(String i : inv){ - if(ItemData.getItem(i) != null) inventoryItems.add(i); + for (String i : inv) { + if (ItemData.getItem(i) != null) inventoryItems.add(i); else { System.err.printf("Cannot find item name %s\n", i); //Allow official© permission for the player to get a refund. We will allow it this time. @@ -260,15 +307,15 @@ public class AdventurePlayer implements Serializable, SaveFileContent { } } } - if(data.containsKey("equippedSlots") && data.containsKey("equippedItems")) { - String[] slots=(String[])data.readObject("equippedSlots"); - String[] items=(String[])data.readObject("equippedItems"); + if (data.containsKey("equippedSlots") && data.containsKey("equippedItems")) { + String[] slots = (String[]) data.readObject("equippedSlots"); + String[] items = (String[]) data.readObject("equippedItems"); - assert(slots.length==items.length); + assert (slots.length == items.length); //Like above, prevent items with wrong names. If it triggered in inventory it'll trigger here as well. - for(int i=0;i slots=new ArrayList<>(); - ArrayList items=new ArrayList<>(); - for (Map.Entry entry : equippedItems.entrySet()) { + ArrayList slots = new ArrayList<>(); + ArrayList items = new ArrayList<>(); + for (Map.Entry entry : equippedItems.entrySet()) { slots.add(entry.getKey()); items.add(entry.getValue()); } - data.storeObject("equippedSlots",slots.toArray(new String[0])); - data.storeObject("equippedItems",items.toArray(new String[0])); + data.storeObject("equippedSlots", slots.toArray(new String[0])); + data.storeObject("equippedItems", items.toArray(new String[0])); data.storeObject("blessing", blessing); //Save quest flags. ArrayList questFlagsKey = new ArrayList<>(); - ArrayList questFlagsValue = new ArrayList<>(); - for(Map.Entry entry : questFlags.entrySet()){ + ArrayList questFlagsValue = new ArrayList<>(); + for (Map.Entry entry : questFlags.entrySet()) { questFlagsKey.add(entry.getKey()); questFlagsValue.add(entry.getValue()); } @@ -378,17 +425,17 @@ public class AdventurePlayer implements Serializable, SaveFileContent { data.storeObject("questFlagsValue", questFlagsValue.toArray(new Byte[0])); data.storeObject("quests", quests.toArray()); - data.storeObject("deckCards",deck.getMain().toCardList("\n").split("\n")); - if(deck.get(DeckSection.Sideboard)!=null) - data.storeObject("sideBoardCards",deck.get(DeckSection.Sideboard).toCardList("\n").split("\n")); - for(int i=0;i 0) result += data.effect.cardRewardBonus; + for (String name : equippedItems.values()) { + ItemData data = ItemData.getItem(name); + if (data != null && data.effect != null && data.effect.cardRewardBonus > 0) + result += data.effect.cardRewardBonus; } - if(blessing != null) { - if(blessing.cardRewardBonus > 0) result += blessing.cardRewardBonus; + if (blessing != null) { + if (blessing.cardRewardBonus > 0) result += blessing.cardRewardBonus; } return Math.min(result, 3); } @@ -606,50 +687,52 @@ public class AdventurePlayer implements Serializable, SaveFileContent { return difficultyData; } - public void renameDeck( String text) { - deck = (Deck)deck.copyTo(text); - decks[selectedDeckIndex]=deck; + public void renameDeck(String text) { + deck = (Deck) deck.copyTo(text); + decks[selectedDeckIndex] = deck; } public int cardSellPrice(PaperCard card) { - return (int)(CardUtil.getCardPrice(card)*difficultyData.sellFactor); + return (int) (CardUtil.getCardPrice(card) * difficultyData.sellFactor); } public void sellCard(PaperCard card, Integer result) { float price = CardUtil.getCardPrice(card) * result; price *= difficultyData.sellFactor; cards.remove(card, result); - addGold((int)price); + addGold((int) price); } public void removeItem(String name) { - if(name == null || name.equals("")) return; - inventoryItems.removeValue(name,false); - if(equippedItems.values().contains(name) && !inventoryItems.contains(name,false)) { + if (name == null || name.equals("")) return; + inventoryItems.removeValue(name, false); + if (equippedItems.values().contains(name) && !inventoryItems.contains(name, false)) { equippedItems.values().remove(name); } } public void equip(ItemData item) { - if(equippedItems.get(item.equipmentSlot) != null && equippedItems.get(item.equipmentSlot).equals(item.name)) { + if (equippedItems.get(item.equipmentSlot) != null && equippedItems.get(item.equipmentSlot).equals(item.name)) { equippedItems.remove(item.equipmentSlot); } else { - equippedItems.put(item.equipmentSlot,item.name); + equippedItems.put(item.equipmentSlot, item.name); } onEquipmentChange.emit(); } - public String itemInSlot(String key) { return equippedItems.get(key); } + public String itemInSlot(String key) { + return equippedItems.get(key); + } public float equipmentSpeed() { - float factor=1.0f; - for(String name:equippedItems.values()) { - ItemData data=ItemData.getItem(name); - if(data != null && data.effect.moveSpeed > 0.0) //Avoid negative speeds. It would be silly. - factor*=data.effect.moveSpeed; + float factor = 1.0f; + for (String name : equippedItems.values()) { + ItemData data = ItemData.getItem(name); + if (data != null && data.effect != null && data.effect.moveSpeed > 0.0) //Avoid negative speeds. It would be silly. + factor *= data.effect.moveSpeed; } - if(blessing != null) { //If a blessing gives speed, take it into account. - if(blessing.moveSpeed > 0.0) + if (blessing != null) { //If a blessing gives speed, take it into account. + if (blessing.moveSpeed > 0.0) factor *= blessing.moveSpeed; } return factor; @@ -657,19 +740,20 @@ public class AdventurePlayer implements Serializable, SaveFileContent { public float goldModifier(boolean sale) { float factor = 1.0f; - for(String name:equippedItems.values()) { - ItemData data=ItemData.getItem(name); - if(data != null && data.effect.goldModifier > 0.0) //Avoid negative modifiers. + for (String name : equippedItems.values()) { + ItemData data = ItemData.getItem(name); + if (data != null && data.effect != null && data.effect.goldModifier > 0.0) //Avoid negative modifiers. factor *= data.effect.goldModifier; } - if(blessing != null) { //If a blessing gives speed, take it into account. - if(blessing.goldModifier > 0.0) + if (blessing != null) { //If a blessing gives speed, take it into account. + if (blessing.goldModifier > 0.0) factor *= blessing.goldModifier; } - if(sale) return Math.max(1.0f + (1.0f - factor), 2.5f); + if (sale) return Math.max(1.0f + (1.0f - factor), 2.5f); return Math.max(factor, 0.25f); } - public float goldModifier(){ + + public float goldModifier() { return goldModifier(false); } @@ -678,8 +762,8 @@ public class AdventurePlayer implements Serializable, SaveFileContent { } public boolean addItem(String name) { - ItemData item=ItemData.getItem(name); - if(item==null) + ItemData item = ItemData.getItem(name); + if (item == null) return false; inventoryItems.add(name); return true; @@ -687,45 +771,48 @@ public class AdventurePlayer implements Serializable, SaveFileContent { // Quest functions. - public void setQuestFlag(String key, int value){ + public void setQuestFlag(String key, int value) { questFlags.put(key, (byte) value); } - public void advanceQuestFlag(String key){ - if(questFlags.get(key) != null){ + + public void advanceQuestFlag(String key) { + if (questFlags.get(key) != null) { questFlags.put(key, (byte) (questFlags.get(key) + 1)); } else { questFlags.put(key, (byte) 1); } } - public boolean checkQuestFlag(String key){ + + public boolean checkQuestFlag(String key) { return questFlags.get(key) != null; } - public int getQuestFlag(String key){ + + public int getQuestFlag(String key) { return (int) questFlags.getOrDefault(key, (byte) 0); } - public void resetQuestFlags(){ + + public void resetQuestFlags() { questFlags.clear(); } - public void addQuest(String questID){ + public void addQuest(String questID) { int id = Integer.parseInt(questID); addQuest(id); } - public void addQuest(int questID){ + public void addQuest(int questID) { AdventureQuestData toAdd = AdventureQuestController.instance().generateQuest(questID); - if (toAdd != null){ + if (toAdd != null) { addQuest(toAdd); } } - public void addQuest(AdventureQuestData q){ + public void addQuest(AdventureQuestData q) { //TODO: add a config flag for this boolean autoTrack = true; - for (AdventureQuestData existing : quests){ - if (autoTrack && existing.isTracked) - { + for (AdventureQuestData existing : quests) { + if (autoTrack && existing.isTracked) { autoTrack = false; break; } @@ -738,23 +825,21 @@ public class AdventurePlayer implements Serializable, SaveFileContent { return quests; } - public int getEnemyDeckNumber(String enemyName, int maxDecks){ - int deckNumber = 0; - if (statistic.getWinLossRecord().get(enemyName)!=null) - { - int playerWins = statistic.getWinLossRecord().get(enemyName).getKey(); - int enemyWins = statistic.getWinLossRecord().get(enemyName).getValue(); - if (playerWins > enemyWins){ - int deckNumberAfterAlgorithmOutput = (int)((playerWins-enemyWins) * (difficultyData.enemyLifeFactor / 3)); - if (deckNumberAfterAlgorithmOutput < maxDecks){ - deckNumber = deckNumberAfterAlgorithmOutput; - } - else { - deckNumber = maxDecks-1; + public int getEnemyDeckNumber(String enemyName, int maxDecks) { + int deckNumber = 0; + if (statistic.getWinLossRecord().get(enemyName) != null) { + int playerWins = statistic.getWinLossRecord().get(enemyName).getKey(); + int enemyWins = statistic.getWinLossRecord().get(enemyName).getValue(); + if (playerWins > enemyWins) { + int deckNumberAfterAlgorithmOutput = (int) ((playerWins - enemyWins) * (difficultyData.enemyLifeFactor / 3)); + if (deckNumberAfterAlgorithmOutput < maxDecks) { + deckNumber = deckNumberAfterAlgorithmOutput; + } else { + deckNumber = maxDecks - 1; + } } } - } - return deckNumber; + return deckNumber; } public void removeQuest(AdventureQuestData quest) { diff --git a/forge-gui-mobile/src/forge/adventure/scene/InventoryScene.java b/forge-gui-mobile/src/forge/adventure/scene/InventoryScene.java index 3cf00da2618..f7e6c07c25d 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/InventoryScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/InventoryScene.java @@ -39,11 +39,11 @@ public class InventoryScene extends UIScene { public InventoryScene() { super(Forge.isLandscapeMode() ? "ui/inventory.json" : "ui/inventory_portrait.json"); equipOverlay = Forge.getAssets().getTexture(Config.instance().getFile(Paths.ITEMS_EQUIP)); - ui.onButtonPress("return", () -> done()); + ui.onButtonPress("return", this::done); leave = ui.findActor("return"); - ui.onButtonPress("delete", () -> showConfirm()); - ui.onButtonPress("equip", () -> equip()); - ui.onButtonPress("use", () -> use()); + ui.onButtonPress("delete", this::showConfirm); + ui.onButtonPress("equip", this::equip); + ui.onButtonPress("use", this::use); equipButton = ui.findActor("equip"); useButton = ui.findActor("use"); useButton.setDisabled(true); @@ -299,7 +299,6 @@ public class InventoryScene extends UIScene { } public Button createInventorySlot() { - ImageButton button = new ImageButton(Controls.getSkin(), "item_frame"); - return button; + return new ImageButton(Controls.getSkin(), "item_frame"); } } diff --git a/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java b/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java index 712aacd2d67..3488ceb0450 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java @@ -1,6 +1,5 @@ package forge.adventure.scene; -import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.scenes.scene2d.ui.Image; @@ -32,7 +31,7 @@ public class MapViewScene extends UIScene { super(Forge.isLandscapeMode() ? "ui/map.json" : "ui/map_portrait.json"); - ui.onButtonPress("done", () -> done()); + ui.onButtonPress("done", this::done); scroll = ui.findActor("map"); Group table=new Group(); @@ -78,13 +77,4 @@ public class MapViewScene extends UIScene { super.enter(); } - - @Override - public boolean keyPressed(int keycode) { - if (keycode == Input.Keys.ESCAPE || keycode == Input.Keys.BACK || keycode == Input.Keys.BUTTON_B) { - done(); - } - return true; - } - } diff --git a/forge-gui-mobile/src/forge/adventure/stage/GameHUD.java b/forge-gui-mobile/src/forge/adventure/stage/GameHUD.java index 0f89fdb4477..49d33adfb53 100644 --- a/forge-gui-mobile/src/forge/adventure/stage/GameHUD.java +++ b/forge-gui-mobile/src/forge/adventure/stage/GameHUD.java @@ -22,12 +22,12 @@ import com.github.tommyettinger.textra.TextraButton; import com.github.tommyettinger.textra.TextraLabel; import com.github.tommyettinger.textra.TypingLabel; import forge.Forge; +import forge.adventure.data.ItemData; import forge.adventure.player.AdventurePlayer; import forge.adventure.scene.*; import forge.adventure.util.*; import forge.adventure.world.WorldSave; import forge.deck.Deck; -import forge.gui.FThreads; import forge.gui.GuiBase; import forge.localinstance.properties.ForgePreferences; import forge.model.FModel; @@ -51,16 +51,15 @@ public class GameHUD extends Stage { private final Touchpad touchpad; private final Console console; float TOUCHPAD_SCALE = 70f, referenceX; - boolean isHiding = false, isShowing = false; float opacity = 1f; private boolean debugMap, updatelife; private final Dialog dialog; private boolean dialogOnlyInput; private final Array dialogButtonMap = new Array<>(); + private final Array abilityButtonMap = new Array<>(); private final Array questKeys = new Array<>(); private String lifepointsTextColor = ""; - private TextraButton selectedKey; private final ScrollPane scrollPane; private GameHUD(GameStage gameStage) { @@ -68,9 +67,7 @@ public class GameHUD extends Stage { instance = this; this.gameStage = gameStage; - ui = new UIActor(Config.instance().getFile(GuiBase.isAndroid() - ? Forge.isLandscapeMode() ? "ui/hud_landscape.json" : "ui/hud_portrait.json" - : Forge.isLandscapeMode() ? "ui/hud.json" : "ui/hud_portrait.json")); + ui = new UIActor(Config.instance().getFile(Forge.isLandscapeMode() ? "ui/hud_landscape.json" : "ui/hud_portrait.json")); blank = ui.findActor("blank"); @@ -80,7 +77,7 @@ public class GameHUD extends Stage { avatarborder = ui.findActor("avatarborder"); deckActor = ui.findActor("deck"); openMapActor = ui.findActor("openmap"); - ui.onButtonPress("openmap", () -> GameHUD.this.openMap()); + ui.onButtonPress("openmap", this::openMap); menuActor = ui.findActor("menu"); referenceX = menuActor.getX(); logbookActor = ui.findActor("logbook"); @@ -113,11 +110,11 @@ public class GameHUD extends Stage { ui.addActor(touchpad); avatar = ui.findActor("avatar"); - ui.onButtonPress("menu", () -> menu()); - ui.onButtonPress("inventory", () -> openInventory()); - ui.onButtonPress("logbook", () -> logbook()); - ui.onButtonPress("deck", () -> openDeck()); - ui.onButtonPress("exittoworldmap", () -> exitToWorldMap()); + ui.onButtonPress("menu", this::menu); + ui.onButtonPress("inventory", this::openInventory); + ui.onButtonPress("logbook", this::logbook); + ui.onButtonPress("deck", this::openDeck); + ui.onButtonPress("exittoworldmap", this::exitToWorldMap); lifePoints = ui.findActor("lifePoints"); shards = ui.findActor("shards"); money = ui.findActor("money"); @@ -131,6 +128,7 @@ public class GameHUD extends Stage { addActor(scrollPane); AdventurePlayer.current().onLifeChange(() -> lifePoints.setText("[%95][+Life]" + lifepointsTextColor + " " + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife())); AdventurePlayer.current().onShardsChange(() -> shards.setText("[%95][+Shards] " + AdventurePlayer.current().getShards())); + AdventurePlayer.current().onEquipmentChanged(this::updateAbility); WorldSave.getCurrentSave().getPlayer().onGoldChange(() -> money.setText("[%95][+Gold] " + String.valueOf(AdventurePlayer.current().getGold()))); addActor(ui); @@ -144,7 +142,7 @@ public class GameHUD extends Stage { avatarborder.addListener(new ConsoleToggleListener()); gamehud.addListener(new ConsoleToggleListener()); } - WorldSave.getCurrentSave().onLoad(() -> GameHUD.this.enter()); + WorldSave.getCurrentSave().onLoad(this::enter); eventTouchDown = new InputEvent(); eventTouchDown.setPointer(-1); eventTouchDown.setType(InputEvent.Type.touchDown); @@ -230,7 +228,6 @@ public class GameHUD extends Stage { touchpad.setBounds(touch.x - TOUCHPAD_SCALE / 2, touch.y - TOUCHPAD_SCALE / 2, TOUCHPAD_SCALE, TOUCHPAD_SCALE); touchpad.setVisible(true); touchpad.setResetOnTouchUp(true); - hideButtons(); return super.touchDown(screenX, screenY, pointer, button); } } @@ -333,6 +330,41 @@ public class GameHUD extends Stage { } } + void updateAbility() { + for (TextraButton button : abilityButtonMap) { + button.remove(); + } + abilityButtonMap.clear(); + setAbilityButton(AdventurePlayer.current().getEquippedAbility1()); + setAbilityButton(AdventurePlayer.current().getEquippedAbility2()); + float x = Forge.isLandscapeMode() ? 426f : 216f; + float y = 10f; + float w = 45f; + float h = 35f; + for (TextraButton button : abilityButtonMap) { + button.getColor().a = opacity; + button.setSize(w, h); + button.setPosition(x, y); + y += h + 10f; + addActor(button); + } + } + + void setAbilityButton(ItemData data) { + if (data != null) { + TextraButton button = Controls.newTextButton("[%120][+" + data.iconName + "][+Shards]" + data.shardsNeeded, () -> { + boolean isInPoi = MapStage.getInstance().isInMap(); + if (!(isInPoi && data.usableInPoi || !isInPoi && data.usableOnWorldMap)) + return; + if (data.shardsNeeded > Current.player().getShards()) + return; + Current.player().addShards(-data.shardsNeeded); + ConsoleCommandInterpreter.getInstance().command(data.commandOnUse); + }); + abilityButtonMap.add(button); + } + } + private Pair audio = null; public void playAudio() { @@ -368,12 +400,12 @@ public class GameHUD extends Stage { public void act(float delta) { super.act(delta); if (fade < targetfade) { - fade += (delta/2); + fade += (delta / 2); if (fade > targetfade) fade = targetfade; fadeAudio(fade); } else if (fade > targetfade) { - fade -= (delta/2); + fade -= (delta / 2); if (fade < targetfade) fade = targetfade; fadeAudio(fade); @@ -479,6 +511,11 @@ public class GameHUD extends Stage { actor.setVisible(visible); } + private void setDisabled(Actor actor, boolean enable) { + if (actor != null && actor instanceof Button) + ((Button) actor).setDisabled(enable); + } + private void setAlpha(Actor actor, boolean visible) { if (actor != null) { if (visible) @@ -498,7 +535,7 @@ public class GameHUD extends Stage { setVisibility(shards, visible); setVisibility(money, visible); setVisibility(blank, visible); - setVisibility(exitToWorldMapActor, GameScene.instance().isNotInWorldMap()); + setDisabled(exitToWorldMapActor, !GameScene.instance().isNotInWorldMap()); setAlpha(avatarborder, visible); setAlpha(avatar, visible); setAlpha(deckActor, visible); @@ -506,6 +543,9 @@ public class GameHUD extends Stage { setAlpha(logbookActor, visible); setAlpha(inventoryActor, visible); setAlpha(exitToWorldMapActor, visible); + for (TextraButton button : abilityButtonMap) { + setAlpha(button, visible); + } opacity = visible ? 1f : 0.4f; } @@ -528,11 +568,6 @@ public class GameHUD extends Stage { if (keycode == Input.Keys.BACK) { if (console.isVisible()) { console.toggle(); - } else { - if (menuActor.isVisible()) - hideButtons(); - else - showButtons(); } } if (console.isVisible()) @@ -571,38 +606,6 @@ public class GameHUD extends Stage { }, 0.10f); } - private void hideButtons() { - if (isShowing) - return; - if (isHiding) - return; - isHiding = true; - deckActor.addAction(Actions.sequence(Actions.fadeOut(0.10f), Actions.hide(), Actions.moveTo(deckActor.getX() + deckActor.getWidth(), deckActor.getY()))); - inventoryActor.addAction(Actions.sequence(Actions.fadeOut(0.15f), Actions.hide(), Actions.moveTo(inventoryActor.getX() + inventoryActor.getWidth(), inventoryActor.getY()))); - logbookActor.addAction(Actions.sequence(Actions.fadeOut(0.20f), Actions.hide(), Actions.moveTo(logbookActor.getX() + logbookActor.getWidth(), logbookActor.getY()))); - menuActor.addAction(Actions.sequence(Actions.fadeOut(0.25f), Actions.hide(), Actions.moveTo(menuActor.getX() + menuActor.getWidth(), menuActor.getY()))); - if (GameScene.instance().isNotInWorldMap()) - exitToWorldMapActor.addAction(Actions.sequence(Actions.fadeOut(0.2f), Actions.hide(), Actions.moveTo(exitToWorldMapActor.getX() + exitToWorldMapActor.getWidth(), exitToWorldMapActor.getY()))); - FThreads.delayInEDT(300, () -> isHiding = false); - } - - private void showButtons() { - if (console.isVisible()) - return; - if (isHiding) - return; - if (isShowing) - return; - isShowing = true; - menuActor.addAction(Actions.sequence(Actions.delay(0.1f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, menuActor.getY(), 0.25f)))); - logbookActor.addAction(Actions.sequence(Actions.delay(0.15f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, logbookActor.getY(), 0.25f)))); - inventoryActor.addAction(Actions.sequence(Actions.delay(0.2f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, inventoryActor.getY(), 0.25f)))); - deckActor.addAction(Actions.sequence(Actions.delay(0.25f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, deckActor.getY(), 0.25f)))); - if (GameScene.instance().isNotInWorldMap()) - exitToWorldMapActor.addAction(Actions.sequence(Actions.delay(0.25f), Actions.parallel(Actions.show(), Actions.alpha(opacity, 0.1f), Actions.moveTo(referenceX, exitToWorldMapActor.getY(), 0.25f)))); - FThreads.delayInEDT(300, () -> isShowing = false); - } - public void setDebug(boolean b) { debugMap = b; } @@ -626,13 +629,12 @@ public class GameHUD extends Stage { public boolean act(float v) { if (exitDungeon) { MapStage.getInstance().exitDungeon(); - exitToWorldMapActor.setVisible(false); + setDisabled(exitToWorldMapActor, true); } return true; } })); dialogOnlyInput = false; - selectedKey = null; } private void selectNextDialogButton() { @@ -677,18 +679,9 @@ public class GameHUD extends Stage { @Override public boolean longPress(Actor actor, float x, float y) { - hideButtons(); console.toggle(); return super.longPress(actor, x, y); } - - @Override - public void tap(InputEvent event, float x, float y, int count, int button) { - super.tap(event, x, y, count, button); - //show menu buttons if double tapping the avatar, for android devices without visible navigation buttons - if (count > 1) - showButtons(); - } } public void updateMusic() { diff --git a/forge-gui-mobile/src/forge/adventure/util/AdventureQuestController.java b/forge-gui-mobile/src/forge/adventure/util/AdventureQuestController.java index 9784a5ca73f..f508e47097d 100644 --- a/forge-gui-mobile/src/forge/adventure/util/AdventureQuestController.java +++ b/forge-gui-mobile/src/forge/adventure/util/AdventureQuestController.java @@ -17,7 +17,6 @@ import forge.util.Aggregates; import java.io.Serializable; import java.time.LocalDate; import java.util.*; -import java.util.List; public class AdventureQuestController implements Serializable { diff --git a/forge-gui/res/adventure/Shandalar/ui/deck_selector_portrait.json b/forge-gui/res/adventure/Shandalar/ui/deck_selector_portrait.json index 65a62df2d12..9972c0107e7 100644 --- a/forge-gui/res/adventure/Shandalar/ui/deck_selector_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/deck_selector_portrait.json @@ -21,7 +21,6 @@ "type": "TextButton", "name": "return", "text": "tr(lblBack)", - "binding": "Back", "width": 86, "height": 30, "x": 4, @@ -31,7 +30,6 @@ "type": "TextButton", "name": "rename", "text": "tr(lblRename)", - "binding": "Equip", "width": 86, "height": 30, "x": 92, @@ -41,7 +39,6 @@ "type": "TextButton", "name": "edit", "text": "tr(lblEdit)", - "binding": "Use", "width": 86, "height": 30, "x": 180, diff --git a/forge-gui/res/adventure/Shandalar/ui/hud_landscape.json b/forge-gui/res/adventure/Shandalar/ui/hud_landscape.json index dc0eb34866b..a18af1a95ac 100644 --- a/forge-gui/res/adventure/Shandalar/ui/hud_landscape.json +++ b/forge-gui/res/adventure/Shandalar/ui/hud_landscape.json @@ -85,45 +85,42 @@ { "type": "TextButton", "name": "deck", - "style":"menu", "text": "[%120][+Deck]", "binding": "Deck", - "width": 64, - "height": 36, - "x": 416, - "y": 106 + "width": 45, + "height": 25, + "x": 175, + "y": 0 }, { "type": "TextButton", "name": "inventory", - "style":"menu", "text": "[%120][+Item]", "binding": "Inventory", - "width": 64, - "height": 36, - "x": 416, - "y": 146 + "width": 45, + "height": 25, + "x": 220, + "y": 0 }, { "type": "TextButton", "name": "logbook", - "style":"menu", "text": "[%120][+Logbook]", - "width": 64, - "height": 36, - "x": 416, - "y": 186 + "binding": "Status", + "width": 45, + "height": 25, + "x": 265, + "y": 0 }, { "type": "TextButton", "name": "menu", - "style":"menu", "text": "[%120][+Menu]", "binding": "Menu", - "width": 64, - "height": 36, - "x": 416, - "y": 226 + "width": 45, + "height": 25, + "x": 130, + "y": 0 }, { "type": "TextButton", @@ -138,13 +135,12 @@ { "type": "TextButton", "name": "exittoworldmap", - "style":"menu", "text": "[%120][+ExitToWorldMap]", "binding": "ExitToWorldMap", - "width": 64, - "height": 32, - "x": 416, - "y": 66 + "width": 45, + "height": 25, + "x": 310, + "y": 0 } ] } \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/ui/hud_portrait.json b/forge-gui/res/adventure/Shandalar/ui/hud_portrait.json index 4d8f7d73e58..f29e66a2401 100644 --- a/forge-gui/res/adventure/Shandalar/ui/hud_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/hud_portrait.json @@ -84,53 +84,44 @@ { "type": "TextButton", "name": "deck", - "style":"menu", "text": "[%120][+Deck]", - "binding": "Deck", - "width": 64, - "height": 32, - "x": 206, - "y": 306 + "width": 25, + "height": 25, + "x": 105, + "y": 0 }, { "type": "TextButton", "name": "inventory", - "style":"menu", "text": "[%120][+Item]", - "binding": "Inventory", - "width": 64, - "height": 32, - "x": 206, - "y": 346 + "width": 25, + "height": 25, + "x": 130, + "y": 0 }, { "type": "TextButton", "name": "logbook", - "style":"menu", "text": "[%120][+Logbook]", - "binding": "Status", - "width": 64, - "height": 32, - "x": 206, - "y": 386 + "width": 25, + "height": 25, + "x": 155, + "y": 0 }, { "type": "TextButton", "name": "menu", - "style":"menu", "text": "[%120][+Menu]", - "binding": "Menu", - "width": 64, - "height": 32, - "x": 206, - "y": 426 + "width": 25, + "height": 25, + "x": 80, + "y": 0 }, { "type": "TextButton", "name": "openmap", "text": "[%80]tr(lblZoom)", - "binding": "Map", "width": 80, "height": 20, "x": 0, @@ -138,14 +129,12 @@ }, { "type": "TextButton", - "name": "exittoworldmap", - "style":"menu", + "name": "exittoworldmap", "text": "[%120][+ExitToWorldMap]", - "binding": "ExitToWorldMap", - "width": 64, - "height": 32, - "x": 206, - "y": 266 + "width": 25, + "height": 25, + "x": 180, + "y": 0 } ] } \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/ui/inn_portrait.json b/forge-gui/res/adventure/Shandalar/ui/inn_portrait.json index eb6ba344c16..1a7c8722071 100644 --- a/forge-gui/res/adventure/Shandalar/ui/inn_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/inn_portrait.json @@ -22,7 +22,6 @@ "type": "TextButton", "name": "tempHitPointCost", "text": "Cost", - "binding": "Status", "width": 100, "height": 30, "x": 165, @@ -51,7 +50,6 @@ "type": "TextButton", "name": "sell", "text": "tr(lblSell)", - "binding": "Equip", "width": 100, "height": 30, "x": 165, @@ -70,7 +68,6 @@ "type": "TextButton", "name": "done", "text": "tr(lblBack)", - "binding": "Back", "width": 100, "height": 30, "x": 165, diff --git a/forge-gui/res/adventure/Shandalar/ui/inventory.json b/forge-gui/res/adventure/Shandalar/ui/inventory.json index f025b8fa88c..cf4d971a56e 100644 --- a/forge-gui/res/adventure/Shandalar/ui/inventory.json +++ b/forge-gui/res/adventure/Shandalar/ui/inventory.json @@ -17,6 +17,24 @@ "width": 129, "height": 243 }, + { + "type": "ImageButton", + "name": "Equipment_Ability1", + "style": "item_frame", + "width": 20, + "height": 20, + "x": 17, + "y": 20 + }, + { + "type": "ImageButton", + "name": "Equipment_Ability2", + "style": "item_frame", + "width": 20, + "height": 20, + "x": 107, + "y": 20 + }, { "type": "ImageButton", "name": "Equipment_Neck", diff --git a/forge-gui/res/adventure/Shandalar/ui/inventory_portrait.json b/forge-gui/res/adventure/Shandalar/ui/inventory_portrait.json index c55ddeace12..e561453c675 100644 --- a/forge-gui/res/adventure/Shandalar/ui/inventory_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/inventory_portrait.json @@ -16,7 +16,25 @@ "y": 112, "width": 129, "height": 243 - }, + }, + { + "type": "ImageButton", + "name": "Equipment_Ability1", + "style": "item_frame", + "width": 20, + "height": 20, + "x": 17, + "y": 124 + }, + { + "type": "ImageButton", + "name": "Equipment_Ability2", + "style": "item_frame", + "width": 20, + "height": 20, + "x": 107, + "y": 124 + }, { "type": "ImageButton", "name": "Equipment_Neck", @@ -25,7 +43,7 @@ "height": 20, "x": 62, "y": 144 - } , + }, { "type": "ImageButton", "name": "Equipment_Body", @@ -34,7 +52,7 @@ "height": 20, "x": 62, "y": 189 - } , + }, { "type": "ImageButton", "name": "Equipment_Boots", @@ -43,7 +61,7 @@ "height": 20, "x": 62, "y": 324 - } , + }, { "type": "ImageButton", "name": "Equipment_Left", @@ -84,12 +102,11 @@ "y": 16, "width": 246, "height": 90 - } , + }, { "type": "TextButton", "name": "delete", "text": "tr(lblDispose)", - "binding": "Status", "width": 60, "height": 30, "x": 8, @@ -99,7 +116,6 @@ "type": "TextButton", "name": "equip", "text": "tr(lblEquip)", - "binding": "Equip", "width": 60, "height": 30, "x": 75, @@ -109,7 +125,6 @@ "type": "TextButton", "name": "use", "text": "tr(lblUse)", - "binding": "Use", "width": 60, "height": 30, "x": 140, @@ -119,7 +134,6 @@ "type": "TextButton", "name": "return", "text": "tr(lblBack)", - "binding": "Back", "width": 60, "height": 30, "x": 205, diff --git a/forge-gui/res/adventure/Shandalar/ui/items_portrait.json b/forge-gui/res/adventure/Shandalar/ui/items_portrait.json index 45d33a8a045..31663fbbbcf 100644 --- a/forge-gui/res/adventure/Shandalar/ui/items_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/items_portrait.json @@ -28,7 +28,6 @@ "type": "TextButton", "name": "detail", "text": "Detail", - "binding": "Equip", "width": 128, "height": 32, "x": 140, @@ -38,7 +37,6 @@ "type": "TextButton", "name": "done", "text": "tr(lblLeave)", - "binding": "Back", "width": 128, "height": 32, "x": 140, diff --git a/forge-gui/res/adventure/Shandalar/ui/map_portrait.json b/forge-gui/res/adventure/Shandalar/ui/map_portrait.json index 6eeb1cba545..9e165c0f637 100644 --- a/forge-gui/res/adventure/Shandalar/ui/map_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/map_portrait.json @@ -13,7 +13,6 @@ "type": "TextButton", "name": "done", "text": "[%80]tr(lblBack)", - "binding": "Back", "width": 48, "height": 20, "x": 5, diff --git a/forge-gui/res/adventure/Shandalar/ui/new_game_portrait.json b/forge-gui/res/adventure/Shandalar/ui/new_game_portrait.json index 6ffc8a8a582..0fab6dc9ef8 100644 --- a/forge-gui/res/adventure/Shandalar/ui/new_game_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/new_game_portrait.json @@ -187,7 +187,6 @@ "name": "back", "text": "tr(lblBack)", "selectable": true, - "binding": "Back", "width": 64, "height": 28, "x": 32, @@ -198,7 +197,6 @@ "name": "start", "text": "tr(lblStart)", "selectable": true, - "binding": "Status", "width": 64, "height": 28, "x": 165, diff --git a/forge-gui/res/adventure/Shandalar/ui/quests_portrait.json b/forge-gui/res/adventure/Shandalar/ui/quests_portrait.json index 6cfc29125d4..0a8400244a5 100644 --- a/forge-gui/res/adventure/Shandalar/ui/quests_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/quests_portrait.json @@ -66,7 +66,6 @@ "type": "TextButton", "name": "return", "text": "tr(lblBack)", - "binding": "Back", "width": 130, "height": 30, "x": 135, @@ -76,7 +75,6 @@ "type": "TextButton", "name": "status", "text": "Status", - "binding": "Status", "width": 130, "height": 30, "x": 5, diff --git a/forge-gui/res/adventure/Shandalar/ui/save_load_portrait.json b/forge-gui/res/adventure/Shandalar/ui/save_load_portrait.json index 0657e17d835..9c5f9202b2f 100644 --- a/forge-gui/res/adventure/Shandalar/ui/save_load_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/save_load_portrait.json @@ -45,7 +45,6 @@ "type": "TextButton", "name": "return", "text": "tr(lblBack)", - "binding": "Back", "width": 120, "height": 32, "x": 10, @@ -54,7 +53,6 @@ { "type": "TextButton", "name": "save", - "binding": "Use", "width": 120, "height": 32, "x": 140, diff --git a/forge-gui/res/adventure/Shandalar/ui/settings_portrait.json b/forge-gui/res/adventure/Shandalar/ui/settings_portrait.json index 2589272e2e9..eb9ec94b0ae 100644 --- a/forge-gui/res/adventure/Shandalar/ui/settings_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/settings_portrait.json @@ -21,7 +21,6 @@ "type": "TextButton", "name": "return", "text": "tr(lblBack)", - "binding": "Back", "width": 250, "height": 32, "x": 10, diff --git a/forge-gui/res/adventure/Shandalar/ui/shardtrader_portrait.json b/forge-gui/res/adventure/Shandalar/ui/shardtrader_portrait.json index 67ca39c0390..ee9464962d4 100644 --- a/forge-gui/res/adventure/Shandalar/ui/shardtrader_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/shardtrader_portrait.json @@ -22,7 +22,6 @@ "type": "TextButton", "name": "btnBuyShardsCost", "text": "btnBuyShardsCost", - "binding": "Status", "width": 100, "height": 30, "x": 165, @@ -41,7 +40,6 @@ "type": "TextButton", "name": "btnSellShardsQuantity", "text": "btnSellShardsQuantity", - "binding": "Equip", "width": 100, "height": 30, "x": 165, @@ -60,7 +58,6 @@ "type": "TextButton", "name": "done", "text": "tr(lblBack)", - "binding": "Back", "width": 100, "height": 30, "x": 165, diff --git a/forge-gui/res/adventure/Shandalar/ui/spellsmith_portrait.json b/forge-gui/res/adventure/Shandalar/ui/spellsmith_portrait.json index ce7935278ae..dd0a389b188 100644 --- a/forge-gui/res/adventure/Shandalar/ui/spellsmith_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/spellsmith_portrait.json @@ -64,7 +64,6 @@ "selectable": true, "name": "done", "text": "tr(lblBack)", - "binding": "Back", "x": 180, "y": 150, "width": 90, @@ -151,7 +150,6 @@ "type": "TextButton", "selectable": true, "name": "pullUsingGold", - "binding": "Status", "text": "tr(lblDraw) [+gold]", "x": 180, "y": 25, @@ -171,7 +169,6 @@ "type": "TextButton", "selectable": true, "name": "pullUsingShards", - "binding": "Equip", "text": "tr(lblDraw) [+shards]", "x": 180, "y": 75, diff --git a/forge-gui/res/adventure/Shandalar/ui/start_menu_portrait.json b/forge-gui/res/adventure/Shandalar/ui/start_menu_portrait.json index 8f662520582..484bab545b7 100644 --- a/forge-gui/res/adventure/Shandalar/ui/start_menu_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/start_menu_portrait.json @@ -54,7 +54,6 @@ "name": "Resume", "text": "tr(lblResume)", "selectable": true, - "binding": "Back", "width": 238, "height": 48, "x": 16, diff --git a/forge-gui/res/adventure/Shandalar/ui/statistic_portrait.json b/forge-gui/res/adventure/Shandalar/ui/statistic_portrait.json index bfbecae1869..3f8b45b6187 100644 --- a/forge-gui/res/adventure/Shandalar/ui/statistic_portrait.json +++ b/forge-gui/res/adventure/Shandalar/ui/statistic_portrait.json @@ -112,7 +112,6 @@ "type": "TextButton", "name": "return", "text": "tr(lblBack)", - "binding": "Back", "width": 115, "height": 30, "x": 155, @@ -122,7 +121,6 @@ "type": "TextButton", "name": "quests", "text": "Quests", - "binding": "Status", "width": 115, "height": 30, "x": 35, diff --git a/forge-gui/res/adventure/Shandalar/world/items.json b/forge-gui/res/adventure/Shandalar/world/items.json index 93040574945..2d023e2a37d 100644 --- a/forge-gui/res/adventure/Shandalar/world/items.json +++ b/forge-gui/res/adventure/Shandalar/world/items.json @@ -869,7 +869,8 @@ }, { "name": "Colorless rune", - "usableOnWorldMap":true, + "usableOnWorldMap":true, + "equipmentSlot": "Ability2", "description": "Teleports you to the center", "commandOnUse": "teleport to poi Spawn", "iconName": "ColorlessRune", @@ -880,6 +881,7 @@ { "name": "White rune", "usableOnWorldMap":true, + "equipmentSlot": "Ability2", "effect": { "name": "" }, @@ -893,6 +895,7 @@ { "name": "Black rune", "usableOnWorldMap":true, + "equipmentSlot": "Ability2", "effect": { "name": "" }, @@ -906,6 +909,7 @@ { "name": "Blue rune", "usableOnWorldMap":true, + "equipmentSlot": "Ability2", "effect": { "name": "" }, @@ -919,6 +923,7 @@ { "name": "Red rune", "usableOnWorldMap":true, + "equipmentSlot": "Ability2", "effect": { "name": "" }, @@ -932,6 +937,7 @@ { "name": "Green rune", "usableOnWorldMap":true, + "equipmentSlot": "Ability2", "effect": { "name": "" }, @@ -944,6 +950,7 @@ }, { "name": "White Staff", + "equipmentSlot": "Ability1", "usableOnWorldMap":true, "usableInPoi":true, "effect": { @@ -958,6 +965,7 @@ }, { "name": "Black Staff", + "equipmentSlot": "Ability1", "usableOnWorldMap":true, "usableInPoi":false, "effect": { @@ -973,6 +981,7 @@ { "name": "Blue Staff", "usableOnWorldMap":true, + "equipmentSlot": "Ability1", "effect": { "name": "" }, @@ -986,6 +995,7 @@ { "name": "Red Staff", "usableOnWorldMap":true, + "equipmentSlot": "Ability1", "effect": { "name": "" }, @@ -998,6 +1008,7 @@ }, { "name": "Green Staff", + "equipmentSlot": "Ability1", "usableOnWorldMap":true, "usableInPoi":true, "effect": {