Many things

This commit is contained in:
Anuken
2020-08-06 20:00:02 -04:00
parent ac3106728f
commit 176e4a3bb9
20 changed files with 370 additions and 167 deletions

View File

@@ -27,6 +27,7 @@ import mindustry.core.*;
import java.util.*;
public class Fonts{
private static final String mainFont = "fonts/font.woff";
private static ObjectIntMap<String> unicodeIcons = new ObjectIntMap<>();
private static ObjectMap<String, String> stringIcons = new ObjectMap<>();
@@ -58,12 +59,10 @@ public class Fonts{
}
public static void loadFonts(){
String fontName = "fonts/font.ttf";
FreeTypeFontParameter param = fontParameter();
Core.assets.load("default", Font.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> Fonts.def = (Font)f;
Core.assets.load("chat", Font.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> Fonts.chat = (Font)f;
Core.assets.load("default", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.def = (Font)f;
Core.assets.load("chat", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.chat = (Font)f;
Core.assets.load("icon", Font.class, new FreeTypeFontLoaderParameter("fonts/icon.ttf", new FreeTypeFontParameter(){{
size = 30;
incremental = true;
@@ -146,7 +145,7 @@ public class Fonts{
size = 18;
}};
Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter("fonts/font.ttf", param)).loaded = t -> Fonts.outline = (Font)t;
Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = (Font)t;
Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{
size = 18;

View File

@@ -23,11 +23,11 @@ public class GridImage extends Element{
int jumpy = (int)(Math.max(minspace, yspace) / yspace);
for(int x = 0; x <= imageWidth; x += jumpx){
Fill.crect((int)(getX() + xspace * x - s), getY() - s, 2, getHeight() + (x == imageWidth ? 1 : 0));
Fill.crect((int)(this.x + xspace * x - s), y - s, 2, getHeight() + (x == imageWidth ? 1 : 0));
}
for(int y = 0; y <= imageHeight; y += jumpy){
Fill.crect(getX() - s, (int)(getY() + y * yspace - s), getWidth(), 2);
Fill.crect(x - s, (int)(this.y + y * yspace - s), getWidth(), 2);
}
}

View File

@@ -451,7 +451,7 @@ public class ResearchDialog extends BaseDialog{
}
});
infoTable.update(() -> infoTable.setPosition(button.getX() + button.getWidth(), button.getY() + button.getHeight(), Align.topLeft));
infoTable.update(() -> infoTable.setPosition(button.x + button.getWidth(), button.y + button.getHeight(), Align.topLeft));
infoTable.left();
infoTable.background(Tex.button).margin(8f);

View File

@@ -124,7 +124,7 @@ public class ChatFragment extends Table{
Draw.color(shadowColor);
if(shown){
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
Fill.crect(offsetx, chatfield.y, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
}
super.draw();

View File

@@ -115,7 +115,7 @@ public class ScriptConsoleFragment extends Table{
Draw.color(shadowColor);
if(open){
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
Fill.crect(offsetx, chatfield.y, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
}
super.draw();