mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
Merge pull request #2469 from kevlahnota/newmaster2
update deckaward dialog
This commit is contained in:
@@ -60,7 +60,7 @@ public class GameHUD extends Stage {
|
|||||||
float TOUCHPAD_SCALE = 70f, referenceX;
|
float TOUCHPAD_SCALE = 70f, referenceX;
|
||||||
boolean isHiding = false, isShowing = false;
|
boolean isHiding = false, isShowing = false;
|
||||||
float opacity = 1f;
|
float opacity = 1f;
|
||||||
private boolean debugMap;
|
private boolean debugMap, updatelife;
|
||||||
|
|
||||||
private final Dialog dialog;
|
private final Dialog dialog;
|
||||||
private boolean dialogOnlyInput;
|
private boolean dialogOnlyInput;
|
||||||
@@ -125,7 +125,7 @@ public class GameHUD extends Stage {
|
|||||||
shards.setText("[%95][+Shards] 0");
|
shards.setText("[%95][+Shards] 0");
|
||||||
money.setText("[%95][+Gold] ");
|
money.setText("[%95][+Gold] ");
|
||||||
lifePoints.setText("[%95][+Life] 20/20");
|
lifePoints.setText("[%95][+Life] 20/20");
|
||||||
AdventurePlayer.current().onLifeChange(() -> lifePoints.setText("[%95][+Life] "+AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife()));
|
AdventurePlayer.current().onLifeChange(() -> lifePoints.setText("[%95][+Life]"+ lifepointsTextColor +" "+AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife()));
|
||||||
AdventurePlayer.current().onShardsChange(() -> shards.setText("[%95][+Shards] "+AdventurePlayer.current().getShards()));
|
AdventurePlayer.current().onShardsChange(() -> shards.setText("[%95][+Shards] "+AdventurePlayer.current().getShards()));
|
||||||
|
|
||||||
WorldSave.getCurrentSave().getPlayer().onGoldChange(() -> money.setText("[%95][+Gold] "+String.valueOf(AdventurePlayer.current().getGold())));
|
WorldSave.getCurrentSave().getPlayer().onGoldChange(() -> money.setText("[%95][+Gold] "+String.valueOf(AdventurePlayer.current().getGold())));
|
||||||
@@ -236,6 +236,7 @@ public class GameHUD extends Stage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() {
|
public void draw() {
|
||||||
|
updatelife = false;
|
||||||
int yPos = (int) gameStage.player.getY();
|
int yPos = (int) gameStage.player.getY();
|
||||||
int xPos = (int) gameStage.player.getX();
|
int xPos = (int) gameStage.player.getX();
|
||||||
act(Gdx.graphics.getDeltaTime()); //act the Hud
|
act(Gdx.graphics.getDeltaTime()); //act the Hud
|
||||||
@@ -248,22 +249,26 @@ public class GameHUD extends Stage {
|
|||||||
//colored lifepoints
|
//colored lifepoints
|
||||||
if (Current.player().getLife() >= Current.player().getMaxLife()) {
|
if (Current.player().getLife() >= Current.player().getMaxLife()) {
|
||||||
//color green if max life
|
//color green if max life
|
||||||
if (!lifepointsTextColor.equalsIgnoreCase("green")) {
|
if (!lifepointsTextColor.equals("[GREEN]")) {
|
||||||
lifePoints.setText("[%95][+Life] [GREEN]" + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife());
|
lifepointsTextColor = "[GREEN]";
|
||||||
lifepointsTextColor = "green";
|
updatelife = true;
|
||||||
}
|
}
|
||||||
} else if (Current.player().getLife() <= 5) {
|
} else if (Current.player().getLife() <= 5) {
|
||||||
//color red if critical
|
//color red if critical
|
||||||
if (!lifepointsTextColor.equalsIgnoreCase("red")) {
|
if (!lifepointsTextColor.equals("[RED]")) {
|
||||||
lifePoints.setText("[%95][+Life] [RED]" + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife());
|
lifepointsTextColor = "[RED]";
|
||||||
lifepointsTextColor = "red";
|
updatelife = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!lifepointsTextColor.equals("")) {
|
if (!lifepointsTextColor.equals("")) {
|
||||||
lifePoints.setText("[%95][+Life] " + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife());
|
|
||||||
lifepointsTextColor = "";
|
lifepointsTextColor = "";
|
||||||
|
updatelife = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (updatelife) {
|
||||||
|
updatelife = false;
|
||||||
|
lifePoints.setText("[%95][+Life]" + lifepointsTextColor + " " + AdventurePlayer.current().getLife() + "/" + AdventurePlayer.current().getMaxLife());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture miniMapTexture;
|
Texture miniMapTexture;
|
||||||
|
|||||||
@@ -38,8 +38,12 @@ import forge.adventure.pointofintrest.PointOfInterestChanges;
|
|||||||
import forge.adventure.scene.*;
|
import forge.adventure.scene.*;
|
||||||
import forge.adventure.util.*;
|
import forge.adventure.util.*;
|
||||||
import forge.adventure.world.WorldSave;
|
import forge.adventure.world.WorldSave;
|
||||||
|
import forge.assets.FImageComplex;
|
||||||
|
import forge.assets.FSkin;
|
||||||
|
import forge.card.CardRenderer;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.deck.DeckProxy;
|
import forge.deck.DeckProxy;
|
||||||
|
import forge.game.GameType;
|
||||||
import forge.gui.FThreads;
|
import forge.gui.FThreads;
|
||||||
import forge.screens.TransitionScreen;
|
import forge.screens.TransitionScreen;
|
||||||
import forge.sound.SoundEffectType;
|
import forge.sound.SoundEffectType;
|
||||||
@@ -212,7 +216,7 @@ public class MapStage extends GameStage {
|
|||||||
super.clicked(event, x, y);
|
super.clicked(event, x, y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog.getButtonTable().add(ok).width(250f);
|
dialog.getButtonTable().add(ok).width(240f);
|
||||||
dialog.getContentTable().add(L).width(250f);
|
dialog.getContentTable().add(L).width(250f);
|
||||||
dialog.setKeepWithinStage(true);
|
dialog.setKeepWithinStage(true);
|
||||||
showDialog();
|
showDialog();
|
||||||
@@ -234,7 +238,7 @@ public class MapStage extends GameStage {
|
|||||||
L.setWrap(true);
|
L.setWrap(true);
|
||||||
L.skipToTheEnd();
|
L.skipToTheEnd();
|
||||||
dialog.getContentTable().add(L).width(250f);
|
dialog.getContentTable().add(L).width(250f);
|
||||||
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog)).width(250f);
|
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog)).width(240f);
|
||||||
dialog.setKeepWithinStage(true);
|
dialog.setKeepWithinStage(true);
|
||||||
setDialogStage(GameHUD.getInstance());
|
setDialogStage(GameHUD.getInstance());
|
||||||
showDialog();
|
showDialog();
|
||||||
@@ -244,14 +248,40 @@ public class MapStage extends GameStage {
|
|||||||
dialog.getContentTable().clear();
|
dialog.getContentTable().clear();
|
||||||
dialog.getButtonTable().clear();
|
dialog.getButtonTable().clear();
|
||||||
dialog.clearListeners();
|
dialog.clearListeners();
|
||||||
dialog.getContentTable().add(Controls.newTypingLabel("[%150]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck)))).align(Align.center);
|
DeckProxy dp = new DeckProxy(deck, "Constructed", GameType.Constructed, null);
|
||||||
dialog.getContentTable().add().row();
|
FImageComplex cardArt = CardRenderer.getCardArt(dp.getHighestCMCCard());
|
||||||
|
if (cardArt != null) {
|
||||||
|
Image art = new Image(cardArt.getTextureRegion());
|
||||||
|
art.setWidth(50);
|
||||||
|
art.setHeight(40);
|
||||||
|
art.setPosition(10, 43);
|
||||||
|
Image image = new Image(FSkin.getDeckbox().get(1));
|
||||||
|
image.setWidth(70);
|
||||||
|
image.setHeight(100);
|
||||||
|
image.setPosition(0, 15);
|
||||||
|
TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck))+"\n[%]"+deck.getName());
|
||||||
|
label.skipToTheEnd();
|
||||||
|
label.setAlignment(Align.center);
|
||||||
|
label.setPosition(34, 20);
|
||||||
|
Group group = new Group();
|
||||||
|
group.addActor(art);
|
||||||
|
group.addActor(image);
|
||||||
|
group.addActor(label);
|
||||||
|
dialog.getContentTable().add(group).height(100).width(65).center();
|
||||||
|
dialog.getContentTable().add().row();
|
||||||
|
} else {
|
||||||
|
TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck))+"\n[%]"+deck.getName());
|
||||||
|
label.skipToTheEnd();
|
||||||
|
label.setAlignment(Align.center);
|
||||||
|
dialog.getContentTable().add(label).align(Align.center);
|
||||||
|
dialog.getContentTable().add().row();
|
||||||
|
}
|
||||||
|
|
||||||
TypingLabel L = Controls.newTypingLabel(message);
|
TypingLabel L = Controls.newTypingLabel(message);
|
||||||
L.setWrap(true);
|
L.setWrap(true);
|
||||||
L.skipToTheEnd();
|
L.skipToTheEnd();
|
||||||
|
|
||||||
dialog.getContentTable().add(L).width(240);
|
dialog.getContentTable().add(L).width(250);
|
||||||
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog)).width(240);
|
dialog.getButtonTable().add(Controls.newTextButton("OK", this::hideDialog)).width(240);
|
||||||
dialog.setKeepWithinStage(true);
|
dialog.setKeepWithinStage(true);
|
||||||
setDialogStage(GameHUD.getInstance());
|
setDialogStage(GameHUD.getInstance());
|
||||||
|
|||||||
@@ -258,14 +258,13 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
|||||||
//spriteGroup.setCullingArea(new Rectangle(player.getX()-getViewport().getWorldHeight()/2,player.getY()-getViewport().getWorldHeight()/2,getViewport().getWorldHeight(),getViewport().getWorldHeight()));
|
//spriteGroup.setCullingArea(new Rectangle(player.getX()-getViewport().getWorldHeight()/2,player.getY()-getViewport().getWorldHeight()/2,getViewport().getWorldHeight(),getViewport().getWorldHeight()));
|
||||||
super.draw();
|
super.draw();
|
||||||
if (WorldSave.getCurrentSave().getPlayer().hasAnnounceFantasy()) {
|
if (WorldSave.getCurrentSave().getPlayer().hasAnnounceFantasy()) {
|
||||||
MapStage.getInstance().showDeckAwardDialog("{BLINK=WHITE;RED}Chaos Mode!{ENDBLINK}\n" + WorldSave.getCurrentSave().getPlayer().getName() + "'s Deck: " +
|
MapStage.getInstance().showDeckAwardDialog("{BLINK=WHITE;RED}Chaos Mode!{ENDBLINK}\n" +
|
||||||
WorldSave.getCurrentSave().getPlayer().getSelectedDeck().getName() +
|
"Enemy will use Preconstructed or Random Generated Decks. Genetic AI Decks will be available to some enemies on Hard difficulty.",
|
||||||
"\nEnemy 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().getSelectedDeck());
|
||||||
WorldSave.getCurrentSave().getPlayer().clearAnnounceFantasy();
|
WorldSave.getCurrentSave().getPlayer().clearAnnounceFantasy();
|
||||||
} else if (WorldSave.getCurrentSave().getPlayer().hasAnnounceCustom()) {
|
} else if (WorldSave.getCurrentSave().getPlayer().hasAnnounceCustom()) {
|
||||||
MapStage.getInstance().showDeckAwardDialog("{GRADIENT}Custom Deck Mode!{ENDGRADIENT}\n" + WorldSave.getCurrentSave().getPlayer().getName() + "'s Deck: " +
|
MapStage.getInstance().showDeckAwardDialog("{GRADIENT}Custom Deck Mode!{ENDGRADIENT}\n" +
|
||||||
WorldSave.getCurrentSave().getPlayer().getSelectedDeck().getName() +
|
"Some enemies will use Genetic AI Decks randomly.", WorldSave.getCurrentSave().getPlayer().getSelectedDeck());
|
||||||
"\nSome enemies will use Genetic AI Decks randomly.", WorldSave.getCurrentSave().getPlayer().getSelectedDeck());
|
|
||||||
WorldSave.getCurrentSave().getPlayer().clearAnnounceCustom();
|
WorldSave.getCurrentSave().getPlayer().clearAnnounceCustom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class MapDialog {
|
|||||||
private final MapStage stage;
|
private final MapStage stage;
|
||||||
private Array<DialogData> data;
|
private Array<DialogData> data;
|
||||||
private final int parentID;
|
private final int parentID;
|
||||||
private final static float WIDTH = 260f;
|
private final static float WIDTH = 250f;
|
||||||
static private final String defaultJSON = "[\n" +
|
static private final String defaultJSON = "[\n" +
|
||||||
" {\n" +
|
" {\n" +
|
||||||
" \"effect\":[],\n" +
|
" \"effect\":[],\n" +
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
"font": "default",
|
"font": "default",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 419,
|
"x": 425,
|
||||||
"y": 56
|
"y": 56
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -70,8 +70,8 @@
|
|||||||
"font": "default",
|
"font": "default",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 419,
|
"x": 425,
|
||||||
"y": 73
|
"y": 70
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Label",
|
"type": "Label",
|
||||||
@@ -79,8 +79,8 @@
|
|||||||
"font": "default",
|
"font": "default",
|
||||||
"width": 64,
|
"width": 64,
|
||||||
"height": 16,
|
"height": 16,
|
||||||
"x": 419,
|
"x": 425,
|
||||||
"y": 90
|
"y": 84
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "TextButton",
|
"type": "TextButton",
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
"name": "lifePoints",
|
"name": "lifePoints",
|
||||||
"width": 48,
|
"width": 48,
|
||||||
"height": 3,
|
"height": 3,
|
||||||
"x": 209,
|
"x": 215,
|
||||||
"y": 62
|
"y": 62
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
"font": "default",
|
"font": "default",
|
||||||
"width": 48,
|
"width": 48,
|
||||||
"height": 3,
|
"height": 3,
|
||||||
"x": 209,
|
"x": 215,
|
||||||
"y": 76
|
"y": 76
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
"font": "default",
|
"font": "default",
|
||||||
"width": 48,
|
"width": 48,
|
||||||
"height": 3,
|
"height": 3,
|
||||||
"x": 209,
|
"x": 215,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user