mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
fix deckaward alignment
This commit is contained in:
@@ -29,6 +29,7 @@ import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Scaling;
|
||||
import com.badlogic.gdx.utils.Timer;
|
||||
import com.github.tommyettinger.textra.TextraButton;
|
||||
import com.github.tommyettinger.textra.TextraLabel;
|
||||
import com.github.tommyettinger.textra.TypingAdapter;
|
||||
import com.github.tommyettinger.textra.TypingLabel;
|
||||
import forge.Forge;
|
||||
@@ -259,14 +260,20 @@ public class MapStage extends GameStage {
|
||||
image.setWidth(59);
|
||||
image.setHeight(80);
|
||||
image.setPosition(4, 7);
|
||||
TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck)).toUpperCase()+"\n[%]"+deck.getName());
|
||||
label.skipToTheEnd();
|
||||
label.setAlignment(Align.center);
|
||||
label.setPosition(34, 20);
|
||||
TypingLabel deckColors = Controls.newTypingLabel(Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck), true).toUpperCase());
|
||||
deckColors.skipToTheEnd();
|
||||
deckColors.setAlignment(Align.left);
|
||||
deckColors.setPosition(58, 60);
|
||||
TextraLabel deckname = Controls.newTextraLabel(deck.getName());
|
||||
deckname.setAlignment(Align.center);
|
||||
deckname.setWrap(true);
|
||||
deckname.setWidth(70);
|
||||
deckname.setPosition(0, 30);
|
||||
Group group = new Group();
|
||||
group.addActor(art);
|
||||
group.addActor(image);
|
||||
group.addActor(label);
|
||||
group.addActor(deckColors);
|
||||
group.addActor(deckname);
|
||||
dialog.getContentTable().add(group).height(100).width(65).center();
|
||||
dialog.getContentTable().add().row();
|
||||
} else {
|
||||
|
||||
@@ -362,20 +362,25 @@ public class Controls {
|
||||
}
|
||||
|
||||
public static String colorIdToTypingString(ColorSet color) {
|
||||
return colorIdToTypingString(color, false);
|
||||
}
|
||||
|
||||
public static String colorIdToTypingString(ColorSet color, boolean vertical) {
|
||||
String nextline = vertical ? "\n" : "";
|
||||
//NOTE converting to uppercase will use pixelmana.atlas, higher quality pixel mana symbol.
|
||||
String colorId = "";
|
||||
if (color.hasWhite())
|
||||
colorId += "[+w]";
|
||||
colorId += "[+w]"+nextline;
|
||||
if (color.hasBlue())
|
||||
colorId += "[+u]";
|
||||
colorId += "[+u]"+nextline;
|
||||
if (color.hasBlack())
|
||||
colorId += "[+b]";
|
||||
colorId += "[+b]"+nextline;
|
||||
if (color.hasRed())
|
||||
colorId += "[+r]";
|
||||
colorId += "[+r]"+nextline;
|
||||
if (color.hasGreen())
|
||||
colorId += "[+g]";
|
||||
colorId += "[+g]"+nextline;
|
||||
if (color.isColorless())
|
||||
colorId += "[+c]";
|
||||
colorId += "[+c]"+nextline;
|
||||
return colorId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user