mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge remote-tracking branch 'origin/master' into BetterImageFetcherError
This commit is contained in:
@@ -40,8 +40,12 @@ public class PlayerSprite extends CharacterSprite {
|
||||
}
|
||||
|
||||
public void storePos() {
|
||||
AdventurePlayer.current().setWorldPosX(getX());
|
||||
AdventurePlayer.current().setWorldPosY(getY());
|
||||
storePos(getX(), getY());
|
||||
}
|
||||
|
||||
public void storePos(final float x, final float y) {
|
||||
AdventurePlayer.current().setWorldPosX(x);
|
||||
AdventurePlayer.current().setWorldPosY(y);
|
||||
}
|
||||
|
||||
public Vector2 getMovementDirection() {
|
||||
|
||||
@@ -118,6 +118,10 @@ public class RewardData implements Serializable {
|
||||
return false;
|
||||
return !Arrays.asList(configData.restrictedCards).contains(input.getName());
|
||||
});
|
||||
|
||||
// Only allow obtainable cards
|
||||
allCards = IterableUtil.filter(allCards, input -> StaticData.instance().getCardEdition(input.getEdition()).isCardObtainable(input.getCardName()));
|
||||
|
||||
//Filter AI cards for enemies.
|
||||
allEnemyCards= IterableUtil.filter(allCards, input -> {
|
||||
if (input == null) return false;
|
||||
@@ -241,7 +245,7 @@ public class RewardData implements Serializable {
|
||||
for(String restrictedCard: configData.restrictedCards)
|
||||
{
|
||||
allEditions.removeIf(
|
||||
cardEdition -> cardEdition.getAllCardsInSet().stream().anyMatch(
|
||||
cardEdition -> cardEdition.getObtainableCards().stream().anyMatch(
|
||||
o -> o.name().equals(restrictedCard))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1160,20 +1160,20 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
||||
questFlags.clear();
|
||||
}
|
||||
|
||||
public void addQuest(String questID) {
|
||||
public void addQuest(String questID, boolean isNewGame) {
|
||||
int id = Integer.parseInt(questID);
|
||||
addQuest(id);
|
||||
addQuest(id, isNewGame);
|
||||
}
|
||||
|
||||
public void addQuest(int questID) {
|
||||
public void addQuest(int questID, boolean isNewGame) {
|
||||
AdventureQuestData toAdd = AdventureQuestController.instance().generateQuest(questID);
|
||||
|
||||
if (toAdd != null) {
|
||||
addQuest(toAdd);
|
||||
addQuest(toAdd, isNewGame);
|
||||
}
|
||||
}
|
||||
|
||||
public void addQuest(AdventureQuestData q) {
|
||||
public void addQuest(AdventureQuestData q, boolean isNewGame) {
|
||||
//TODO: add a config flag for this
|
||||
boolean noTrackedQuests = true;
|
||||
for (AdventureQuestData existing : quests) {
|
||||
@@ -1186,7 +1186,8 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
||||
if (noTrackedQuests || q.autoTrack)
|
||||
AdventureQuestController.trackQuest(q);
|
||||
q.activateNextStages();
|
||||
AdventureQuestController.instance().showQuestDialogs(MapStage.getInstance());
|
||||
if (!isNewGame)
|
||||
AdventureQuestController.instance().showQuestDialogs(MapStage.getInstance());
|
||||
}
|
||||
|
||||
public List<AdventureQuestData> getQuests() {
|
||||
|
||||
@@ -268,7 +268,7 @@ public class NewGameScene extends MenuScene {
|
||||
SoundSystem.instance.changeBackgroundTrack();
|
||||
WorldStage.getInstance().enterSpawnPOI();
|
||||
if (AdventurePlayer.current().getQuests().stream().noneMatch(q -> q.getID() == 28)) {
|
||||
AdventurePlayer.current().addQuest("28"); //Temporary link to Shandalar main questline
|
||||
AdventurePlayer.current().addQuest("28", true); //Temporary link to Shandalar main questline
|
||||
}
|
||||
Forge.switchScene(GameScene.instance());
|
||||
};
|
||||
|
||||
@@ -27,7 +27,6 @@ public class QuestLogScene extends UIScene {
|
||||
private QuestLogScene() {
|
||||
super(Forge.isLandscapeMode() ? "ui/quests.json" : "ui/quests_portrait.json");
|
||||
|
||||
|
||||
scrollWindow = ui.findActor("scrollWindow");
|
||||
root = ui.findActor("questList");
|
||||
detailRoot = ui.findActor("questDetails");
|
||||
@@ -36,11 +35,13 @@ public class QuestLogScene extends UIScene {
|
||||
backToListButton = Controls.newTextButton("Quest List");
|
||||
ui.onButtonPress("return", QuestLogScene.this::back);
|
||||
ui.onButtonPress("status", QuestLogScene.this::status);
|
||||
ui.onButtonPress("backToList", QuestLogScene.this::backToList);
|
||||
|
||||
|
||||
//Todo - refactor below, replace buttons in landscape
|
||||
backToListButton.addListener(new ClickListener() {
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
buildList();
|
||||
}
|
||||
});
|
||||
|
||||
// TODO - refactor below, replace buttons in landscape
|
||||
scrollContainer = new Table(Controls.getSkin());
|
||||
scrollContainer.row();
|
||||
|
||||
@@ -76,9 +77,6 @@ public class QuestLogScene extends UIScene {
|
||||
root.row();
|
||||
ScrollPane scroller = new ScrollPane(scrollContainer);
|
||||
root.add(scroller).colspan(3).fill().expand();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static QuestLogScene object;
|
||||
@@ -92,16 +90,12 @@ public class QuestLogScene extends UIScene {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
|
||||
}
|
||||
public void dispose() { }
|
||||
|
||||
@Override
|
||||
public void enter() {
|
||||
super.enter();
|
||||
buildList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void buildList(){
|
||||
@@ -116,7 +110,7 @@ public class QuestLogScene extends UIScene {
|
||||
nameLabel.setColor(Color.BLACK);
|
||||
scrollContainer.add(nameLabel).align(Align.left).expandX();
|
||||
Button details = Controls.newTextButton(Forge.getLocalizer().getMessage("lblDetails"));
|
||||
details.addListener( new ClickListener(){
|
||||
details.addListener(new ClickListener() {
|
||||
public void clicked(InputEvent event, float x, float y){
|
||||
loadDetailsPane(quest);
|
||||
}
|
||||
@@ -128,7 +122,7 @@ public class QuestLogScene extends UIScene {
|
||||
performTouch(scrollPaneOfActor(scrollContainer)); //can use mouse wheel if available to scroll
|
||||
}
|
||||
|
||||
private void backToList(){
|
||||
private void backToList() {
|
||||
abandonQuestButton.setVisible(false);
|
||||
trackButton.setVisible(false);
|
||||
backToListButton.setVisible(false);
|
||||
@@ -137,8 +131,8 @@ public class QuestLogScene extends UIScene {
|
||||
detailRoot.setVisible(false);
|
||||
}
|
||||
|
||||
private void loadDetailsPane(AdventureQuestData quest){
|
||||
if (quest == null){
|
||||
private void loadDetailsPane(AdventureQuestData quest) {
|
||||
if (quest == null) {
|
||||
return;
|
||||
}
|
||||
root.setVisible(false);
|
||||
@@ -146,16 +140,15 @@ public class QuestLogScene extends UIScene {
|
||||
detailScrollContainer.clear();
|
||||
detailScrollContainer.row();
|
||||
trackButton.setText(quest.isTracked?Forge.getLocalizer().getMessage("lblUntrackQuest"):Forge.getLocalizer().getMessage("lblTrackQuest"));
|
||||
trackButton.addListener( new ClickListener(){
|
||||
public void clicked(InputEvent event, float x, float y){
|
||||
trackButton.addListener(new ClickListener() {
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
toggleTracked(quest);
|
||||
}
|
||||
});
|
||||
|
||||
abandonQuestButton.setColor(Color.RED);
|
||||
abandonQuestButton.addListener( new ClickListener(){
|
||||
public void clicked(InputEvent event, float x, float y){
|
||||
|
||||
abandonQuestButton.addListener(new ClickListener() {
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
Dialog confirm = createGenericDialog("", Forge.getLocalizer().getMessage("lblAbandonQuestConfirm"),Forge.getLocalizer().getMessage("lblYes"),Forge.getLocalizer().getMessage("lblNo"), () -> abandonQuest(quest), null);
|
||||
showDialog(confirm);
|
||||
}
|
||||
@@ -208,7 +201,7 @@ public class QuestLogScene extends UIScene {
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleTracked(AdventureQuestData quest){
|
||||
private void toggleTracked(AdventureQuestData quest) {
|
||||
if (quest.isTracked){
|
||||
quest.isTracked = false;
|
||||
trackButton.setText(Forge.getLocalizer().getMessage("lblTrackQuest"));
|
||||
@@ -225,7 +218,7 @@ public class QuestLogScene extends UIScene {
|
||||
@Override
|
||||
public boolean back(){
|
||||
//Needed so long as quest log and stats are separate scenes that link to each other
|
||||
Forge.switchScene(lastGameScene==null?GameScene.instance():lastGameScene);
|
||||
Forge.switchScene(lastGameScene==null ? GameScene.instance() : lastGameScene);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -234,5 +227,4 @@ public class QuestLogScene extends UIScene {
|
||||
AdventureQuestController.instance().showQuestDialogs(MapStage.getInstance());
|
||||
buildList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ public class SaveLoadScene extends UIScene {
|
||||
Current.player().resetQuestFlags();
|
||||
Current.player().setCharacterFlag("newGamePlus", 1);
|
||||
Current.player().removeAllQuestItems();
|
||||
AdventurePlayer.current().addQuest("28");
|
||||
AdventurePlayer.current().addQuest("28", true);
|
||||
WorldSave.getCurrentSave().clearBookmarks();
|
||||
WorldStage.getInstance().enterSpawnPOI();
|
||||
SoundSystem.instance.changeBackgroundTrack();
|
||||
|
||||
@@ -260,9 +260,19 @@ public class SettingsScene extends UIScene {
|
||||
if (!GuiBase.isAndroid()) {
|
||||
addCheckBox(Forge.getLocalizer().getMessage("lblBattlefieldTextureFiltering"), ForgePreferences.FPref.UI_LIBGDX_TEXTURE_FILTERING);
|
||||
addCheckBox(Forge.getLocalizer().getMessage("lblAltZoneTabs"), ForgePreferences.FPref.UI_ALT_PLAYERZONETABS);
|
||||
} else {
|
||||
addCheckBox(Forge.getLocalizer().getMessage("lblLandscapeMode") + " (" +
|
||||
Forge.getLocalizer().getMessage("lblRestartRequired") + ")",
|
||||
ForgePreferences.FPref.UI_LANDSCAPE_MODE, () -> {
|
||||
boolean landscapeMode = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_LANDSCAPE_MODE);
|
||||
//ensure device able to save off ini file so landscape change takes effect
|
||||
Forge.getDeviceAdapter().setLandscapeMode(landscapeMode);
|
||||
if (Forge.isLandscapeMode() != landscapeMode) {
|
||||
restartForge();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
addCheckBox(Forge.getLocalizer().getMessage("lblLandscapeMode"), ForgePreferences.FPref.UI_LANDSCAPE_MODE);
|
||||
addCheckBox(Forge.getLocalizer().getMessage("lblAnimatedCardTapUntap"), ForgePreferences.FPref.UI_ANIMATED_CARD_TAPUNTAP);
|
||||
if (!GuiBase.isAndroid()) {
|
||||
final String[] item = {FModel.getPreferences().getPref(ForgePreferences.FPref.UI_ENABLE_BORDER_MASKING)};
|
||||
@@ -320,6 +330,10 @@ public class SettingsScene extends UIScene {
|
||||
}
|
||||
|
||||
private void addCheckBox(String name, ForgePreferences.FPref pref) {
|
||||
addCheckBox(name, pref, null);
|
||||
}
|
||||
|
||||
private void addCheckBox(String name, ForgePreferences.FPref pref, Runnable runnable) {
|
||||
CheckBox box = Controls.newCheckBox("");
|
||||
box.setChecked(FModel.getPreferences().getPrefBoolean(pref));
|
||||
box.addListener(new ChangeListener() {
|
||||
@@ -327,6 +341,8 @@ public class SettingsScene extends UIScene {
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
FModel.getPreferences().setPref(pref, ((CheckBox) actor).isChecked());
|
||||
FModel.getPreferences().save();
|
||||
if (runnable != null)
|
||||
runnable.run();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -98,10 +98,29 @@ public class TileMapScene extends HudScene {
|
||||
if (Current.player().fullHeal())
|
||||
autoheal = true; // to play sound/effect on act
|
||||
}
|
||||
if (WorldSave.getCurrentSave().getPlayer().hasAnnounceFantasy()) {
|
||||
WorldSave.getCurrentSave().getPlayer().clearAnnounceFantasy();
|
||||
MapStage.getInstance().showDeckAwardDialog("{BLINK=WHITE;RED}" +
|
||||
Forge.getLocalizer().getMessage("lblMode") + " " +
|
||||
Forge.getLocalizer().getMessage("lblChaos") + "{ENDBLINK}\n" +
|
||||
Forge.getLocalizer().getMessage("lblChaosModeDescription"),
|
||||
WorldSave.getCurrentSave().getPlayer().getSelectedDeck(), this::initializeDialogs);
|
||||
} else if (WorldSave.getCurrentSave().getPlayer().hasAnnounceCustom()) {
|
||||
WorldSave.getCurrentSave().getPlayer().clearAnnounceCustom();
|
||||
MapStage.getInstance().showDeckAwardDialog("{GRADIENT}" +
|
||||
Forge.getLocalizer().getMessage("lblMode") + " " +
|
||||
Forge.getLocalizer().getMessage("lblCustom") + "{ENDGRADIENT}\n" +
|
||||
Forge.getLocalizer().getMessage("lblCustomModeDescription"),
|
||||
WorldSave.getCurrentSave().getPlayer().getSelectedDeck(), this::initializeDialogs);
|
||||
} else {
|
||||
initializeDialogs();
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeDialogs() {
|
||||
AdventureQuestController.instance().updateEnteredPOI(rootPoint);
|
||||
AdventureQuestController.instance().showQuestDialogs(stage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean leave() {
|
||||
// clear player collision on WorldStage and the GameHUD will restore it after the flicker animation.
|
||||
|
||||
@@ -65,8 +65,8 @@ public class UIScene extends Scene {
|
||||
//actor.fire(UIScene.eventExit());
|
||||
}
|
||||
|
||||
public void onPressDown(UIScene scene) {
|
||||
if (actor instanceof TextField) {
|
||||
public void onPressDown(UIScene scene, int keycode) {
|
||||
if (actor instanceof TextField && Input.Keys.ENTER != keycode) {
|
||||
scene.requestTextInput(((TextField) actor).getText(), text -> ((TextField) actor).setText(text));
|
||||
|
||||
}
|
||||
@@ -347,7 +347,7 @@ public class UIScene extends Scene {
|
||||
Selectable selection = getSelected();
|
||||
if (KeyBinding.Use.isPressed(keycode)) {
|
||||
if (selection != null) {
|
||||
selection.onPressDown(this);
|
||||
selection.onPressDown(this, keycode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,13 @@ import forge.adventure.data.EnemyData;
|
||||
import forge.adventure.data.PointOfInterestData;
|
||||
import forge.adventure.data.WorldData;
|
||||
import forge.adventure.pointofintrest.PointOfInterest;
|
||||
import forge.adventure.util.AdventureEventController;
|
||||
import forge.adventure.util.Current;
|
||||
import forge.adventure.util.Paths;
|
||||
import forge.adventure.world.WorldSave;
|
||||
import forge.card.CardEdition;
|
||||
import forge.card.ColorSet;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckProxy;
|
||||
import forge.game.GameType;
|
||||
@@ -176,7 +178,7 @@ public class ConsoleCommandInterpreter {
|
||||
catch (Exception e){
|
||||
return "Can not convert " +s[0]+" to number";
|
||||
}
|
||||
Current.player().addQuest(ID);
|
||||
Current.player().addQuest(ID, false);
|
||||
return "Quest generated";
|
||||
});
|
||||
registerCommand(new String[]{"give", "shards"}, s -> {
|
||||
@@ -260,7 +262,53 @@ public class ConsoleCommandInterpreter {
|
||||
catch(NumberFormatException ignored) {}
|
||||
}
|
||||
Current.player().addCard(card);
|
||||
return "Added card: "+ card.getName();
|
||||
return "Added card: " + card.getName();
|
||||
});
|
||||
registerCommand(new String[]{"give", "set"}, s -> {
|
||||
if (s.length < 1) return "Command needs 1 parameter: Edition code.";
|
||||
CardEdition edition = StaticData.instance().getCardEdition(s[0]);
|
||||
if (edition == null) return "Cannot find edition: " + s[0];
|
||||
|
||||
for(CardEdition.EditionEntry entry : edition.getObtainableCards()) {
|
||||
PaperCard card = StaticData.instance().fetchCard(entry.name(), edition.getCode(), entry.collectorNumber());
|
||||
|
||||
if (card != null) {
|
||||
Current.player().addCard(card.getNoSellVersion(), 4);
|
||||
} else {
|
||||
System.out.println("Card " + entry.name() + " (" + entry.collectorNumber() + ") does not exist.");
|
||||
}
|
||||
}
|
||||
|
||||
return "Added all cards from: " + edition.getCode();
|
||||
});
|
||||
registerCommand(new String[]{"give", "boosters"}, s -> {
|
||||
if (s.length < 1)
|
||||
return "Command needs at least 1 parameter: Edition code.";
|
||||
CardEdition edition = StaticData.instance().getCardEdition(s[0]);
|
||||
if (edition == null)
|
||||
return "Cannot find edition: " + s[0];
|
||||
if (!edition.hasBoosterTemplate())
|
||||
return edition.getCode() + " doesn't have a booster template.";
|
||||
|
||||
int amount = 1;
|
||||
if (s.length >= 2) {
|
||||
try {
|
||||
amount = Integer.parseInt(s[1]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
}
|
||||
|
||||
for(int i=0; i<amount; i++) {
|
||||
Current.player().addBooster(AdventureEventController.instance().generateBooster(edition.getCode()));
|
||||
}
|
||||
|
||||
return "Added " + amount + " " + edition.getCode() + " booster(s)";
|
||||
});
|
||||
registerCommand(new String[]{"clearnosell"}, s -> {
|
||||
CardPool cards = Current.player().getCards();
|
||||
for(PaperCard c : cards.getFilteredPool(c -> c.getMarkedFlags().noSellValue).toFlatList()) {
|
||||
cards.remove(c);
|
||||
}
|
||||
return "Removed all no sell flagged cards.";
|
||||
});
|
||||
registerCommand(new String[]{"give", "item"}, s -> {
|
||||
if (s.length < 1) return "Command needs 1 parameter: Item name.";
|
||||
@@ -386,12 +434,16 @@ public class ConsoleCommandInterpreter {
|
||||
return "Debug OFF";
|
||||
});
|
||||
registerCommand(new String[]{"remove", "enemy", "all"}, s -> {
|
||||
//TODO: Remove all overworld enemies if not inside a map.
|
||||
if (!MapStage.getInstance().isInMap()) {
|
||||
return "Only supported for PoI";
|
||||
WorldStage ws = WorldStage.getInstance();
|
||||
int enemiesCount = ws.enemies.size();
|
||||
for(int i = 0; i < enemiesCount; i++) {
|
||||
ws.removeNearestEnemy();
|
||||
}
|
||||
} else {
|
||||
MapStage.getInstance().removeAllEnemies();
|
||||
}
|
||||
MapStage.getInstance().removeAllEnemies();
|
||||
return "removed all enemies";
|
||||
return "Removed all enemies";
|
||||
});
|
||||
|
||||
registerCommand(new String[]{"hide"}, s -> {
|
||||
|
||||
@@ -482,8 +482,7 @@ public class GameHUD extends Stage {
|
||||
Current.player().addShards(-data.shardsNeeded);
|
||||
ConsoleCommandInterpreter.getInstance().command(data.commandOnUse);
|
||||
AdventureQuestController.instance().updateItemUsed(data);
|
||||
});
|
||||
button.setStyle(Controls.getTextButtonStyle("menu"));
|
||||
}, "menu");
|
||||
abilityButtonMap.add(button);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ public abstract class GameStage extends Stage {
|
||||
dialog.clearListeners();
|
||||
TextraButton ok = Controls.newTextButton("OK", this::hideDialog);
|
||||
ok.setVisible(false);
|
||||
TypingLabel L = Controls.newTypingLabel("{GRADIENT=CYAN;WHITE;1;1}Strange magical energies flow within this place...{ENDGRADIENT}\nAll opponents get:\n" + effectData.getDescription());
|
||||
TypingLabel L = Controls.newTypingLabel("{GRADIENT=CYAN;WHITE;1;1}" +
|
||||
Forge.getLocalizer().getMessage("lblEffectDialogDescription") + "{ENDGRADIENT}\n" +
|
||||
Forge.getLocalizer().getMessage("lblEffectDataHeader") + "\n" + effectData.getDescription());
|
||||
L.setWrap(true);
|
||||
L.setTypingListener(new TypingAdapter() {
|
||||
@Override
|
||||
@@ -191,7 +193,7 @@ public abstract class GameStage extends Stage {
|
||||
showDialog();
|
||||
}
|
||||
|
||||
public void showDeckAwardDialog(String message, Deck deck) {
|
||||
public void showDeckAwardDialog(String message, Deck deck, Runnable runnable) {
|
||||
dialog.getContentTable().clear();
|
||||
dialog.getButtonTable().clear();
|
||||
dialog.clearListeners();
|
||||
@@ -236,7 +238,11 @@ public abstract class GameStage extends Stage {
|
||||
L.skipToTheEnd();
|
||||
|
||||
dialog.getContentTable().add(L).width(250);
|
||||
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog)).width(240);
|
||||
dialog.getButtonTable().add(Controls.newTextButton("OK", () -> {
|
||||
hideDialog();
|
||||
if (runnable != null)
|
||||
runnable.run();
|
||||
})).width(240);
|
||||
dialog.setKeepWithinStage(true);
|
||||
setDialogStage(GameHUD.getInstance());
|
||||
showDialog();
|
||||
|
||||
@@ -820,7 +820,7 @@ public class MapStage extends GameStage {
|
||||
dialog.clearListeners();
|
||||
TextraButton ok = Controls.newTextButton("OK", this::hideDialog);
|
||||
ok.setVisible(false);
|
||||
TypingLabel L = Controls.newTypingLabel("{GRADIENT=RED;WHITE;1;1}Defeated and unable to continue, you use the last of your power to escape the area.");
|
||||
TypingLabel L = Controls.newTypingLabel("{GRADIENT=RED;WHITE;1;1}" + Forge.getLocalizer().getMessage("lblDefeatedDescription"));
|
||||
L.setWrap(true);
|
||||
L.setTypingListener(new TypingAdapter() {
|
||||
@Override
|
||||
|
||||
@@ -364,16 +364,6 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
background.setPlayerPos(player.getX(), player.getY());
|
||||
//spriteGroup.setCullingArea(new Rectangle(player.getX()-getViewport().getWorldHeight()/2,player.getY()-getViewport().getWorldHeight()/2,getViewport().getWorldHeight(),getViewport().getWorldHeight()));
|
||||
super.draw();
|
||||
if (WorldSave.getCurrentSave().getPlayer().hasAnnounceFantasy()) {
|
||||
MapStage.getInstance().showDeckAwardDialog("{BLINK=WHITE;RED}Chaos Mode!{ENDBLINK}\n" +
|
||||
"Enemy will use Preconstructed or Random Generated Decks. Genetic AI Decks will be available to some enemies on Hard difficulty.",
|
||||
WorldSave.getCurrentSave().getPlayer().getSelectedDeck());
|
||||
WorldSave.getCurrentSave().getPlayer().clearAnnounceFantasy();
|
||||
} else if (WorldSave.getCurrentSave().getPlayer().hasAnnounceCustom()) {
|
||||
MapStage.getInstance().showDeckAwardDialog("{GRADIENT}Custom Deck Mode!{ENDGRADIENT}\n" +
|
||||
"Some enemies will use Genetic AI Decks randomly.", WorldSave.getCurrentSave().getPlayer().getSelectedDeck());
|
||||
WorldSave.getCurrentSave().getPlayer().clearAnnounceCustom();
|
||||
}
|
||||
}
|
||||
|
||||
public void enterSpawnPOI(){
|
||||
@@ -402,6 +392,8 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
PointOfInterest poi = Current.world().findPointsOfInterest("Spawn");
|
||||
if (poi != null) { //shouldn't be null
|
||||
WorldStage.getInstance().loadPOI(poi);
|
||||
// adjust player sprite to prevent triggering the poi collision point when leaving the spawn on New Game
|
||||
WorldStage.getInstance().getPlayerSprite().storePos(poi.getPosition().x, poi.getPosition().y + 18f);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -302,6 +302,10 @@ public class Controls {
|
||||
}
|
||||
|
||||
static public TextraButton newTextButton(String text, Runnable func) {
|
||||
return newTextButton(text, func, "");
|
||||
}
|
||||
|
||||
static public TextraButton newTextButton(String text, Runnable func, String styleName) {
|
||||
TextraButton ret = newTextButton(text);
|
||||
ret.addListener(new ClickListener() {
|
||||
@Override
|
||||
@@ -314,7 +318,8 @@ public class Controls {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!styleName.isEmpty())
|
||||
ret.setStyle(getTextButtonStyle(styleName));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ public enum KeyBinding {
|
||||
ExitToWorldMap("ExitToWorldMap", new int[]{Input.Keys.F4, Input.Keys.BUTTON_L2}),
|
||||
Bookmark("Bookmark", new int[]{Input.Keys.B, Input.Keys.BUTTON_R2}),
|
||||
Use("Use", new int[]{Input.Keys.ENTER, Input.Keys.BUTTON_A}),
|
||||
Enter("Enter", new int[]{Input.Keys.ENTER, Input.Keys.BUTTON_START}),
|
||||
Back("Back", new int[]{Input.Keys.ESCAPE, Input.Keys.BUTTON_B, Input.Keys.BACK}),
|
||||
ScrollUp("ScrollUp", new int[]{Input.Keys.PAGE_UP, Input.Keys.BUTTON_L1}),
|
||||
ScrollDown("ScrollDown", new int[]{Input.Keys.PAGE_DOWN, Input.Keys.BUTTON_R1}),
|
||||
|
||||
@@ -123,11 +123,11 @@ public class KeyBoardDialog extends Dialog {
|
||||
key0 = Controls.newTextButton("0", () -> kbLabel.setText(kbLabel.getText()+"0"));
|
||||
keyDot = Controls.newTextButton(".", () -> kbLabel.setText(kbLabel.getText()+"."));
|
||||
keyComma = Controls.newTextButton(",", () -> kbLabel.setText(kbLabel.getText()+","));
|
||||
keyShift = Controls.newTextButton("Aa", this::shiftKey);
|
||||
keyBackspace = Controls.newTextButton("<<", () -> kbLabel.setText(removeLastChar(String.valueOf(kbLabel.getText()))));
|
||||
keySpace = Controls.newTextButton("SPACE", () -> kbLabel.setText(kbLabel.getText()+" "));
|
||||
keyOK = Controls.newTextButton("OK", this::setKeyboardDialogText);
|
||||
keyAbort = Controls.newTextButton("Abort", this::abortKeyInput);
|
||||
keyShift = Controls.newTextButton("\u2191", this::shiftKey);
|
||||
keyBackspace = Controls.newTextButton("\u2190", () -> kbLabel.setText(removeLastChar(String.valueOf(kbLabel.getText()))));
|
||||
keySpace = Controls.newTextButton("_____", () -> kbLabel.setText(kbLabel.getText()+" "));
|
||||
keyOK = Controls.newTextButton("[+OK]", this::setKeyboardDialogText);
|
||||
keyAbort = Controls.newTextButton("[+Exit]", this::abortKeyInput);
|
||||
this.getContentTable().add(kbLabel).width(220).height(20).colspan(10).expandX().align(Align.center);
|
||||
this.getButtonTable().row();
|
||||
this.getButtonTable().add(key1).width(20).height(20);
|
||||
|
||||
@@ -92,10 +92,10 @@ public class MapDialog {
|
||||
@Override
|
||||
public void changed(ChangeEvent changeEvent, Actor actor) {
|
||||
if (prebuiltQuestData != null && Integer.parseInt(questAccepted) == prebuiltQuestData.getID()) {
|
||||
Current.player().addQuest(prebuiltQuestData);
|
||||
Current.player().addQuest(prebuiltQuestData, false);
|
||||
}
|
||||
else {
|
||||
Current.player().addQuest(questAccepted);
|
||||
Current.player().addQuest(questAccepted, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -80,41 +80,63 @@ public class Assets implements Disposable {
|
||||
bitmapFont.dispose();
|
||||
counterFonts.clear();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
try {
|
||||
if (fallback_skins != null) {
|
||||
for (Texture texture : fallback_skins.values())
|
||||
texture.dispose();
|
||||
fallback_skins.clear();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
try {
|
||||
if (tmxMap != null) {
|
||||
for (Texture texture : tmxMap.values())
|
||||
texture.dispose();
|
||||
tmxMap.clear();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
try {
|
||||
if (defaultImage != null)
|
||||
defaultImage.dispose();
|
||||
} catch (Exception ignored) {}
|
||||
try {
|
||||
if (dummy != null)
|
||||
dummy.dispose();
|
||||
} catch (Exception ignored) {}
|
||||
try {
|
||||
if (textrafonts != null) {
|
||||
for (Font f : textrafonts.values())
|
||||
f.dispose();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
if (cardArtCache != null)
|
||||
cardArtCache.clear();
|
||||
if (avatarImages != null)
|
||||
avatarImages.clear();
|
||||
if (manaImages != null)
|
||||
manaImages.clear();
|
||||
if (symbolLookup != null)
|
||||
symbolLookup.clear();
|
||||
if (images != null)
|
||||
images.clear();
|
||||
if (avatars != null)
|
||||
avatars.clear();
|
||||
if (sleeves != null)
|
||||
sleeves.clear();
|
||||
if (cracks != null)
|
||||
cracks.clear();
|
||||
if (borders != null)
|
||||
borders.clear();
|
||||
if (deckbox != null)
|
||||
deckbox.clear();
|
||||
if (cursor != null)
|
||||
cursor.clear();
|
||||
if (fonts != null)
|
||||
fonts.clear();
|
||||
try {
|
||||
if (manager != null)
|
||||
manager.dispose();
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
public MemoryTrackingAssetManager manager() {
|
||||
|
||||
@@ -37,50 +37,50 @@ public enum FSkinTexture implements FImage {
|
||||
ADV_BG_DUNGEON(ForgeConstants.ADV_BG_DUNGEON_FILE, false, false),
|
||||
ADV_BG_CASTLE(ForgeConstants.ADV_BG_CASTLE_FILE, false, false),
|
||||
//CARD BG
|
||||
CARDBG_A (ForgeConstants.IMG_CARDBG_A, false, false),
|
||||
CARDBG_B (ForgeConstants.IMG_CARDBG_B, false, false),
|
||||
CARDBG_BG (ForgeConstants.IMG_CARDBG_BG, false, false),
|
||||
CARDBG_BR (ForgeConstants.IMG_CARDBG_BR, false, false),
|
||||
CARDBG_C (ForgeConstants.IMG_CARDBG_C, false, false),
|
||||
CARDBG_G (ForgeConstants.IMG_CARDBG_G, false, false),
|
||||
CARDBG_L (ForgeConstants.IMG_CARDBG_L, false, false),
|
||||
CARDBG_M (ForgeConstants.IMG_CARDBG_M, false, false),
|
||||
CARDBG_R (ForgeConstants.IMG_CARDBG_R, false, false),
|
||||
CARDBG_RG (ForgeConstants.IMG_CARDBG_RG, false, false),
|
||||
CARDBG_U (ForgeConstants.IMG_CARDBG_U, false, false),
|
||||
CARDBG_UB (ForgeConstants.IMG_CARDBG_UB, false, false),
|
||||
CARDBG_UG (ForgeConstants.IMG_CARDBG_UG, false, false),
|
||||
CARDBG_UR (ForgeConstants.IMG_CARDBG_UR, false, false),
|
||||
CARDBG_V (ForgeConstants.IMG_CARDBG_V, false, false),
|
||||
CARDBG_W (ForgeConstants.IMG_CARDBG_W, false, false),
|
||||
CARDBG_WB (ForgeConstants.IMG_CARDBG_WB, false, false),
|
||||
CARDBG_WG (ForgeConstants.IMG_CARDBG_WG, false, false),
|
||||
CARDBG_WR (ForgeConstants.IMG_CARDBG_WR, false, false),
|
||||
CARDBG_WU (ForgeConstants.IMG_CARDBG_WU, false, false),
|
||||
PWBG_B (ForgeConstants.IMG_PWBG_B, false, false),
|
||||
PWBG_BG (ForgeConstants.IMG_PWBG_BG, false, false),
|
||||
PWBG_BR (ForgeConstants.IMG_PWBG_BR, false, false),
|
||||
PWBG_C (ForgeConstants.IMG_PWBG_C, false, false),
|
||||
PWBG_G (ForgeConstants.IMG_PWBG_G, false, false),
|
||||
PWBG_M (ForgeConstants.IMG_PWBG_M, false, false),
|
||||
PWBG_R (ForgeConstants.IMG_PWBG_R, false, false),
|
||||
PWBG_RG (ForgeConstants.IMG_PWBG_RG, false, false),
|
||||
PWBG_U (ForgeConstants.IMG_PWBG_U, false, false),
|
||||
PWBG_UB (ForgeConstants.IMG_PWBG_UB, false, false),
|
||||
PWBG_UG (ForgeConstants.IMG_PWBG_UG, false, false),
|
||||
PWBG_UR (ForgeConstants.IMG_PWBG_UR, false, false),
|
||||
PWBG_W (ForgeConstants.IMG_PWBG_W, false, false),
|
||||
PWBG_WB (ForgeConstants.IMG_PWBG_WB, false, false),
|
||||
PWBG_WG (ForgeConstants.IMG_PWBG_WG, false, false),
|
||||
PWBG_WR (ForgeConstants.IMG_PWBG_WR, false, false),
|
||||
PWBG_WU (ForgeConstants.IMG_PWBG_WU, false, false),
|
||||
NYX_B (ForgeConstants.IMG_NYX_B, false, false),
|
||||
NYX_G (ForgeConstants.IMG_NYX_G, false, false),
|
||||
NYX_M (ForgeConstants.IMG_NYX_M, false, false),
|
||||
NYX_R (ForgeConstants.IMG_NYX_R, false, false),
|
||||
NYX_U (ForgeConstants.IMG_NYX_U, false, false),
|
||||
NYX_W (ForgeConstants.IMG_NYX_W, false, false),
|
||||
NYX_C (ForgeConstants.IMG_NYX_C, false, false),
|
||||
CARDBG_A(ForgeConstants.IMG_CARDBG_A, false, false),
|
||||
CARDBG_B(ForgeConstants.IMG_CARDBG_B, false, false),
|
||||
CARDBG_BG(ForgeConstants.IMG_CARDBG_BG, false, false),
|
||||
CARDBG_BR(ForgeConstants.IMG_CARDBG_BR, false, false),
|
||||
CARDBG_C(ForgeConstants.IMG_CARDBG_C, false, false),
|
||||
CARDBG_G(ForgeConstants.IMG_CARDBG_G, false, false),
|
||||
CARDBG_L(ForgeConstants.IMG_CARDBG_L, false, false),
|
||||
CARDBG_M(ForgeConstants.IMG_CARDBG_M, false, false),
|
||||
CARDBG_R(ForgeConstants.IMG_CARDBG_R, false, false),
|
||||
CARDBG_RG(ForgeConstants.IMG_CARDBG_RG, false, false),
|
||||
CARDBG_U(ForgeConstants.IMG_CARDBG_U, false, false),
|
||||
CARDBG_UB(ForgeConstants.IMG_CARDBG_UB, false, false),
|
||||
CARDBG_UG(ForgeConstants.IMG_CARDBG_UG, false, false),
|
||||
CARDBG_UR(ForgeConstants.IMG_CARDBG_UR, false, false),
|
||||
CARDBG_V(ForgeConstants.IMG_CARDBG_V, false, false),
|
||||
CARDBG_W(ForgeConstants.IMG_CARDBG_W, false, false),
|
||||
CARDBG_WB(ForgeConstants.IMG_CARDBG_WB, false, false),
|
||||
CARDBG_WG(ForgeConstants.IMG_CARDBG_WG, false, false),
|
||||
CARDBG_WR(ForgeConstants.IMG_CARDBG_WR, false, false),
|
||||
CARDBG_WU(ForgeConstants.IMG_CARDBG_WU, false, false),
|
||||
PWBG_B(ForgeConstants.IMG_PWBG_B, false, false),
|
||||
PWBG_BG(ForgeConstants.IMG_PWBG_BG, false, false),
|
||||
PWBG_BR(ForgeConstants.IMG_PWBG_BR, false, false),
|
||||
PWBG_C(ForgeConstants.IMG_PWBG_C, false, false),
|
||||
PWBG_G(ForgeConstants.IMG_PWBG_G, false, false),
|
||||
PWBG_M(ForgeConstants.IMG_PWBG_M, false, false),
|
||||
PWBG_R(ForgeConstants.IMG_PWBG_R, false, false),
|
||||
PWBG_RG(ForgeConstants.IMG_PWBG_RG, false, false),
|
||||
PWBG_U(ForgeConstants.IMG_PWBG_U, false, false),
|
||||
PWBG_UB(ForgeConstants.IMG_PWBG_UB, false, false),
|
||||
PWBG_UG(ForgeConstants.IMG_PWBG_UG, false, false),
|
||||
PWBG_UR(ForgeConstants.IMG_PWBG_UR, false, false),
|
||||
PWBG_W(ForgeConstants.IMG_PWBG_W, false, false),
|
||||
PWBG_WB(ForgeConstants.IMG_PWBG_WB, false, false),
|
||||
PWBG_WG(ForgeConstants.IMG_PWBG_WG, false, false),
|
||||
PWBG_WR(ForgeConstants.IMG_PWBG_WR, false, false),
|
||||
PWBG_WU(ForgeConstants.IMG_PWBG_WU, false, false),
|
||||
NYX_B(ForgeConstants.IMG_NYX_B, false, false),
|
||||
NYX_G(ForgeConstants.IMG_NYX_G, false, false),
|
||||
NYX_M(ForgeConstants.IMG_NYX_M, false, false),
|
||||
NYX_R(ForgeConstants.IMG_NYX_R, false, false),
|
||||
NYX_U(ForgeConstants.IMG_NYX_U, false, false),
|
||||
NYX_W(ForgeConstants.IMG_NYX_W, false, false),
|
||||
NYX_C(ForgeConstants.IMG_NYX_C, false, false),
|
||||
GENERIC_PLANE("", false, true);
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ public enum FSkinTexture implements FImage {
|
||||
repeat = repeat0;
|
||||
isPlanechaseBG = isPlanechaseBG0;
|
||||
}
|
||||
|
||||
public static List<String> getValues() {
|
||||
if (planechaseString == null) {
|
||||
planechaseString = new ArrayList<>();
|
||||
@@ -114,12 +115,13 @@ public enum FSkinTexture implements FImage {
|
||||
public void load() {
|
||||
load("");
|
||||
}
|
||||
|
||||
public boolean load(String planeName) {
|
||||
if (hasError)
|
||||
return false;
|
||||
if (!planeName.isEmpty()) {
|
||||
texture = null; //reset
|
||||
this.filename = planeName + ".jpg";
|
||||
this.filename = ImageFetcher.getPlanechaseFilename(planeName);
|
||||
}
|
||||
FileHandle preferredFile = isPlanechaseBG ? FSkin.getCachePlanechaseFile(filename) : FSkin.getSkinFile(filename);
|
||||
if (preferredFile.exists()) {
|
||||
@@ -127,8 +129,7 @@ public enum FSkinTexture implements FImage {
|
||||
texture = Forge.getAssets().getTexture(preferredFile, false);
|
||||
if (texture != null)
|
||||
isloaded = true;
|
||||
}
|
||||
catch (final Exception e) {
|
||||
} catch (final Exception e) {
|
||||
System.err.println("Failed to load skin file: " + preferredFile);
|
||||
e.printStackTrace();
|
||||
isloaded = false;
|
||||
@@ -138,14 +139,14 @@ public enum FSkinTexture implements FImage {
|
||||
if (texture == null) {
|
||||
//use default file if can't use preferred file
|
||||
FileHandle defaultFile = FSkin.getDefaultSkinFile(filename);
|
||||
if(isPlanechaseBG) {
|
||||
if (isPlanechaseBG) {
|
||||
ImageFetcher fetcher = GuiBase.getInterface().getImageFetcher();
|
||||
fetcher.fetchImage("PLANECHASEBG:" + filename, () -> {
|
||||
fetcher.fetchImage("PLANECHASEBG:" + planeName, () -> {
|
||||
hasError = false;
|
||||
load();
|
||||
});
|
||||
defaultFile = FSkin.getSkinFile(ForgeConstants.MATCH_BG_FILE);
|
||||
if(!defaultFile.exists())
|
||||
if (!defaultFile.exists())
|
||||
defaultFile = FSkin.getDefaultSkinFile(ForgeConstants.MATCH_BG_FILE);
|
||||
}
|
||||
|
||||
@@ -153,16 +154,14 @@ public enum FSkinTexture implements FImage {
|
||||
try {
|
||||
texture = Forge.getAssets().getTexture(defaultFile);
|
||||
isloaded = true;
|
||||
}
|
||||
catch (final Exception e) {
|
||||
} catch (final Exception e) {
|
||||
System.err.println("Failed to load skin file: " + defaultFile);
|
||||
e.printStackTrace();
|
||||
isloaded = false;
|
||||
hasError = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
System.err.println("Failed to load skin file: " + defaultFile);
|
||||
isloaded = false;
|
||||
hasError = true;
|
||||
|
||||
@@ -45,6 +45,8 @@ public class CardImageRenderer {
|
||||
private static FSkinFont NAME_FONT, TYPE_FONT, TEXT_FONT, PT_FONT;
|
||||
private static float prevImageWidth, prevImageHeight;
|
||||
private static final float BLACK_BORDER_THICKNESS_RATIO = 0.021f;
|
||||
public static final Color[] VEHICLE_PTBOX_COLOR = new Color[] { Color.valueOf("#A36C42") };
|
||||
public static final Color[] SPACECRAFT_PTBOX_COLOR = new Color[] { Color.valueOf("#6F6E6E") };
|
||||
|
||||
private static Color fromDetailColor(DetailColors detailColor) {
|
||||
return FSkinColor.fromRGB(detailColor.r, detailColor.g, detailColor.b);
|
||||
@@ -151,7 +153,7 @@ public class CardImageRenderer {
|
||||
float ptBoxHeight = 0;
|
||||
float textBoxHeight = h - headerHeight - artHeight - typeBoxHeight - outerBorderThickness - artInset;
|
||||
|
||||
if (state.isCreature() || state.isPlaneswalker() || state.getType().hasSubtype("Vehicle") || state.isBattle()) {
|
||||
if (state.isCreature() || state.isPlaneswalker() || state.hasPrintedPT() || state.isBattle()) {
|
||||
ptBoxHeight = 2 * PT_FONT.getCapHeight();
|
||||
}
|
||||
//space for artist
|
||||
@@ -231,7 +233,7 @@ public class CardImageRenderer {
|
||||
if (onTop && ptBoxHeight > 0) {
|
||||
//only needed if on top since otherwise P/T will be hidden
|
||||
Color[] ptColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.PT_BOX_TINT);
|
||||
drawPtBox(g, card, state, ptColors, x, y - 2 * artInset, w, ptBoxHeight, noText);
|
||||
drawPtBox(g, state, ptColors, x, y - 2 * artInset, w, ptBoxHeight, noText);
|
||||
}
|
||||
//draw artist
|
||||
if (showArtist)
|
||||
@@ -716,7 +718,7 @@ public class CardImageRenderer {
|
||||
g.drawImage(Forge.getAssets().getTexture(getDefaultSkinFile("overlay_alpha.png")), x, y, w, h);
|
||||
}
|
||||
|
||||
private static void drawPtBox(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean noText) {
|
||||
private static void drawPtBox(Graphics g, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean noText) {
|
||||
List<String> pieces = new ArrayList<>();
|
||||
if (state.isCreature()) {
|
||||
pieces.add(String.valueOf(state.getPower()));
|
||||
@@ -724,8 +726,7 @@ public class CardImageRenderer {
|
||||
pieces.add(String.valueOf(state.getToughness()));
|
||||
} else if (state.isPlaneswalker()) {
|
||||
pieces.add(String.valueOf(state.getLoyalty()));
|
||||
} else if (state.getType().hasSubtype("Vehicle")) {
|
||||
// TODO Invert color box for Vehicles?
|
||||
} else if (state.hasPrintedPT()) {
|
||||
pieces.add("[");
|
||||
pieces.add(String.valueOf(state.getPower()));
|
||||
pieces.add("/");
|
||||
@@ -753,17 +754,16 @@ public class CardImageRenderer {
|
||||
w = boxWidth;
|
||||
h = boxHeight;
|
||||
|
||||
fillColorBackground(g, colors, x, y, w, h);
|
||||
fillColorBackground(g, state.isVehicle() ? VEHICLE_PTBOX_COLOR : state.isSpaceCraft() ? SPACECRAFT_PTBOX_COLOR : colors, x, y, w, h);
|
||||
//draw outline color here
|
||||
if (state != null)
|
||||
drawOutlineColor(g, state.getColors(), x, y, w, h);
|
||||
drawOutlineColor(g, state.getColors(), x, y, w, h);
|
||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||
|
||||
if (noText)
|
||||
return;
|
||||
x += (boxWidth - totalPieceWidth) / 2;
|
||||
for (int i = 0; i < pieces.size(); i++) {
|
||||
g.drawText(pieces.get(i), PT_FONT, Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
g.drawText(pieces.get(i), PT_FONT, state.isVehicle() || state.isSpaceCraft() ? Color.WHITE : Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
x += pieceWidths[i];
|
||||
}
|
||||
}
|
||||
@@ -936,7 +936,7 @@ public class CardImageRenderer {
|
||||
|
||||
y += textBoxHeight + innerBorderThickness;
|
||||
Color[] ptColors = FSkinColor.tintColors(Color.WHITE, colors, CardRenderer.PT_BOX_TINT);
|
||||
drawDetailsIdAndPtBox(g, card, state, canShow, idForeColor, ptColors, x, y, w, ptBoxHeight);
|
||||
drawDetailsIdAndPtBox(g, state, canShow, idForeColor, ptColors, x, y, w, ptBoxHeight);
|
||||
}
|
||||
|
||||
public static Color[] fillColorBackground(Graphics g, List<DetailColors> backColors, float x, float y, float w, float h) {
|
||||
@@ -952,7 +952,6 @@ public class CardImageRenderer {
|
||||
public static Color[] drawCardBackgroundTexture(CardStateView state, Graphics g, List<DetailColors> backColors, float x, float y, float w, float h) {
|
||||
boolean isHybrid = state.getManaCost().hasMultiColor();
|
||||
boolean isPW = state.isPlaneswalker();
|
||||
boolean isNyx = state.isNyx();
|
||||
Color[] colors = new Color[backColors.size()];
|
||||
for (int i = 0; i < colors.length; i++) {
|
||||
DetailColors dc = backColors.get(i);
|
||||
@@ -967,7 +966,7 @@ public class CardImageRenderer {
|
||||
} else if (backColors.get(0) == DetailColors.MULTICOLOR) {
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_M, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -978,7 +977,7 @@ public class CardImageRenderer {
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isPW)
|
||||
g.drawImage(FSkinTexture.PWBG_C, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_C, x, y, w, h);
|
||||
else if (state.isArtifact())
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -987,7 +986,7 @@ public class CardImageRenderer {
|
||||
} else if (backColors.get(0) == DetailColors.GREEN) {
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_G, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -996,7 +995,7 @@ public class CardImageRenderer {
|
||||
} else if (backColors.get(0) == DetailColors.RED) {
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_R, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1005,7 +1004,7 @@ public class CardImageRenderer {
|
||||
} else if (backColors.get(0) == DetailColors.BLACK) {
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_B, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1014,7 +1013,7 @@ public class CardImageRenderer {
|
||||
} else if (backColors.get(0) == DetailColors.BLUE) {
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_U, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1023,7 +1022,7 @@ public class CardImageRenderer {
|
||||
} else if (backColors.get(0) == DetailColors.WHITE) {
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_W, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1034,7 +1033,7 @@ public class CardImageRenderer {
|
||||
case 2:
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_M, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1067,7 +1066,7 @@ public class CardImageRenderer {
|
||||
case 3:
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_M, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1077,7 +1076,7 @@ public class CardImageRenderer {
|
||||
default:
|
||||
if (state.isVehicle())
|
||||
g.drawImage(FSkinTexture.CARDBG_V, x, y, w, h);
|
||||
else if (isNyx)
|
||||
else if (state.isEnchantment())
|
||||
g.drawImage(FSkinTexture.NYX_C, x, y, w, h);
|
||||
else if (state.isArtifact() && !isPW)
|
||||
g.drawImage(FSkinTexture.CARDBG_A, x, y, w, h);
|
||||
@@ -1168,7 +1167,7 @@ public class CardImageRenderer {
|
||||
cardTextRenderer.drawText(g, CardDetailUtil.composeCardText(state, gameView, canShow), TEXT_FONT, Color.BLACK, x, y, w, h, y, h, true, Align.left, false);
|
||||
}
|
||||
|
||||
private static void drawDetailsIdAndPtBox(Graphics g, CardView card, CardStateView state, boolean canShow, Color idForeColor, Color[] colors, float x, float y, float w, float h) {
|
||||
private static void drawDetailsIdAndPtBox(Graphics g, CardStateView state, boolean canShow, Color idForeColor, Color[] colors, float x, float y, float w, float h) {
|
||||
float idWidth = 0;
|
||||
if (canShow) {
|
||||
String idText = CardDetailUtil.formatCardId(state);
|
||||
@@ -1188,8 +1187,8 @@ public class CardImageRenderer {
|
||||
x += w - boxWidth;
|
||||
w = boxWidth;
|
||||
|
||||
fillColorBackground(g, colors, x, y, w, h);
|
||||
fillColorBackground(g, state.isVehicle() ? VEHICLE_PTBOX_COLOR : state.isSpaceCraft() ? SPACECRAFT_PTBOX_COLOR : colors, x, y, w, h);
|
||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||
cardTextRenderer.drawText(g, ptText, PT_FONT, Color.BLACK, x, y, w, h, y, h, false, Align.center, true);
|
||||
cardTextRenderer.drawText(g, ptText, PT_FONT, state.isVehicle() || state.isSpaceCraft() ? Color.WHITE : Color.BLACK, x, y, w, h, y, h, false, Align.center, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1382,7 +1382,7 @@ public class CardRenderer {
|
||||
pieces.add(String.valueOf(details.getPower()));
|
||||
pieces.add("/");
|
||||
pieces.add(String.valueOf(details.getToughness()));
|
||||
} else if (details.getType().hasSubtype("Vehicle")) {
|
||||
} else if (details.hasPrintedPT()) {
|
||||
pieces.add("[");
|
||||
pieces.add(String.valueOf(details.getPower()));
|
||||
pieces.add("/");
|
||||
@@ -1422,12 +1422,13 @@ public class CardRenderer {
|
||||
g.drawOutlinedText(">" + card.getDamage() + "<", font, Color.RED, Color.WHITE, x, y - h + padding, w, h, false, Align.center, true);
|
||||
}
|
||||
|
||||
g.fillRect(color, x, y, w, h);
|
||||
g.fillRect(details.isVehicle() ? CardImageRenderer.VEHICLE_PTBOX_COLOR[0] :
|
||||
details.isSpaceCraft() ? CardImageRenderer.SPACECRAFT_PTBOX_COLOR[0] : color, x, y, w, h);
|
||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||
|
||||
x += padding;
|
||||
for (int i = 0; i < pieces.size(); i++) {
|
||||
g.drawText(pieces.get(i), font, Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
g.drawText(pieces.get(i), font, details.isVehicle() || details.isSpaceCraft() ? Color.WHITE : Color.BLACK, x, y, w, h, false, Align.left, true);
|
||||
x += pieceWidths.get(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ import forge.toolbox.FScrollPane;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.Utils;
|
||||
import forge.util.GuiPrefBinders;
|
||||
|
||||
public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
private static final ForgePreferences prefs = FModel.getPreferences();
|
||||
@@ -72,6 +73,8 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
// Max games in a match frame and variables
|
||||
private final FLabel lblGamesInMatch = new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblMatch") + ":").font(VARIANTS_FONT).build();
|
||||
private final FComboBox<String> cbGamesInMatch = new FComboBox<>();
|
||||
private final GuiPrefBinders.ComboBox cbGamesInMatchBinder =
|
||||
new GuiPrefBinders.ComboBox(FPref.UI_MATCHES_PER_GAME, cbGamesInMatch);
|
||||
|
||||
private final List<PlayerPanel> playerPanels = new ArrayList<>(MAX_PLAYERS);
|
||||
private final FScrollPane playersScroll = new FScrollPane() {
|
||||
@@ -133,8 +136,6 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
cbGamesInMatch.addItem("1");
|
||||
cbGamesInMatch.addItem("3");
|
||||
cbGamesInMatch.addItem("5");
|
||||
cbGamesInMatch.setSelectedItem(FModel.getPreferences().getPref((FPref.UI_MATCHES_PER_GAME)));
|
||||
cbGamesInMatch.setChangedHandler(event -> FModel.getPreferences().setPref(FPref.UI_MATCHES_PER_GAME, cbGamesInMatch.getSelectedItem()));
|
||||
|
||||
add(lblVariants);
|
||||
add(cbVariants);
|
||||
@@ -588,6 +589,11 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
cbGamesInMatchBinder.load();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(final boolean fullUpdate) {
|
||||
int playerCount = lobby.getNumberOfSlots();
|
||||
|
||||
@@ -20,6 +20,7 @@ import forge.gamemodes.match.HostedMatch;
|
||||
import forge.gui.FThreads;
|
||||
import forge.gui.GuiBase;
|
||||
import forge.gui.util.SGuiChoose;
|
||||
import forge.util.GuiPrefBinders;
|
||||
import forge.itemmanager.DeckManager;
|
||||
import forge.itemmanager.ItemManagerConfig;
|
||||
import forge.itemmanager.filters.ItemFilter;
|
||||
@@ -32,6 +33,7 @@ import forge.screens.home.LoadGameMenu;
|
||||
import forge.toolbox.FComboBox;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class LoadDraftScreen extends LaunchScreen {
|
||||
private final DeckManager lstDecks = add(new DeckManager(GameType.Draft));
|
||||
@@ -44,6 +46,12 @@ public class LoadDraftScreen extends LaunchScreen {
|
||||
private final FLabel lblMode = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblMode")).font(GAME_MODE_FONT).build());
|
||||
private final FComboBox<String> cbMode = add(new FComboBox<>());
|
||||
|
||||
// Max games in a match frame and variables
|
||||
private final FLabel lblGamesInMatch = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblMatch") + ":").font(GAME_MODE_FONT).build());
|
||||
private final FComboBox<String> cbGamesInMatch = add(new FComboBox<>());
|
||||
private final GuiPrefBinders.ComboBox cbGamesInMatchBinder = new GuiPrefBinders.ComboBox(
|
||||
FPref.UI_MATCHES_PER_GAME, cbGamesInMatch);
|
||||
|
||||
public LoadDraftScreen() {
|
||||
super(null, LoadGameMenu.getMenu());
|
||||
|
||||
@@ -53,12 +61,18 @@ public class LoadDraftScreen extends LaunchScreen {
|
||||
|
||||
lstDecks.setup(ItemManagerConfig.DRAFT_DECKS);
|
||||
lstDecks.setItemActivateHandler(event -> editSelectedDeck());
|
||||
|
||||
cbGamesInMatch.setFont(GAME_MODE_FONT);
|
||||
cbGamesInMatch.addItem("1");
|
||||
cbGamesInMatch.addItem("3");
|
||||
cbGamesInMatch.addItem("5");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
lstDecks.setPool(DeckProxy.getAllDraftDecks());
|
||||
lstDecks.setSelectedString(DeckPreferences.getDraftDeck());
|
||||
cbGamesInMatchBinder.load();
|
||||
}
|
||||
|
||||
private void editSelectedDeck() {
|
||||
@@ -78,8 +92,16 @@ public class LoadDraftScreen extends LaunchScreen {
|
||||
float listHeight = height - labelHeight - y - FDeckChooser.PADDING;
|
||||
float comboBoxHeight = cbMode.getHeight();
|
||||
|
||||
lblMode.setBounds(x, y, lblMode.getAutoSizeBounds().width + FDeckChooser.PADDING / 2, comboBoxHeight);
|
||||
cbMode.setBounds(x + lblMode.getWidth(), y, w - lblMode.getWidth(), comboBoxHeight);
|
||||
float x2 = x;
|
||||
float w1 = lblMode.getAutoSizeBounds().width;
|
||||
float w2 = lblGamesInMatch.getAutoSizeBounds().width;
|
||||
lblMode.setBounds(x2, y, w1 + FDeckChooser.PADDING / 2, comboBoxHeight);
|
||||
x2 += lblMode.getWidth();
|
||||
cbMode.setBounds(x2, y, w - x2 - w2 - Utils.AVG_FINGER_WIDTH, comboBoxHeight);
|
||||
x2 += cbMode.getWidth();
|
||||
lblGamesInMatch.setBounds(x2, y, w2 + FDeckChooser.PADDING / 2, comboBoxHeight);
|
||||
x2 += lblGamesInMatch.getWidth();
|
||||
cbGamesInMatch.setBounds(x2, y, Utils.AVG_FINGER_WIDTH, comboBoxHeight);
|
||||
y += comboBoxHeight + FDeckChooser.PADDING;
|
||||
lstDecks.setBounds(x, y, w, listHeight);
|
||||
y += listHeight + FDeckChooser.PADDING;
|
||||
|
||||
@@ -20,6 +20,7 @@ import forge.gamemodes.match.HostedMatch;
|
||||
import forge.gui.FThreads;
|
||||
import forge.gui.GuiBase;
|
||||
import forge.gui.util.SGuiChoose;
|
||||
import forge.util.GuiPrefBinders;
|
||||
import forge.itemmanager.DeckManager;
|
||||
import forge.itemmanager.ItemManagerConfig;
|
||||
import forge.itemmanager.filters.ItemFilter;
|
||||
@@ -32,6 +33,7 @@ import forge.screens.home.LoadGameMenu;
|
||||
import forge.toolbox.FComboBox;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class LoadSealedScreen extends LaunchScreen {
|
||||
private final DeckManager lstDecks = add(new DeckManager(GameType.Draft));
|
||||
@@ -44,6 +46,12 @@ public class LoadSealedScreen extends LaunchScreen {
|
||||
private final FLabel lblMode = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblMode")).font(GAME_MODE_FONT).build());
|
||||
private final FComboBox<String> cbMode = add(new FComboBox<>());
|
||||
|
||||
// Max games in a match frame and variables
|
||||
private final FLabel lblGamesInMatch = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblMatch") + ":").font(GAME_MODE_FONT).build());
|
||||
private final FComboBox<String> cbGamesInMatch = add(new FComboBox<>());
|
||||
private final GuiPrefBinders.ComboBox cbGamesInMatchBinder = new GuiPrefBinders.ComboBox(
|
||||
FPref.UI_MATCHES_PER_GAME, cbGamesInMatch);
|
||||
|
||||
public LoadSealedScreen() {
|
||||
super(null, LoadGameMenu.getMenu());
|
||||
|
||||
@@ -53,12 +61,18 @@ public class LoadSealedScreen extends LaunchScreen {
|
||||
|
||||
lstDecks.setup(ItemManagerConfig.SEALED_DECKS);
|
||||
lstDecks.setItemActivateHandler(event -> editSelectedDeck());
|
||||
|
||||
cbGamesInMatch.setFont(GAME_MODE_FONT);
|
||||
cbGamesInMatch.addItem("1");
|
||||
cbGamesInMatch.addItem("3");
|
||||
cbGamesInMatch.addItem("5");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
lstDecks.setPool(DeckProxy.getAllSealedDecks());
|
||||
lstDecks.setSelectedString(DeckPreferences.getSealedDeck());
|
||||
cbGamesInMatchBinder.load();
|
||||
}
|
||||
|
||||
private void editSelectedDeck() {
|
||||
@@ -78,8 +92,16 @@ public class LoadSealedScreen extends LaunchScreen {
|
||||
float listHeight = height - labelHeight - y - FDeckChooser.PADDING;
|
||||
float comboBoxHeight = cbMode.getHeight();
|
||||
|
||||
lblMode.setBounds(x, y, lblMode.getAutoSizeBounds().width + FDeckChooser.PADDING / 2, comboBoxHeight);
|
||||
cbMode.setBounds(x + lblMode.getWidth(), y, w - lblMode.getWidth(), comboBoxHeight);
|
||||
float x2 = x;
|
||||
float w1 = lblMode.getAutoSizeBounds().width;
|
||||
float w2 = lblGamesInMatch.getAutoSizeBounds().width;
|
||||
lblMode.setBounds(x2, y, w1 + FDeckChooser.PADDING / 2, comboBoxHeight);
|
||||
x2 += lblMode.getWidth();
|
||||
cbMode.setBounds(x2, y, w - x2 - w2 - Utils.AVG_FINGER_WIDTH, comboBoxHeight);
|
||||
x2 += cbMode.getWidth();
|
||||
lblGamesInMatch.setBounds(x2, y, w2 + FDeckChooser.PADDING / 2, comboBoxHeight);
|
||||
x2 += lblGamesInMatch.getWidth();
|
||||
cbGamesInMatch.setBounds(x2, y, Utils.AVG_FINGER_WIDTH, comboBoxHeight);
|
||||
y += comboBoxHeight + FDeckChooser.PADDING;
|
||||
lstDecks.setBounds(x, y, w, listHeight);
|
||||
y += listHeight + FDeckChooser.PADDING;
|
||||
|
||||
@@ -969,8 +969,7 @@ public class MatchScreen extends FScreen {
|
||||
//overrideBG
|
||||
if (!Forge.isMobileAdventureMode) {
|
||||
if (hasActivePlane()) {
|
||||
imageName = getPlaneName().replace(" ", "_").replace("'", "")
|
||||
.replace("-", "").replace("!", "");
|
||||
imageName = getPlaneName();
|
||||
if (!plane.equals(imageName)) {
|
||||
plane = imageName;
|
||||
bgAnimation.progress = 0;
|
||||
|
||||
23
forge-gui-mobile/src/forge/util/GuiPrefBinders.java
Normal file
23
forge-gui-mobile/src/forge/util/GuiPrefBinders.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package forge.util;
|
||||
|
||||
import forge.toolbox.FComboBox;
|
||||
import forge.localinstance.properties.ForgePreferences;
|
||||
import forge.model.FPrefsBinder;
|
||||
|
||||
public class GuiPrefBinders {
|
||||
public static final class ComboBox extends FPrefsBinder<FComboBox<String>, String> {
|
||||
public ComboBox(ForgePreferences.FPref key, FComboBox<String> box) {
|
||||
super(
|
||||
key,
|
||||
box,
|
||||
b -> (String) b.getSelectedItem(),
|
||||
(b, s) -> b.setSelectedItem(s),
|
||||
s -> s,
|
||||
s -> s);
|
||||
|
||||
box.setChangedHandler(e -> {
|
||||
this.save();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,8 @@ public class LibGDXImageFetcher extends ImageFetcher {
|
||||
|
||||
String newdespath = urlToDownload.contains(".fullborder.") || urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD) ?
|
||||
TextUtil.fastReplace(destPath, ".full.", ".fullborder.") : destPath;
|
||||
if (!newdespath.contains(".full") && urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD) && !destPath.startsWith(ForgeConstants.CACHE_TOKEN_PICS_DIR))
|
||||
if (!newdespath.contains(".full") && urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD) &&
|
||||
!destPath.startsWith(ForgeConstants.CACHE_TOKEN_PICS_DIR) && !destPath.startsWith(ForgeConstants.CACHE_PLANECHASE_PICS_DIR))
|
||||
newdespath = newdespath.replace(".jpg", ".fullborder.jpg"); //fix planes/phenomenon for round border options
|
||||
URL url = new URL(urlToDownload);
|
||||
System.out.println("Attempting to fetch: " + url);
|
||||
@@ -83,10 +84,10 @@ public class LibGDXImageFetcher extends ImageFetcher {
|
||||
public void run() {
|
||||
boolean success = false;
|
||||
for (String urlToDownload : downloadUrls) {
|
||||
boolean isPlanechaseBG = urlToDownload.startsWith("https://downloads.cardforge.org/images/planes/");
|
||||
boolean isPlanechaseBG = urlToDownload.startsWith("PLANECHASEBG:");
|
||||
try {
|
||||
|
||||
success = doFetch(urlToDownload);
|
||||
success = doFetch(urlToDownload.replace("PLANECHASEBG:", ""));
|
||||
|
||||
if (success) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user