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