fix minimap generation, update textrafont property

This commit is contained in:
Anthony Calosa
2023-04-08 08:08:32 +08:00
parent c6cc9c60fc
commit daa46e969d
3 changed files with 11 additions and 6 deletions

View File

@@ -37,8 +37,8 @@ import java.util.function.Function;
*/ */
public class Controls { public class Controls {
static class LabelFix extends TextraLabel { static class LabelFix extends TextraLabel {
public LabelFix(String text) { public LabelFix(String text, Font font) {
super(text, getSkin(), getTextraFont()); super(text, getSkin(), font);
} }
@Override @Override
@@ -356,11 +356,15 @@ public class Controls {
return Color.BLACK; return Color.BLACK;
} }
public static TextraLabel newTextraLabel(String name) { public static TextraLabel newTextraLabel(String name, Font font) {
TextraLabel ret = new LabelFix(name); TextraLabel ret = new LabelFix(name, font);
return ret; return ret;
} }
public static TextraLabel newTextraLabel(String name) {
return newTextraLabel(name, getTextraFont());
}
public static String colorIdToTypingString(ColorSet color) { public static String colorIdToTypingString(ColorSet color) {
return colorIdToTypingString(color, false); return colorIdToTypingString(color, false);
} }

View File

@@ -510,6 +510,7 @@ public class World implements Disposable, SaveFileContent {
notTowns.clear(); notTowns.clear();
otherPoints.clear(); otherPoints.clear();
clearTerrain((int) (data.width * data.playerStartPosX), (int) (data.height * data.playerStartPosY), 10); clearTerrain((int) (data.width * data.playerStartPosX), (int) (data.height * data.playerStartPosY), 10);
storedInfo.clear();
continue here; continue here;
} }
continue; continue;

View File

@@ -348,7 +348,7 @@ public class Assets implements Disposable {
if (textrafonts == null) if (textrafonts == null)
textrafonts = new ObjectMap<>(); textrafonts = new ObjectMap<>();
if (!textrafonts.containsKey("textrafont")) { if (!textrafonts.containsKey("textrafont")) {
Font font = new Font(bitmapFont, 0f, 2f, 0f, 0f); Font font = new Font(bitmapFont, 0f, 2f, 0f, 1f);
font.addAtlas(item_atlas, 0f, 6f, 0f); 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 //problematic atlas since some buttons are small, and this is too big for some buttons, need a way to enable
//this via property //this via property
@@ -375,7 +375,7 @@ public class Assets implements Disposable {
if (textrafonts == null) if (textrafonts == null)
textrafonts = new ObjectMap<>(); textrafonts = new ObjectMap<>();
if (!textrafonts.containsKey(name)) { if (!textrafonts.containsKey(name)) {
Font font = new Font(bitmapFont); Font font = new Font(bitmapFont, 0f, 2f, 0f, 1f);
font.addAtlas(items_atlas, 0f, 6f, 0f); font.addAtlas(items_atlas, 0f, 6f, 0f);
font.integerPosition = false; font.integerPosition = false;
textrafonts.put(name, font); textrafonts.put(name, font);