mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
revert TextraTypist
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.tommyettinger</groupId>
|
||||
<artifactId>textratypist</artifactId>
|
||||
<version>2.0.3</version>
|
||||
<version>0.8.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.badlogicgames.gdx</groupId>
|
||||
|
||||
@@ -32,25 +32,17 @@ import java.util.function.Function;
|
||||
*/
|
||||
public class Controls {
|
||||
|
||||
static public Styles.LabelStyle getLabelStyle() {
|
||||
return getLabelStyle("default");
|
||||
static public Label.LabelStyle getLabelStyle(String name) {
|
||||
return getSkin().get(name, Label.LabelStyle.class);
|
||||
}
|
||||
|
||||
static public Styles.LabelStyle getLabelStyle(String name) {
|
||||
return new Styles.LabelStyle(getSkin().get(name, Label.LabelStyle.class));
|
||||
}
|
||||
|
||||
static public Styles.TextButtonStyle getTextButtonStyle() {
|
||||
return getTextButtonStyle("default");
|
||||
}
|
||||
|
||||
static public Styles.TextButtonStyle getTextButtonStyle(String name) {
|
||||
return new Styles.TextButtonStyle(getSkin().get(name, TextButton.TextButtonStyle.class));
|
||||
static public TextButton.TextButtonStyle getTextButtonStyle(String name) {
|
||||
return getSkin().get(name, TextButton.TextButtonStyle.class);
|
||||
}
|
||||
|
||||
static class LabelFix extends TextraLabel {
|
||||
public LabelFix(String text, Font font) {
|
||||
super(text, getLabelStyle(), font);
|
||||
super(text, getSkin(), font);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,7 +63,7 @@ public class Controls {
|
||||
|
||||
static class TextButtonFix extends TextraButton {
|
||||
public TextButtonFix(@Null String text) {
|
||||
super(text == null ? "NULL" : text, getTextButtonStyle(), getTextraFont());
|
||||
super(text == null ? "NULL" : text, Controls.getSkin(), Controls.getTextraFont());
|
||||
addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
@@ -106,7 +98,7 @@ public class Controls {
|
||||
|
||||
static class TypingButtonFix extends TypingButton {
|
||||
public TypingButtonFix(@Null String text) {
|
||||
super(text == null ? "NULL" : text, getTextButtonStyle(), getTextraFont());
|
||||
super(text == null ? "NULL" : text, Controls.getSkin(), Controls.getTextraFont());
|
||||
addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
@@ -474,22 +466,22 @@ public class Controls {
|
||||
String nextline = vertical ? "\n" : "";
|
||||
String colorId = "";
|
||||
if (color.hasWhite())
|
||||
colorId += "[+pmW]"+nextline;
|
||||
colorId += "[+W]"+nextline;
|
||||
if (color.hasBlue())
|
||||
colorId += "[+pmU]"+nextline;
|
||||
colorId += "[+U]"+nextline;
|
||||
if (color.hasBlack())
|
||||
colorId += "[+pmB]"+nextline;
|
||||
colorId += "[+B]"+nextline;
|
||||
if (color.hasRed())
|
||||
colorId += "[+pmR]"+nextline;
|
||||
colorId += "[+R]"+nextline;
|
||||
if (color.hasGreen())
|
||||
colorId += "[+pmG]"+nextline;
|
||||
colorId += "[+G]"+nextline;
|
||||
if (color.isColorless())
|
||||
colorId += "[+pmC]"+nextline;
|
||||
colorId += "[+C]"+nextline;
|
||||
return colorId;
|
||||
}
|
||||
|
||||
public static TypingLabel newTypingLabel(String name) {
|
||||
TypingLabel ret = new TypingLabel(name == null ? "" : name, getLabelStyle(), getTextraFont());
|
||||
TypingLabel ret = new TypingLabel(name == null ? "" : name, getSkin(), getTextraFont());
|
||||
String pn = Current.player().getName();
|
||||
if (pn != null) // this variable is used for dialogs
|
||||
ret.setVariable("player_name", pn);
|
||||
|
||||
@@ -336,9 +336,11 @@ public class Assets implements Disposable {
|
||||
if (textrafonts == null)
|
||||
textrafonts = new ObjectMap<>();
|
||||
if (!textrafonts.containsKey("textrafont")) {
|
||||
Font font = new Font(bitmapFont);
|
||||
font.addAtlas(item_atlas);
|
||||
font.addAtlas(pixelmana_atlas);
|
||||
Font font = new Font(bitmapFont, 0f, 2f, 0f, 1f);
|
||||
font.addAtlas(item_atlas, 0f, 6f, 0f);
|
||||
//problematic atlas since some buttons are small, and this is too big for some buttons, need a way to enable
|
||||
//this via property
|
||||
//font.addAtlas(pixelmana_atlas, -90f, 20f, 0f);
|
||||
font.integerPosition = false;
|
||||
textrafonts.put("textrafont", font);
|
||||
}
|
||||
@@ -350,7 +352,7 @@ public class Assets implements Disposable {
|
||||
textrafonts = new ObjectMap<>();
|
||||
if (!textrafonts.containsKey("keysfont")) {
|
||||
Font font = new Font(bitmapFont);
|
||||
font.addAtlas(keys_atlas);
|
||||
font.addAtlas(keys_atlas, 0f, 6f, 0f);
|
||||
font.integerPosition = false;
|
||||
textrafonts.put("keysfont", font);
|
||||
}
|
||||
@@ -361,8 +363,8 @@ public class Assets implements Disposable {
|
||||
if (textrafonts == null)
|
||||
textrafonts = new ObjectMap<>();
|
||||
if (!textrafonts.containsKey(name)) {
|
||||
Font font = new Font(bitmapFont);
|
||||
font.addAtlas(items_atlas);
|
||||
Font font = new Font(bitmapFont, 0f, 2f, 0f, 1f);
|
||||
font.addAtlas(items_atlas, 0f, 6f, 0f);
|
||||
font.integerPosition = false;
|
||||
textrafonts.put(name, font);
|
||||
}
|
||||
@@ -373,7 +375,7 @@ public class Assets implements Disposable {
|
||||
if (textrafonts == null)
|
||||
textrafonts = new ObjectMap<>();
|
||||
if (!textrafonts.containsKey("GenericHeaderFont")) {
|
||||
Font font = new Font(bitmapFont);
|
||||
Font font = new Font(bitmapFont, 0f, -0.5f, 0f, -2.5f);
|
||||
font.integerPosition = false;
|
||||
textrafonts.put("GenericHeaderFont", font);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"playerBaseSpeed": 32,
|
||||
"minDeckSize": 40,
|
||||
"colorIds":["W","U","B","R","G"],
|
||||
"colorIdNames":["tr(lblWhite) [+pmW]","tr(lblBlue) [+pmU]","tr(lblBlack) [+pmB]","tr(lblRed) [+pmR]","tr(lblGreen) [+pmG]"],
|
||||
"colorIdNames":["tr(lblWhite) [+W]","tr(lblBlue) [+U]","tr(lblBlack) [+B]","tr(lblRed) [+R]","tr(lblGreen) [+G]"],
|
||||
"restrictedCards": [
|
||||
"Black Lotus",
|
||||
"Mox Emerald",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"playerBaseSpeed": 32,
|
||||
"minDeckSize": 40,
|
||||
"colorIds":["W","U","B","R","G"],
|
||||
"colorIdNames":["tr(lblWhite) [+pmW]","tr(lblBlue) [+pmU]","tr(lblBlack) [+pmB]","tr(lblRed) [+pmR]","tr(lblGreen) [+pmG]"],
|
||||
"colorIdNames":["tr(lblWhite) [+W]","tr(lblBlue) [+U]","tr(lblBlack) [+B]","tr(lblRed) [+R]","tr(lblGreen) [+G]"],
|
||||
"restrictedCards": [
|
||||
"Black Lotus",
|
||||
"Mox Emerald",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"playerBaseSpeed": 45,
|
||||
"minDeckSize": 40,
|
||||
"colorIds":["W","U","B","R","G"],
|
||||
"colorIdNames":["tr(lblWhite) [+pmW]","tr(lblBlue) [+pmU]","tr(lblBlack) [+pmB]","tr(lblRed) [+pmR]","tr(lblGreen) [+pmG]"],
|
||||
"colorIdNames":["tr(lblWhite) [+W]","tr(lblBlue) [+U]","tr(lblBlack) [+B]","tr(lblRed) [+R]","tr(lblGreen) [+G]"],
|
||||
"restrictedCards": [
|
||||
"Black Lotus",
|
||||
"Mox Emerald",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"playerBaseSpeed": 32,
|
||||
"minDeckSize": 40,
|
||||
"colorIds":["W","U","B","R","G"],
|
||||
"colorIdNames":["tr(lblWhite) [+pmW]","tr(lblBlue) [+pmU]","tr(lblBlack) [+pmB]","tr(lblRed) [+pmR]","tr(lblGreen) [+pmG]"],
|
||||
"colorIdNames":["tr(lblWhite) [+W]","tr(lblBlue) [+U]","tr(lblBlack) [+B]","tr(lblRed) [+R]","tr(lblGreen) [+G]"],
|
||||
"restrictedCards": [
|
||||
"Black Lotus",
|
||||
"Mox Emerald",
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BBlack",
|
||||
"text": "[+pmB]",
|
||||
"text": "[+B]",
|
||||
"x": 15,
|
||||
"y": 120,
|
||||
"width": 45,
|
||||
@@ -84,7 +84,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BBlue",
|
||||
"text": "[+pmU]",
|
||||
"text": "[+U]",
|
||||
"x": 65,
|
||||
"y": 120,
|
||||
"width": 45,
|
||||
@@ -94,7 +94,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BGreen",
|
||||
"text": "[+pmG]",
|
||||
"text": "[+G]",
|
||||
"x": 115,
|
||||
"y": 120,
|
||||
"width": 45,
|
||||
@@ -104,7 +104,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BRed",
|
||||
"text": "[+pmR]",
|
||||
"text": "[+R]",
|
||||
"x": 165,
|
||||
"y": 120,
|
||||
"width": 45,
|
||||
@@ -114,7 +114,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BWhite",
|
||||
"text": "[+pmW]",
|
||||
"text": "[+W]",
|
||||
"x": 215,
|
||||
"y": 120,
|
||||
"width": 45,
|
||||
@@ -124,7 +124,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BColorless",
|
||||
"text": "[+pmC]",
|
||||
"text": "[+C]",
|
||||
"x": 265,
|
||||
"y": 120,
|
||||
"width": 45,
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BBlack",
|
||||
"text": "[+pmB]",
|
||||
"text": "[+B]",
|
||||
"x": 58,
|
||||
"y": 290,
|
||||
"width": 45,
|
||||
@@ -83,7 +83,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BBlue",
|
||||
"text": "[+pmU]",
|
||||
"text": "[+U]",
|
||||
"x": 113,
|
||||
"y": 290,
|
||||
"width": 45,
|
||||
@@ -93,7 +93,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BGreen",
|
||||
"text": "[+pmG]",
|
||||
"text": "[+G]",
|
||||
"x": 168,
|
||||
"y": 290,
|
||||
"width": 45,
|
||||
@@ -103,7 +103,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BRed",
|
||||
"text": "[+pmR]",
|
||||
"text": "[+R]",
|
||||
"x": 58,
|
||||
"y": 320,
|
||||
"width": 45,
|
||||
@@ -113,7 +113,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BWhite",
|
||||
"text": "[+pmW]",
|
||||
"text": "[+W]",
|
||||
"x": 113,
|
||||
"y": 320,
|
||||
"width": 45,
|
||||
@@ -123,7 +123,7 @@
|
||||
"type": "TextButton",
|
||||
"selectable": true,
|
||||
"name": "BColorless",
|
||||
"text": "[+pmC]",
|
||||
"text": "[+C]",
|
||||
"x": 168,
|
||||
"y": 320,
|
||||
"width": 45,
|
||||
|
||||
Reference in New Issue
Block a user