mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
forge-gui-mobile: fix symbolLookup init too early
This commit is contained in:
@@ -4,7 +4,6 @@ import java.text.BreakIterator;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
@@ -14,24 +13,11 @@ import forge.Graphics;
|
|||||||
import forge.card.CardFaceSymbols;
|
import forge.card.CardFaceSymbols;
|
||||||
import forge.localinstance.properties.ForgePreferences;
|
import forge.localinstance.properties.ForgePreferences;
|
||||||
import forge.localinstance.properties.ForgePreferences.FPref;
|
import forge.localinstance.properties.ForgePreferences.FPref;
|
||||||
import forge.localinstance.skin.FSkinProp;
|
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
import forge.util.TextBounds;
|
import forge.util.TextBounds;
|
||||||
|
|
||||||
//Encodes text for drawing with symbols and reminder text
|
//Encodes text for drawing with symbols and reminder text
|
||||||
public class TextRenderer {
|
public class TextRenderer {
|
||||||
static {
|
|
||||||
for (Map.Entry<String, FSkinProp> e : FSkinProp.MANA_IMG.entrySet()) {
|
|
||||||
Forge.getAssets().symbolLookup().put(e.getKey(), Forge.getAssets().images().get(e.getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Forge.getAssets().symbolLookup().put("E", FSkinImage.ENERGY);
|
|
||||||
Forge.getAssets().symbolLookup().put("TK", FSkinImage.TICKET);
|
|
||||||
Forge.getAssets().symbolLookup().put("AE", FSkinImage.AETHER_SHARD);
|
|
||||||
Forge.getAssets().symbolLookup().put("PW", FSkinImage.PW_BADGE_COMMON);
|
|
||||||
Forge.getAssets().symbolLookup().put("CR", FSkinImage.QUEST_COINSTACK);
|
|
||||||
Forge.getAssets().symbolLookup().put("M", FSkinImage.MANASHARD);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String startColor(Color color) {
|
public static String startColor(Color color) {
|
||||||
return "<clr " + Color.rgba8888(color) + ">";
|
return "<clr " + Color.rgba8888(color) + ">";
|
||||||
|
|||||||
@@ -129,6 +129,18 @@ public class CardFaceSymbols {
|
|||||||
Forge.getAssets().manaImages().put("protectU", FSkinImage.IMG_ABILITY_PROTECT_U);
|
Forge.getAssets().manaImages().put("protectU", FSkinImage.IMG_ABILITY_PROTECT_U);
|
||||||
Forge.getAssets().manaImages().put("protectUW", FSkinImage.IMG_ABILITY_PROTECT_UW);
|
Forge.getAssets().manaImages().put("protectUW", FSkinImage.IMG_ABILITY_PROTECT_UW);
|
||||||
Forge.getAssets().manaImages().put("protectW", FSkinImage.IMG_ABILITY_PROTECT_W);
|
Forge.getAssets().manaImages().put("protectW", FSkinImage.IMG_ABILITY_PROTECT_W);
|
||||||
|
|
||||||
|
// symbol lookup for text render
|
||||||
|
for (Map.Entry<String, FSkinProp> e : FSkinProp.MANA_IMG.entrySet()) {
|
||||||
|
Forge.getAssets().symbolLookup().put(e.getKey(), Forge.getAssets().images().get(e.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Forge.getAssets().symbolLookup().put("E", FSkinImage.ENERGY);
|
||||||
|
Forge.getAssets().symbolLookup().put("TK", FSkinImage.TICKET);
|
||||||
|
Forge.getAssets().symbolLookup().put("AE", FSkinImage.AETHER_SHARD);
|
||||||
|
Forge.getAssets().symbolLookup().put("PW", FSkinImage.PW_BADGE_COMMON);
|
||||||
|
Forge.getAssets().symbolLookup().put("CR", FSkinImage.QUEST_COINSTACK);
|
||||||
|
Forge.getAssets().symbolLookup().put("M", FSkinImage.MANASHARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drawManaCost(Graphics g, ManaCost manaCost, float x, float y, final float imageSize) {
|
public static void drawManaCost(Graphics g, ManaCost manaCost, float x, float y, final float imageSize) {
|
||||||
|
|||||||
Reference in New Issue
Block a user