From d044d0dc654613dae65449feb773b9945bdb3d6f Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 13 Jul 2025 17:12:00 +0800 Subject: [PATCH] revert TextraTypist --- forge-gui-mobile/pom.xml | 2 +- .../src/forge/adventure/util/Controls.java | 36 ++++++++----------- forge-gui-mobile/src/forge/assets/Assets.java | 16 +++++---- .../adventure/Crystal_Kingdoms/config.json | 2 +- forge-gui/res/adventure/Innistrad/config.json | 2 +- .../Shandalar Old Border/config.json | 2 +- forge-gui/res/adventure/common/config.json | 2 +- .../res/adventure/common/ui/spellsmith.json | 12 +++---- .../common/ui/spellsmith_portrait.json | 12 +++---- 9 files changed, 40 insertions(+), 46 deletions(-) diff --git a/forge-gui-mobile/pom.xml b/forge-gui-mobile/pom.xml index 978126d909a..d578aab4403 100644 --- a/forge-gui-mobile/pom.xml +++ b/forge-gui-mobile/pom.xml @@ -53,7 +53,7 @@ com.github.tommyettinger textratypist - 2.0.3 + 0.8.2 com.badlogicgames.gdx diff --git a/forge-gui-mobile/src/forge/adventure/util/Controls.java b/forge-gui-mobile/src/forge/adventure/util/Controls.java index 87b6d604742..5cf69d32f29 100644 --- a/forge-gui-mobile/src/forge/adventure/util/Controls.java +++ b/forge-gui-mobile/src/forge/adventure/util/Controls.java @@ -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); diff --git a/forge-gui-mobile/src/forge/assets/Assets.java b/forge-gui-mobile/src/forge/assets/Assets.java index 0cadda7700e..680c025846c 100644 --- a/forge-gui-mobile/src/forge/assets/Assets.java +++ b/forge-gui-mobile/src/forge/assets/Assets.java @@ -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); } diff --git a/forge-gui/res/adventure/Crystal_Kingdoms/config.json b/forge-gui/res/adventure/Crystal_Kingdoms/config.json index bd1e8250781..f7e05276e6b 100644 --- a/forge-gui/res/adventure/Crystal_Kingdoms/config.json +++ b/forge-gui/res/adventure/Crystal_Kingdoms/config.json @@ -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", diff --git a/forge-gui/res/adventure/Innistrad/config.json b/forge-gui/res/adventure/Innistrad/config.json index c246c252ba6..57fde877508 100644 --- a/forge-gui/res/adventure/Innistrad/config.json +++ b/forge-gui/res/adventure/Innistrad/config.json @@ -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", diff --git a/forge-gui/res/adventure/Shandalar Old Border/config.json b/forge-gui/res/adventure/Shandalar Old Border/config.json index 190ce0196c7..2514d3e5244 100644 --- a/forge-gui/res/adventure/Shandalar Old Border/config.json +++ b/forge-gui/res/adventure/Shandalar Old Border/config.json @@ -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", diff --git a/forge-gui/res/adventure/common/config.json b/forge-gui/res/adventure/common/config.json index 3780532485a..09f97b41f22 100644 --- a/forge-gui/res/adventure/common/config.json +++ b/forge-gui/res/adventure/common/config.json @@ -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", diff --git a/forge-gui/res/adventure/common/ui/spellsmith.json b/forge-gui/res/adventure/common/ui/spellsmith.json index 3601b739e31..dc1e9f19aa7 100644 --- a/forge-gui/res/adventure/common/ui/spellsmith.json +++ b/forge-gui/res/adventure/common/ui/spellsmith.json @@ -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, diff --git a/forge-gui/res/adventure/common/ui/spellsmith_portrait.json b/forge-gui/res/adventure/common/ui/spellsmith_portrait.json index d781b714cae..89d252edc75 100644 --- a/forge-gui/res/adventure/common/ui/spellsmith_portrait.json +++ b/forge-gui/res/adventure/common/ui/spellsmith_portrait.json @@ -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,