mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge pull request #3566 from kevlahnota/newmaster2
add Bookmark to GameHUD
This commit is contained in:
@@ -2,14 +2,11 @@ package forge.adventure.data;
|
|||||||
|
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.g2d.Sprite;
|
import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.Json;
|
import com.badlogic.gdx.utils.Json;
|
||||||
import forge.adventure.util.Config;
|
import forge.adventure.util.Config;
|
||||||
import forge.adventure.util.Paths;
|
import forge.adventure.util.Paths;
|
||||||
|
|
||||||
import static forge.adventure.util.Paths.ITEMS_ATLAS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data class that will be used to read Json configuration files
|
* Data class that will be used to read Json configuration files
|
||||||
* ItemData
|
* ItemData
|
||||||
@@ -49,16 +46,9 @@ public class ItemData {
|
|||||||
shardsNeeded = cpy.shardsNeeded;
|
shardsNeeded = cpy.shardsNeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sprite sprite()
|
public Sprite sprite() {
|
||||||
{
|
return Config.instance().getItemSprite(iconName);
|
||||||
if(itemAtlas==null)
|
|
||||||
{
|
|
||||||
itemAtlas=Config.instance().getAtlas(ITEMS_ATLAS);
|
|
||||||
}
|
}
|
||||||
return itemAtlas.createSprite(iconName);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static TextureAtlas itemAtlas;
|
|
||||||
private static Array<ItemData> itemList;
|
private static Array<ItemData> itemList;
|
||||||
public static Array<ItemData> getAllItems() {
|
public static Array<ItemData> getAllItems() {
|
||||||
if (itemList == null) {
|
if (itemList == null) {
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
return inventoryItems;
|
return inventoryItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Array<Deck> getBoostersOwned(){
|
public Array<Deck> getBoostersOwned() {
|
||||||
return boostersOwned;
|
return boostersOwned;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,11 +373,10 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
}
|
}
|
||||||
if (data.containsKey("boosters")) {
|
if (data.containsKey("boosters")) {
|
||||||
Deck[] decks = (Deck[]) data.readObject("boosters");
|
Deck[] decks = (Deck[]) data.readObject("boosters");
|
||||||
for (Deck d : decks){
|
for (Deck d : decks) {
|
||||||
if (d != null && !d.isEmpty()){
|
if (d != null && !d.isEmpty()) {
|
||||||
boostersOwned.add(d);
|
boostersOwned.add(d);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
System.err.printf("Null or empty booster %s\n", d);
|
System.err.printf("Null or empty booster %s\n", d);
|
||||||
System.out.println("You have an empty booster pack in your inventory.");
|
System.out.println("You have an empty booster pack in your inventory.");
|
||||||
}
|
}
|
||||||
@@ -418,7 +417,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
events.clear();
|
events.clear();
|
||||||
Object[] q = (Object[]) data.readObject("events");
|
Object[] q = (Object[]) data.readObject("events");
|
||||||
if (q != null) {
|
if (q != null) {
|
||||||
for (Object itsReallyAnEvent : q){
|
for (Object itsReallyAnEvent : q) {
|
||||||
events.add((AdventureEventData) itsReallyAnEvent);
|
events.add((AdventureEventData) itsReallyAnEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -587,7 +586,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
case Card:
|
case Card:
|
||||||
cards.add(reward.getCard());
|
cards.add(reward.getCard());
|
||||||
newCards.add(reward.getCard());
|
newCards.add(reward.getCard());
|
||||||
if (reward.isNoSell()){
|
if (reward.isNoSell()) {
|
||||||
noSellCards.add(reward.getCard());
|
noSellCards.add(reward.getCard());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1054,9 +1053,9 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
* @return int - index of new copy slot, or -1 if no slot was available
|
* @return int - index of new copy slot, or -1 if no slot was available
|
||||||
*/
|
*/
|
||||||
public int copyDeck() {
|
public int copyDeck() {
|
||||||
for (int i = 0; i < decks.length; i++ ){
|
for (int i = 0; i < decks.length; i++) {
|
||||||
if (isEmptyDeck(i)) {
|
if (isEmptyDeck(i)) {
|
||||||
decks[i] = (Deck)deck.copyTo(deck.getName() + " (" + Forge.getLocalizer().getMessage("lblCopy") + ")");
|
decks[i] = (Deck) deck.copyTo(deck.getName() + " (" + Forge.getLocalizer().getMessage("lblCopy") + ")");
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1075,6 +1074,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
public ItemPool<PaperCard> getAutoSellCards() {
|
public ItemPool<PaperCard> getAutoSellCards() {
|
||||||
return autoSellCards;
|
return autoSellCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemPool<PaperCard> getNoSellCards() {
|
public ItemPool<PaperCard> getNoSellCards() {
|
||||||
return noSellCards;
|
return noSellCards;
|
||||||
}
|
}
|
||||||
@@ -1095,7 +1095,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
|
|
||||||
int count = cp.getValue() - noSellCards.count(cp.getKey());
|
int count = cp.getValue() - noSellCards.count(cp.getKey());
|
||||||
|
|
||||||
if (count <=0) continue;
|
if (count <= 0) continue;
|
||||||
|
|
||||||
if (count > maxCardCounts.getOrDefault(cp.getKey(), 0)) {
|
if (count > maxCardCounts.getOrDefault(cp.getKey(), 0)) {
|
||||||
maxCardCounts.put(cp.getKey(), cp.getValue());
|
maxCardCounts.put(cp.getKey(), cp.getValue());
|
||||||
@@ -1112,7 +1112,6 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public CardPool getCollectionCards(boolean allCards) {
|
public CardPool getCollectionCards(boolean allCards) {
|
||||||
CardPool collectionCards = new CardPool();
|
CardPool collectionCards = new CardPool();
|
||||||
collectionCards.addAll(cards);
|
collectionCards.addAll(cards);
|
||||||
@@ -1124,13 +1123,13 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
return collectionCards;
|
return collectionCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadChanges(PointOfInterestChanges changes){
|
public void loadChanges(PointOfInterestChanges changes) {
|
||||||
this.currentLocationChanges = changes;
|
this.currentLocationChanges = changes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doAutosell() {
|
public void doAutosell() {
|
||||||
int profit = 0;
|
int profit = 0;
|
||||||
for (PaperCard cardToSell: autoSellCards.toFlatList()) {
|
for (PaperCard cardToSell : autoSellCards.toFlatList()) {
|
||||||
profit += AdventurePlayer.current().cardSellPrice(cardToSell);
|
profit += AdventurePlayer.current().cardSellPrice(cardToSell);
|
||||||
autoSellCards.remove(cardToSell);
|
autoSellCards.remove(cardToSell);
|
||||||
cards.remove(cardToSell, 1);
|
cards.remove(cardToSell, 1);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public class PointOfInterestChanges implements SaveFileContent {
|
|||||||
private final java.util.Map<Integer, Long> shopSeeds = new HashMap<>();
|
private final java.util.Map<Integer, Long> shopSeeds = new HashMap<>();
|
||||||
private final java.util.Map<Integer, Float> shopModifiers = new HashMap<>();
|
private final java.util.Map<Integer, Float> shopModifiers = new HashMap<>();
|
||||||
private final java.util.Map<Integer, Integer> reputation = new HashMap<>();
|
private final java.util.Map<Integer, Integer> reputation = new HashMap<>();
|
||||||
|
private Boolean isBookmarked;
|
||||||
|
|
||||||
public static class Map extends HashMap<String,PointOfInterestChanges> implements SaveFileContent {
|
public static class Map extends HashMap<String,PointOfInterestChanges> implements SaveFileContent {
|
||||||
@Override
|
@Override
|
||||||
@@ -62,6 +63,7 @@ public class PointOfInterestChanges implements SaveFileContent {
|
|||||||
mapFlags.putAll((java.util.Map<String, Byte>) data.readObject("mapFlags"));
|
mapFlags.putAll((java.util.Map<String, Byte>) data.readObject("mapFlags"));
|
||||||
shopModifiers.clear();
|
shopModifiers.clear();
|
||||||
shopModifiers.putAll((java.util.Map<Integer, Float>) data.readObject("shopModifiers"));
|
shopModifiers.putAll((java.util.Map<Integer, Float>) data.readObject("shopModifiers"));
|
||||||
|
isBookmarked = (Boolean) data.readObject("isBookmarked");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,6 +74,7 @@ public class PointOfInterestChanges implements SaveFileContent {
|
|||||||
data.storeObject("mapFlags", mapFlags);
|
data.storeObject("mapFlags", mapFlags);
|
||||||
data.storeObject("shopSeeds", shopSeeds);
|
data.storeObject("shopSeeds", shopSeeds);
|
||||||
data.storeObject("shopModifiers", shopModifiers);
|
data.storeObject("shopModifiers", shopModifiers);
|
||||||
|
data.storeObject("isBookmarked", isBookmarked);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,6 +162,14 @@ public class PointOfInterestChanges implements SaveFileContent {
|
|||||||
public boolean hasDeletedObjects() {
|
public boolean hasDeletedObjects() {
|
||||||
return deletedObjects != null && !deletedObjects.isEmpty();
|
return deletedObjects != null && !deletedObjects.isEmpty();
|
||||||
}
|
}
|
||||||
|
public boolean isBookmarked() {
|
||||||
|
if (isBookmarked == null)
|
||||||
|
return false;
|
||||||
|
return isBookmarked;
|
||||||
|
}
|
||||||
|
public void setIsBookmarked(boolean val) {
|
||||||
|
isBookmarked = val;
|
||||||
|
}
|
||||||
|
|
||||||
public void clearDeletedObjects() {
|
public void clearDeletedObjects() {
|
||||||
// reset map when assigning as a quest target that needs enemies
|
// reset map when assigning as a quest target that needs enemies
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.GL20;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.data.BiomeData;
|
import forge.adventure.data.BiomeData;
|
||||||
|
import forge.adventure.pointofintrest.PointOfInterest;
|
||||||
import forge.adventure.stage.MapStage;
|
import forge.adventure.stage.MapStage;
|
||||||
import forge.adventure.stage.WorldStage;
|
import forge.adventure.stage.WorldStage;
|
||||||
import forge.adventure.util.Current;
|
import forge.adventure.util.Current;
|
||||||
@@ -80,6 +81,13 @@ public class GameScene extends HudScene {
|
|||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PointOfInterest getMapPOI() {
|
||||||
|
if (MapStage.getInstance().isInMap()) {
|
||||||
|
return TileMapScene.instance().rootPoint;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isNotInWorldMap() {
|
public boolean isNotInWorldMap() {
|
||||||
String location = getAdventurePlayerLocation(false, true);
|
String location = getAdventurePlayerLocation(false, true);
|
||||||
Set<String> locationTypes = Sets.newHashSet("capital", "castle", "cave", "dungeon", "town");
|
Set<String> locationTypes = Sets.newHashSet("capital", "castle", "cave", "dungeon", "town");
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package forge.adventure.scene;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.graphics.g2d.Sprite;
|
import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.*;
|
import com.badlogic.gdx.scenes.scene2d.ui.*;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||||
@@ -24,8 +23,6 @@ import forge.deck.Deck;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static forge.adventure.util.Paths.ITEMS_ATLAS;
|
|
||||||
|
|
||||||
public class InventoryScene extends UIScene {
|
public class InventoryScene extends UIScene {
|
||||||
TextraButton leave;
|
TextraButton leave;
|
||||||
Button equipButton;
|
Button equipButton;
|
||||||
@@ -350,8 +347,7 @@ public class InventoryScene extends UIScene {
|
|||||||
System.err.print("Can not add null / empty booster " + Current.player().getBoostersOwned().get(i) + "\n");
|
System.err.print("Can not add null / empty booster " + Current.player().getBoostersOwned().get(i) + "\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TextureAtlas atlas = Config.instance().getAtlas(ITEMS_ATLAS);
|
Sprite deckSprite = Config.instance().getItemSprite("Deck");
|
||||||
Sprite deckSprite = atlas.createSprite("Deck");
|
|
||||||
|
|
||||||
Image img = new Image(deckSprite);
|
Image img = new Image(deckSprite);
|
||||||
img.setX((newActor.getWidth() - img.getWidth()) / 2);
|
img.setX((newActor.getWidth() - img.getWidth()) / 2);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package forge.adventure.scene;
|
package forge.adventure.scene;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Group;
|
import com.badlogic.gdx.scenes.scene2d.Group;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||||
@@ -9,6 +10,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
|||||||
import com.github.tommyettinger.textra.TextraButton;
|
import com.github.tommyettinger.textra.TextraButton;
|
||||||
import com.github.tommyettinger.textra.TypingLabel;
|
import com.github.tommyettinger.textra.TypingLabel;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.data.AdventureQuestData;
|
import forge.adventure.data.AdventureQuestData;
|
||||||
import forge.adventure.pointofintrest.PointOfInterest;
|
import forge.adventure.pointofintrest.PointOfInterest;
|
||||||
@@ -19,6 +21,7 @@ import forge.adventure.util.Current;
|
|||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the rewards of a fight or a treasure
|
* Displays the rewards of a fight or a treasure
|
||||||
@@ -33,6 +36,8 @@ public class MapViewScene extends UIScene {
|
|||||||
private final List<TypingLabel> labels;
|
private final List<TypingLabel> labels;
|
||||||
private int index = -1;
|
private int index = -1;
|
||||||
private float avatarX = 0, avatarY = 0;
|
private float avatarX = 0, avatarY = 0;
|
||||||
|
private Set<Vector2> positions;
|
||||||
|
private Set<PointOfInterest> bookmark;
|
||||||
|
|
||||||
public static MapViewScene instance() {
|
public static MapViewScene instance() {
|
||||||
if (object == null)
|
if (object == null)
|
||||||
@@ -46,6 +51,8 @@ public class MapViewScene extends UIScene {
|
|||||||
ui.onButtonPress("quest", this::scroll);
|
ui.onButtonPress("quest", this::scroll);
|
||||||
scroll = ui.findActor("map");
|
scroll = ui.findActor("map");
|
||||||
labels = Lists.newArrayList();
|
labels = Lists.newArrayList();
|
||||||
|
positions = Sets.newHashSet();
|
||||||
|
bookmark = Sets.newHashSet();
|
||||||
table = new Group();
|
table = new Group();
|
||||||
scroll.setActor(table);
|
scroll.setActor(table);
|
||||||
img = new Image();
|
img = new Image();
|
||||||
@@ -62,11 +69,24 @@ public class MapViewScene extends UIScene {
|
|||||||
a.remove();
|
a.remove();
|
||||||
}
|
}
|
||||||
labels.clear();
|
labels.clear();
|
||||||
|
positions.clear();
|
||||||
index = -1;
|
index = -1;
|
||||||
Forge.switchToLast();
|
Forge.switchToLast();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addBookmark(PointOfInterest point) {
|
||||||
|
if (point == null)
|
||||||
|
return;
|
||||||
|
bookmark.add(point);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeBookmark(PointOfInterest point) {
|
||||||
|
if (point == null)
|
||||||
|
return;
|
||||||
|
bookmark.remove(point);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean scroll() {
|
public boolean scroll() {
|
||||||
if (!labels.isEmpty()) {
|
if (!labels.isEmpty()) {
|
||||||
index++;
|
index++;
|
||||||
@@ -99,13 +119,22 @@ public class MapViewScene extends UIScene {
|
|||||||
for (AdventureQuestData adq : Current.player().getQuests()) {
|
for (AdventureQuestData adq : Current.player().getQuests()) {
|
||||||
PointOfInterest poi = adq.getTargetPOI();
|
PointOfInterest poi = adq.getTargetPOI();
|
||||||
if (poi != null) {
|
if (poi != null) {
|
||||||
|
if (positions.contains(poi.getPosition()))
|
||||||
|
continue; //don't map duplicate position to prevent stacking
|
||||||
TypingLabel label = Controls.newTypingLabel("[%?BLACKEN][+GPS]{GRADIENT=RED;WHITE;1;1}>" + adq.name + "{ENDGRADIENT}");
|
TypingLabel label = Controls.newTypingLabel("[%?BLACKEN][+GPS]{GRADIENT=RED;WHITE;1;1}>" + adq.name + "{ENDGRADIENT}");
|
||||||
labels.add(label);
|
labels.add(label);
|
||||||
table.addActor(label);
|
table.addActor(label);
|
||||||
label.setPosition(getMapX(poi.getPosition().x) - label.getWidth() / 2, getMapY(poi.getPosition().y) - label.getHeight() / 2);
|
label.setPosition(getMapX(poi.getPosition().x) - label.getWidth() / 2, getMapY(poi.getPosition().y) - label.getHeight() / 2);
|
||||||
label.skipToTheEnd();
|
label.skipToTheEnd();
|
||||||
|
positions.add(poi.getPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (PointOfInterest poi : bookmark) {
|
||||||
|
TypingLabel label = Controls.newTypingLabel("[%70][+Star]");
|
||||||
|
table.addActor(label);
|
||||||
|
label.setPosition(getMapX(poi.getPosition().x) - label.getWidth() / 2, getMapY(poi.getPosition().y) - label.getHeight() / 2);
|
||||||
|
label.skipToTheEnd();
|
||||||
|
}
|
||||||
TextraButton questButton = ui.findActor("quest");
|
TextraButton questButton = ui.findActor("quest");
|
||||||
if (questButton != null) {
|
if (questButton != null) {
|
||||||
questButton.setDisabled(labels.isEmpty());
|
questButton.setDisabled(labels.isEmpty());
|
||||||
|
|||||||
@@ -518,9 +518,9 @@ public class RewardScene extends UIScene {
|
|||||||
if (Type.Shop != type)
|
if (Type.Shop != type)
|
||||||
return;
|
return;
|
||||||
if (collectionPool != null && Reward.Type.Card.equals(reward.getType()))
|
if (collectionPool != null && Reward.Type.Card.equals(reward.getType()))
|
||||||
setText("[%75]" + price + " [+Gold]\n" + Forge.getLocalizer().getMessage("lblOwned") + ": " + collectionPool.count(reward.getCard()));
|
setText("[%75][+GoldCoin] " + price + "\n" + Forge.getLocalizer().getMessage("lblOwned") + ": " + collectionPool.count(reward.getCard()));
|
||||||
else if (Reward.Type.Item.equals(reward.getType()))
|
else if (Reward.Type.Item.equals(reward.getType()))
|
||||||
setText("[%75]" + price + " [+Gold]\n" + Forge.getLocalizer().getMessage("lblOwned") + ": " + AdventurePlayer.current().countItem(reward.getItem().name));
|
setText("[%75][+GoldCoin] " + price + "\n" + Forge.getLocalizer().getMessage("lblOwned") + ": " + AdventurePlayer.current().countItem(reward.getItem().name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuyButton(int id, int i, RewardActor actor, Reward reward, TextraButton style, float shopModifier) {
|
public BuyButton(int id, int i, RewardActor actor, Reward reward, TextraButton style, float shopModifier) {
|
||||||
@@ -536,7 +536,7 @@ public class RewardScene extends UIScene {
|
|||||||
price = CardUtil.getRewardPrice(actor.getReward());
|
price = CardUtil.getRewardPrice(actor.getReward());
|
||||||
price *= Current.player().goldModifier();
|
price *= Current.player().goldModifier();
|
||||||
price *= shopModifier;
|
price *= shopModifier;
|
||||||
setText(price + " [+Gold]");
|
setText("[+GoldCoin] " + price);
|
||||||
updateOwned();
|
updateOwned();
|
||||||
addListener(new ClickListener() {
|
addListener(new ClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class GameHUD extends Stage {
|
|||||||
private final TextraLabel lifePoints, money, shards, keys;
|
private final TextraLabel lifePoints, money, shards, keys;
|
||||||
private final Image miniMap, gamehud, mapborder, avatarborder, blank;
|
private final Image miniMap, gamehud, mapborder, avatarborder, blank;
|
||||||
private final InputEvent eventTouchDown, eventTouchUp;
|
private final InputEvent eventTouchDown, eventTouchUp;
|
||||||
private final TextraButton deckActor, openMapActor, menuActor, logbookActor, inventoryActor, exitToWorldMapActor;
|
private final TextraButton deckActor, openMapActor, menuActor, logbookActor, inventoryActor, exitToWorldMapActor, bookmarkActor;
|
||||||
public final UIActor ui;
|
public final UIActor ui;
|
||||||
private final Touchpad touchpad;
|
private final Touchpad touchpad;
|
||||||
private final Console console;
|
private final Console console;
|
||||||
@@ -89,6 +89,7 @@ public class GameHUD extends Stage {
|
|||||||
inventoryActor = ui.findActor("inventory");
|
inventoryActor = ui.findActor("inventory");
|
||||||
gamehud = ui.findActor("gamehud");
|
gamehud = ui.findActor("gamehud");
|
||||||
exitToWorldMapActor = ui.findActor("exittoworldmap");
|
exitToWorldMapActor = ui.findActor("exittoworldmap");
|
||||||
|
bookmarkActor = ui.findActor("bookmark");
|
||||||
dialog = Controls.newDialog("");
|
dialog = Controls.newDialog("");
|
||||||
|
|
||||||
miniMapPlayer = new Image(Forge.getAssets().getTexture(Config.instance().getFile("ui/minimap_player.png")));
|
miniMapPlayer = new Image(Forge.getAssets().getTexture(Config.instance().getFile("ui/minimap_player.png")));
|
||||||
@@ -120,6 +121,7 @@ public class GameHUD extends Stage {
|
|||||||
ui.onButtonPress("logbook", this::logbook);
|
ui.onButtonPress("logbook", this::logbook);
|
||||||
ui.onButtonPress("deck", this::openDeck);
|
ui.onButtonPress("deck", this::openDeck);
|
||||||
ui.onButtonPress("exittoworldmap", this::exitToWorldMap);
|
ui.onButtonPress("exittoworldmap", this::exitToWorldMap);
|
||||||
|
ui.onButtonPress("bookmark", this::bookmark);
|
||||||
lifePoints = ui.findActor("lifePoints");
|
lifePoints = ui.findActor("lifePoints");
|
||||||
shards = ui.findActor("shards");
|
shards = ui.findActor("shards");
|
||||||
money = ui.findActor("money");
|
money = ui.findActor("money");
|
||||||
@@ -236,6 +238,7 @@ public class GameHUD extends Stage {
|
|||||||
&& !(Controls.actorContainsVector(logbookActor, touch)) //not inside stats button
|
&& !(Controls.actorContainsVector(logbookActor, touch)) //not inside stats button
|
||||||
&& !(Controls.actorContainsVector(inventoryActor, touch)) //not inside inventory button
|
&& !(Controls.actorContainsVector(inventoryActor, touch)) //not inside inventory button
|
||||||
&& !(Controls.actorContainsVector(exitToWorldMapActor, touch)) //not inside exit button
|
&& !(Controls.actorContainsVector(exitToWorldMapActor, touch)) //not inside exit button
|
||||||
|
&& !(Controls.actorContainsVector(bookmarkActor, touch)) //not inside bookmark button
|
||||||
&& !(Controls.actorContainsVector(abilityButtonMap, touch)) //not inside abilityButtonMap
|
&& !(Controls.actorContainsVector(abilityButtonMap, touch)) //not inside abilityButtonMap
|
||||||
&& (Controls.actorContainsVector(ui, touch)) //inside display bounds
|
&& (Controls.actorContainsVector(ui, touch)) //inside display bounds
|
||||||
&& pointer < 1) { //not more than 1 pointer
|
&& pointer < 1) { //not more than 1 pointer
|
||||||
@@ -356,6 +359,8 @@ public class GameHUD extends Stage {
|
|||||||
openMapActor.setText(val);
|
openMapActor.setText(val);
|
||||||
openMapActor.layout();
|
openMapActor.layout();
|
||||||
}
|
}
|
||||||
|
if (MapStage.getInstance().isInMap())
|
||||||
|
updateBookmarkActor(MapStage.getInstance().getChanges().isBookmarked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearAbility() {
|
void clearAbility() {
|
||||||
@@ -370,7 +375,7 @@ public class GameHUD extends Stage {
|
|||||||
setAbilityButton(AdventurePlayer.current().getEquippedAbility1());
|
setAbilityButton(AdventurePlayer.current().getEquippedAbility1());
|
||||||
setAbilityButton(AdventurePlayer.current().getEquippedAbility2());
|
setAbilityButton(AdventurePlayer.current().getEquippedAbility2());
|
||||||
float x = Forge.isLandscapeMode() ? 426f : 216f;
|
float x = Forge.isLandscapeMode() ? 426f : 216f;
|
||||||
float y = 10f;
|
float y = Forge.isLandscapeMode() ? 10f : 60f;
|
||||||
float w = 45f;
|
float w = 45f;
|
||||||
float h = 35f;
|
float h = 35f;
|
||||||
for (TextraButton button : abilityButtonMap) {
|
for (TextraButton button : abilityButtonMap) {
|
||||||
@@ -499,9 +504,9 @@ public class GameHUD extends Stage {
|
|||||||
private void setAudio(MusicPlaylist playlist) {
|
private void setAudio(MusicPlaylist playlist) {
|
||||||
if (playlist.equals(currentAudioPlaylist))
|
if (playlist.equals(currentAudioPlaylist))
|
||||||
return;
|
return;
|
||||||
System.out.println("Playlist: "+playlist);
|
//System.out.println("Playlist: "+playlist);
|
||||||
unloadAudio();
|
unloadAudio();
|
||||||
System.out.println("Playlist: "+playlist);
|
//System.out.println("Playlist: "+playlist);
|
||||||
audio = getMusic(playlist);
|
audio = getMusic(playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,6 +566,42 @@ public class GameHUD extends Stage {
|
|||||||
showDialog();
|
showDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void bookmark() {
|
||||||
|
if (console.isVisible())
|
||||||
|
return;
|
||||||
|
if (!GameScene.instance().isNotInWorldMap())
|
||||||
|
return;
|
||||||
|
if (!MapStage.getInstance().canEscape())
|
||||||
|
return;
|
||||||
|
if (Forge.restrictAdvMenus)
|
||||||
|
return;
|
||||||
|
if (MapStage.getInstance().isInMap()) {
|
||||||
|
if (MapStage.getInstance().getChanges().isBookmarked()) {
|
||||||
|
MapStage.getInstance().getChanges().setIsBookmarked(false);
|
||||||
|
PointOfInterestMapSprite mapSprite = WorldStage.getInstance().getMapSprite(GameScene.instance().getMapPOI());
|
||||||
|
if (mapSprite != null) {
|
||||||
|
MapStage.getInstance().getChanges().save();
|
||||||
|
mapSprite.setBookmarked(false, mapSprite.getPointOfInterest());
|
||||||
|
updateBookmarkActor(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MapStage.getInstance().getChanges().setIsBookmarked(true);
|
||||||
|
PointOfInterestMapSprite mapSprite = WorldStage.getInstance().getMapSprite(GameScene.instance().getMapPOI());
|
||||||
|
if (mapSprite != null) {
|
||||||
|
MapStage.getInstance().getChanges().save();
|
||||||
|
mapSprite.setBookmarked(true, mapSprite.getPointOfInterest());
|
||||||
|
updateBookmarkActor(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateBookmarkActor(boolean value) {
|
||||||
|
if (bookmarkActor == null)
|
||||||
|
return;
|
||||||
|
bookmarkActor.setText("[%120][+" + (value ? "Bookmark" : "Unmark") + "]");
|
||||||
|
}
|
||||||
|
|
||||||
private void exitDungeonCallback() {
|
private void exitDungeonCallback() {
|
||||||
hideDialog(true);
|
hideDialog(true);
|
||||||
}
|
}
|
||||||
@@ -582,9 +623,9 @@ public class GameHUD extends Stage {
|
|||||||
actor.setVisible(visible);
|
actor.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDisabled(Actor actor, boolean enable, String enabled, String disabled) {
|
private void setDisabled(Actor actor, boolean value, String enabled, String disabled) {
|
||||||
if (actor instanceof TextraButton) {
|
if (actor instanceof TextraButton) {
|
||||||
((TextraButton) actor).setDisabled(enable);
|
((TextraButton) actor).setDisabled(value);
|
||||||
((TextraButton) actor).setText(((TextraButton) actor).isDisabled() ? disabled : enabled);
|
((TextraButton) actor).setText(((TextraButton) actor).isDisabled() ? disabled : enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -609,6 +650,7 @@ public class GameHUD extends Stage {
|
|||||||
setVisibility(money, visible);
|
setVisibility(money, visible);
|
||||||
setVisibility(blank, visible);
|
setVisibility(blank, visible);
|
||||||
setDisabled(exitToWorldMapActor, !GameScene.instance().isNotInWorldMap(), "[%120][+ExitToWorldMap]", "---");
|
setDisabled(exitToWorldMapActor, !GameScene.instance().isNotInWorldMap(), "[%120][+ExitToWorldMap]", "---");
|
||||||
|
setDisabled(bookmarkActor, !GameScene.instance().isNotInWorldMap(), "[%120][+Bookmark]", "---");
|
||||||
setAlpha(avatarborder, visible);
|
setAlpha(avatarborder, visible);
|
||||||
setAlpha(avatar, visible);
|
setAlpha(avatar, visible);
|
||||||
setAlpha(deckActor, visible);
|
setAlpha(deckActor, visible);
|
||||||
@@ -616,6 +658,7 @@ public class GameHUD extends Stage {
|
|||||||
setAlpha(logbookActor, visible);
|
setAlpha(logbookActor, visible);
|
||||||
setAlpha(inventoryActor, visible);
|
setAlpha(inventoryActor, visible);
|
||||||
setAlpha(exitToWorldMapActor, visible);
|
setAlpha(exitToWorldMapActor, visible);
|
||||||
|
setAlpha(bookmarkActor, visible);
|
||||||
for (TextraButton button : abilityButtonMap) {
|
for (TextraButton button : abilityButtonMap) {
|
||||||
setAlpha(button, visible);
|
setAlpha(button, visible);
|
||||||
}
|
}
|
||||||
@@ -723,6 +766,7 @@ public class GameHUD extends Stage {
|
|||||||
if (exitDungeon) {
|
if (exitDungeon) {
|
||||||
MapStage.getInstance().exitDungeon();
|
MapStage.getInstance().exitDungeon();
|
||||||
setDisabled(exitToWorldMapActor, true, "[%120][+ExitToWorldMap]", "---");
|
setDisabled(exitToWorldMapActor, true, "[%120][+ExitToWorldMap]", "---");
|
||||||
|
setDisabled(bookmarkActor, true, "[%120][+Bookmark]", "---");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
|||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.github.tommyettinger.textra.TextraLabel;
|
|
||||||
import forge.adventure.data.BiomeSpriteData;
|
import forge.adventure.data.BiomeSpriteData;
|
||||||
import forge.adventure.pointofintrest.PointOfInterest;
|
import forge.adventure.pointofintrest.PointOfInterest;
|
||||||
import forge.adventure.util.Controls;
|
import forge.adventure.pointofintrest.PointOfInterestChanges;
|
||||||
|
import forge.adventure.scene.MapViewScene;
|
||||||
|
import forge.adventure.util.Config;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
@@ -23,15 +24,19 @@ public class MapSprite extends Actor {
|
|||||||
static public int BackgroundLayer = -1;
|
static public int BackgroundLayer = -1;
|
||||||
static public int SpriteLayer = 0;
|
static public int SpriteLayer = 0;
|
||||||
TextureRegion texture;
|
TextureRegion texture;
|
||||||
TextraLabel searchPost = Controls.newTextraLabel("[%80][+SearchPost]");
|
Sprite bookmark = Config.instance().getItemSprite("Star");
|
||||||
boolean isCaveDungeon, isOldorVisited;
|
Sprite magnifier = Config.instance().getItemSprite("Magnifier");
|
||||||
|
boolean isCaveDungeon, isOldorVisited, isBookmarked;
|
||||||
public MapSprite(Vector2 pos, TextureRegion sprite, PointOfInterest point) {
|
public MapSprite(Vector2 pos, TextureRegion sprite, PointOfInterest point) {
|
||||||
if (point != null) {
|
if (point != null) {
|
||||||
|
PointOfInterestChanges changes = WorldSave.getCurrentSave().getPointOfInterestChanges(point.getID() + point.getData().map);
|
||||||
|
setBookmarked(changes.isBookmarked(), point);
|
||||||
isCaveDungeon = "cave".equalsIgnoreCase(point.getData().type) || "dungeon".equalsIgnoreCase(point.getData().type);
|
isCaveDungeon = "cave".equalsIgnoreCase(point.getData().type) || "dungeon".equalsIgnoreCase(point.getData().type);
|
||||||
if (point.getData().map != null && point.getID() != null) {
|
if (point.getData().map != null && point.getID() != null) {
|
||||||
isOldorVisited = WorldSave.getCurrentSave().getPointOfInterestChanges(point.getID() + point.getData().map).hasDeletedObjects();
|
isOldorVisited = changes.hasDeletedObjects();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setBookmarked(false, null);
|
||||||
}
|
}
|
||||||
texture = sprite;
|
texture = sprite;
|
||||||
setPosition(pos.x, pos.y);
|
setPosition(pos.x, pos.y);
|
||||||
@@ -43,6 +48,15 @@ public class MapSprite extends Actor {
|
|||||||
isOldorVisited = true;
|
isOldorVisited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBookmarked(boolean val, PointOfInterest poi) {
|
||||||
|
isBookmarked = val;
|
||||||
|
if (isBookmarked)
|
||||||
|
MapViewScene.instance().addBookmark(poi);
|
||||||
|
else
|
||||||
|
MapViewScene.instance().removeBookmark(poi);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static Array<Actor> getMapSprites(int chunkX, int chunkY, int layer) {
|
public static Array<Actor> getMapSprites(int chunkX, int chunkY, int layer) {
|
||||||
Array<Actor> actorGroup = new Array<>();
|
Array<Actor> actorGroup = new Array<>();
|
||||||
List<Pair<Vector2, Integer>> objects = WorldSave.getCurrentSave().getWorld().GetMapObjects(chunkX, chunkY);
|
List<Pair<Vector2, Integer>> objects = WorldSave.getCurrentSave().getWorld().GetMapObjects(chunkX, chunkY);
|
||||||
@@ -72,9 +86,15 @@ public class MapSprite extends Actor {
|
|||||||
if (texture == null)
|
if (texture == null)
|
||||||
return;
|
return;
|
||||||
batch.draw(texture, getX(), getY());
|
batch.draw(texture, getX(), getY());
|
||||||
if (isCaveDungeon && !isOldorVisited) {
|
if (isCaveDungeon && !isOldorVisited && magnifier != null) {
|
||||||
searchPost.setPosition(getX() - 7, getY() + 7);
|
magnifier.setScale(0.7f, 0.7f);
|
||||||
searchPost.draw(batch, parentAlpha);
|
magnifier.setPosition(getX() - 7, getY() + 2);
|
||||||
|
magnifier.draw(batch, parentAlpha);
|
||||||
|
}
|
||||||
|
if (isBookmarked && bookmark != null) {
|
||||||
|
bookmark.setScale(0.7f, 0.7f);
|
||||||
|
bookmark.setPosition(getRight() - 8, getY() + getHeight() / 1.5f);
|
||||||
|
bookmark.draw(batch, parentAlpha);
|
||||||
}
|
}
|
||||||
//font.draw(batch,String.valueOf(getZIndex()),getX()-(getWidth()/2),getY());
|
//font.draw(batch,String.valueOf(getZIndex()),getX()-(getWidth()/2),getY());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import forge.Forge;
|
|||||||
import forge.adventure.character.CharacterSprite;
|
import forge.adventure.character.CharacterSprite;
|
||||||
import forge.adventure.character.EnemySprite;
|
import forge.adventure.character.EnemySprite;
|
||||||
import forge.adventure.data.*;
|
import forge.adventure.data.*;
|
||||||
|
import forge.adventure.pointofintrest.PointOfInterest;
|
||||||
import forge.adventure.scene.DuelScene;
|
import forge.adventure.scene.DuelScene;
|
||||||
import forge.adventure.scene.RewardScene;
|
import forge.adventure.scene.RewardScene;
|
||||||
import forge.adventure.scene.Scene;
|
import forge.adventure.scene.Scene;
|
||||||
@@ -338,6 +339,19 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
|||||||
directlyEnterPOI = true; //On a new game, we want to automatically enter any POI the player overlaps with.
|
directlyEnterPOI = true; //On a new game, we want to automatically enter any POI the player overlaps with.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PointOfInterestMapSprite getMapSprite(PointOfInterest poi) {
|
||||||
|
if (poi == null)
|
||||||
|
return null;
|
||||||
|
for (Actor actor : foregroundSprites.getChildren()) {
|
||||||
|
if (actor.getClass() == PointOfInterestMapSprite.class) {
|
||||||
|
PointOfInterestMapSprite point = (PointOfInterestMapSprite) actor;
|
||||||
|
if (poi == point.getPointOfInterest() && poi.getPosition() == point.getPointOfInterest().getPosition())
|
||||||
|
return point;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
getPlayerSprite().LoadPos();
|
getPlayerSprite().LoadPos();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package forge.adventure.util;
|
package forge.adventure.util;
|
||||||
|
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.Json;
|
import com.badlogic.gdx.utils.Json;
|
||||||
@@ -50,6 +51,7 @@ public class Config {
|
|||||||
private SettingData settingsData;
|
private SettingData settingsData;
|
||||||
private String Lang = "en-us";
|
private String Lang = "en-us";
|
||||||
private final String plane;
|
private final String plane;
|
||||||
|
private ObjectMap<String, Sprite> itemSprites = new ObjectMap<>();
|
||||||
|
|
||||||
static public Config instance() {
|
static public Config instance() {
|
||||||
if (currentConfig == null)
|
if (currentConfig == null)
|
||||||
@@ -245,6 +247,15 @@ public class Config {
|
|||||||
return atlas;
|
return atlas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Sprite getItemSprite(String itemName) {
|
||||||
|
Sprite sprite = itemSprites.get(itemName);
|
||||||
|
if (sprite == null) {
|
||||||
|
sprite = getAtlas(forge.adventure.util.Paths.ITEMS_ATLAS).createSprite(itemName);
|
||||||
|
if (sprite != null)
|
||||||
|
itemSprites.put(itemName, sprite);
|
||||||
|
}
|
||||||
|
return sprite;
|
||||||
|
}
|
||||||
public SettingData getSettingData() {
|
public SettingData getSettingData() {
|
||||||
return settingsData;
|
return settingsData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ package forge.adventure.util;
|
|||||||
|
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.*;
|
||||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
|
||||||
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
|
|
||||||
import com.badlogic.gdx.math.Interpolation;
|
import com.badlogic.gdx.math.Interpolation;
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
@@ -431,7 +429,6 @@ public class Controls {
|
|||||||
return Forge.getAssets().getTextraFont(name, getSkin().getFont(name), Config.instance().getAtlas(Paths.ITEMS_ATLAS));
|
return Forge.getAssets().getTextraFont(name, getSkin().getFont(name), Config.instance().getAtlas(Paths.ITEMS_ATLAS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static public class AccountingLabel extends TextraLabel {
|
static public class AccountingLabel extends TextraLabel {
|
||||||
private TextraLabel label;
|
private TextraLabel label;
|
||||||
private final TextraLabel placeholder;
|
private final TextraLabel placeholder;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public enum KeyBinding {
|
|||||||
Map("Map", Input.Keys.M,Input.Keys.BUTTON_SELECT),
|
Map("Map", Input.Keys.M,Input.Keys.BUTTON_SELECT),
|
||||||
Equip("Equip", Input.Keys.E,Input.Keys.BUTTON_X),
|
Equip("Equip", Input.Keys.E,Input.Keys.BUTTON_X),
|
||||||
ExitToWorldMap("ExitToWorldMap", Input.Keys.F4,Input.Keys.BUTTON_L2),
|
ExitToWorldMap("ExitToWorldMap", Input.Keys.F4,Input.Keys.BUTTON_L2),
|
||||||
|
Bookmark("Bookmark", Input.Keys.B, Input.Keys.BUTTON_R2),
|
||||||
Use("Use", Input.Keys.ENTER,Input.Keys.BUTTON_A),
|
Use("Use", Input.Keys.ENTER,Input.Keys.BUTTON_A),
|
||||||
Back("Back", Input.Keys.ESCAPE,Input.Keys.BUTTON_B),
|
Back("Back", Input.Keys.ESCAPE,Input.Keys.BUTTON_B),
|
||||||
ScrollUp("ScrollUp", Input.Keys.PAGE_UP,Input.Keys.BUTTON_L1),
|
ScrollUp("ScrollUp", Input.Keys.PAGE_UP,Input.Keys.BUTTON_L1),
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import static forge.adventure.util.Paths.ITEMS_ATLAS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the rewards as a card on the reward scene.
|
* Render the rewards as a card on the reward scene.
|
||||||
*/
|
*/
|
||||||
@@ -296,8 +294,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Item: {
|
case Item: {
|
||||||
TextureAtlas atlas = Config.instance().getAtlas(ITEMS_ATLAS);
|
Sprite backSprite = Config.instance().getItemSprite("CardBack");
|
||||||
Sprite backSprite = atlas.createSprite("CardBack");
|
|
||||||
if (reward.getItem() == null) {
|
if (reward.getItem() == null) {
|
||||||
needsToBeDisposed = true;
|
needsToBeDisposed = true;
|
||||||
processSprite(backSprite, null, null, 0, 0, false);
|
processSprite(backSprite, null, null, 0, 0, false);
|
||||||
@@ -311,8 +308,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CardPack: {
|
case CardPack: {
|
||||||
TextureAtlas atlas = Config.instance().getAtlas(ITEMS_ATLAS);
|
Sprite backSprite = Config.instance().getItemSprite("CardBack");
|
||||||
Sprite backSprite = atlas.createSprite("CardBack");
|
|
||||||
if (reward.getDeck() == null) {
|
if (reward.getDeck() == null) {
|
||||||
needsToBeDisposed = true;
|
needsToBeDisposed = true;
|
||||||
processSprite(backSprite, null, null, 0, 0, false);
|
processSprite(backSprite, null, null, 0, 0, false);
|
||||||
@@ -342,7 +338,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
item = new Sprite(new TextureRegion(t));
|
item = new Sprite(new TextureRegion(t));
|
||||||
isBooster = true;
|
isBooster = true;
|
||||||
} else {
|
} else {
|
||||||
item = atlas.createSprite("Deck");
|
item = Config.instance().getItemSprite("Deck");
|
||||||
}
|
}
|
||||||
|
|
||||||
setItemTooltips(item, backSprite, isBooster);
|
setItemTooltips(item, backSprite, isBooster);
|
||||||
@@ -356,9 +352,8 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
case Life:
|
case Life:
|
||||||
case Shards:
|
case Shards:
|
||||||
case Gold: {
|
case Gold: {
|
||||||
TextureAtlas atlas = Config.instance().getAtlas(ITEMS_ATLAS);
|
Sprite backSprite = Config.instance().getItemSprite("CardBack");
|
||||||
Sprite backSprite = atlas.createSprite("CardBack");
|
Sprite item = Config.instance().getItemSprite(reward.type.toString());
|
||||||
Sprite item = atlas.createSprite(reward.type.toString());
|
|
||||||
setItemTooltips(item, backSprite, false);
|
setItemTooltips(item, backSprite, false);
|
||||||
boolean isShop = RewardScene.Type.Shop.equals(type);
|
boolean isShop = RewardScene.Type.Shop.equals(type);
|
||||||
processSprite(backSprite, item, isShop ? null :
|
processSprite(backSprite, item, isShop ? null :
|
||||||
|
|||||||
@@ -444,6 +444,18 @@ GreenLeaf
|
|||||||
GreenLeaf2
|
GreenLeaf2
|
||||||
xy: 112, 608
|
xy: 112, 608
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
|
GoldCoin
|
||||||
|
xy: 464, 63
|
||||||
|
size: 16, 16
|
||||||
|
Magnifier
|
||||||
|
xy: 448, 63
|
||||||
|
size: 16, 16
|
||||||
|
Bookmark
|
||||||
|
xy: 432, 63
|
||||||
|
size: 16, 16
|
||||||
|
Unmark
|
||||||
|
xy: 416, 63
|
||||||
|
size: 16, 16
|
||||||
SearchPost
|
SearchPost
|
||||||
xy: 384, 63
|
xy: 384, 63
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
@@ -456,6 +468,12 @@ LogBook
|
|||||||
GPS
|
GPS
|
||||||
xy: 464, 0
|
xy: 464, 0
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
|
Star
|
||||||
|
xy: 464, 16
|
||||||
|
size: 16, 16
|
||||||
|
TreasureChest
|
||||||
|
xy: 464, 32
|
||||||
|
size: 16, 16
|
||||||
UnderworldCookbook
|
UnderworldCookbook
|
||||||
xy: 304, 960
|
xy: 304, 960
|
||||||
size: 16, 16
|
size: 16, 16
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 275 KiB |
@@ -89,7 +89,7 @@
|
|||||||
"binding": "Deck",
|
"binding": "Deck",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 175,
|
"x": 198,
|
||||||
"y": 0
|
"y": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
"binding": "Inventory",
|
"binding": "Inventory",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 220,
|
"x": 243,
|
||||||
"y": 0
|
"y": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
"binding": "Status",
|
"binding": "Status",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 265,
|
"x": 288,
|
||||||
"y": 0
|
"y": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
"binding": "Menu",
|
"binding": "Menu",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 130,
|
"x": 108,
|
||||||
"y": 0
|
"y": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -139,7 +139,17 @@
|
|||||||
"binding": "ExitToWorldMap",
|
"binding": "ExitToWorldMap",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 310,
|
"x": 333,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "bookmark",
|
||||||
|
"text": "[%120][+Bookmark]",
|
||||||
|
"binding": "Bookmark",
|
||||||
|
"width": 45,
|
||||||
|
"height": 25,
|
||||||
|
"x": 153,
|
||||||
"y": 0
|
"y": 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
"binding": "Deck",
|
"binding": "Deck",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 175,
|
"x": 198,
|
||||||
"y": 240
|
"y": 240
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
"binding": "Inventory",
|
"binding": "Inventory",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 220,
|
"x": 243,
|
||||||
"y": 240
|
"y": 240
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
"binding": "Status",
|
"binding": "Status",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 265,
|
"x": 288,
|
||||||
"y": 240
|
"y": 240
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
"binding": "Menu",
|
"binding": "Menu",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 130,
|
"x": 108,
|
||||||
"y": 240
|
"y": 240
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -139,7 +139,17 @@
|
|||||||
"binding": "ExitToWorldMap",
|
"binding": "ExitToWorldMap",
|
||||||
"width": 45,
|
"width": 45,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 310,
|
"x": 333,
|
||||||
|
"y": 240
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "bookmark",
|
||||||
|
"text": "[%120][+Bookmark]",
|
||||||
|
"binding": "Bookmark",
|
||||||
|
"width": 45,
|
||||||
|
"height": 25,
|
||||||
|
"x": 153,
|
||||||
"y": 240
|
"y": 240
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
"text": "[%120][+Deck]",
|
"text": "[%120][+Deck]",
|
||||||
"width": 25,
|
"width": 25,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 105,
|
"x": 118,
|
||||||
"y": 450
|
"y": 450
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
"text": "[%120][+Item]",
|
"text": "[%120][+Item]",
|
||||||
"width": 25,
|
"width": 25,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 130,
|
"x": 143,
|
||||||
"y": 450
|
"y": 450
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
"text": "[%120][+Logbook]",
|
"text": "[%120][+Logbook]",
|
||||||
"width": 25,
|
"width": 25,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 155,
|
"x": 168,
|
||||||
"y": 450
|
"y": 450
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
"text": "[%120][+Menu]",
|
"text": "[%120][+Menu]",
|
||||||
"width": 25,
|
"width": 25,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 80,
|
"x": 68,
|
||||||
"y": 450
|
"y": 450
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -133,7 +133,16 @@
|
|||||||
"text": "[%120][+ExitToWorldMap]",
|
"text": "[%120][+ExitToWorldMap]",
|
||||||
"width": 25,
|
"width": 25,
|
||||||
"height": 25,
|
"height": 25,
|
||||||
"x": 180,
|
"x": 193,
|
||||||
|
"y": 450
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextButton",
|
||||||
|
"name": "bookmark",
|
||||||
|
"text": "[%120][+Bookmark]",
|
||||||
|
"width": 25,
|
||||||
|
"height": 25,
|
||||||
|
"x": 93,
|
||||||
"y": 450
|
"y": 450
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user