Made all color names lowercase for consistent style

This commit is contained in:
Anuken
2019-09-09 16:22:29 -04:00
parent b867cdb8b9
commit 5a3fbf33df
73 changed files with 296 additions and 298 deletions

View File

@@ -77,7 +77,7 @@ public class Bar extends Element{
GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
lay.setText(font, name);
font.setColor(Color.WHITE);
font.setColor(Color.white);
font.draw(name, x + width / 2f - lay.width / 2f, y + height / 2f + lay.height / 2f + 1);
Pools.free(lay);

View File

@@ -3,7 +3,7 @@ package io.anuke.mindustry.ui;
import io.anuke.arc.graphics.*;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.scene.ui.Image;
import io.anuke.arc.scene.ui.layout.UnitScl;
import io.anuke.arc.scene.ui.layout.Scl;
import io.anuke.mindustry.graphics.Pal;
public class BorderImage extends Image{
@@ -42,7 +42,7 @@ public class BorderImage extends Image{
Draw.color(borderColor);
Draw.alpha(parentAlpha);
Lines.stroke(UnitScl.dp.scl(thickness));
Lines.stroke(Scl.scl(thickness));
Lines.rect(x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
Draw.reset();
}

View File

@@ -25,7 +25,7 @@ public class ContentDisplay{
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(8).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(8).padLeft(0).padRight(0).fillX();
table.row();
@@ -33,7 +33,7 @@ public class ContentDisplay{
table.add(block.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(8).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(8).padLeft(0).padRight(0).fillX();
table.row();
}
@@ -73,7 +73,7 @@ public class ContentDisplay{
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
@@ -81,7 +81,7 @@ public class ContentDisplay{
table.add(item.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
}
@@ -104,7 +104,7 @@ public class ContentDisplay{
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
@@ -112,7 +112,7 @@ public class ContentDisplay{
table.add(liquid.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
}
@@ -139,7 +139,7 @@ public class ContentDisplay{
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
@@ -147,7 +147,7 @@ public class ContentDisplay{
table.add(mech.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
}
@@ -186,7 +186,7 @@ public class ContentDisplay{
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
@@ -194,7 +194,7 @@ public class ContentDisplay{
table.add(unit.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
table.row();
}

View File

@@ -36,7 +36,7 @@ public class ItemsDisplay extends Table{
if(item.type == ItemType.material && data.isUnlocked(item)){
t.label(() -> format.format(items.get(item, 0))).left();
t.addImage(item.icon(Icon.medium)).size(8 * 3).padLeft(4).padRight(4);
t.add(item.localizedName()).color(Color.LIGHT_GRAY).left();
t.add(item.localizedName()).color(Color.lightGray).left();
t.row();
}
}

View File

@@ -30,7 +30,7 @@ public class LiquidDisplay extends Table{
}}).size(8 * 4).padRight(3 + (amount != 0 && Strings.autoFixed(amount, 1).length() > 2 ? 8 : 0));
if(perSecond){
add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.LIGHT_GRAY);
add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.lightGray);
}
add(liquid.localizedName());

View File

@@ -19,12 +19,12 @@ public class Minimap extends Table{
add(new Element(){
{
setSize(UnitScl.dp.scl(140f));
setSize(Scl.scl(140f));
}
@Override
public void act(float delta){
setPosition(UnitScl.dp.scl(margin), UnitScl.dp.scl(margin));
setPosition(Scl.scl(margin), Scl.scl(margin));
super.act(delta);
}
@@ -53,7 +53,7 @@ public class Minimap extends Table{
addListener(new ClickListener(){
{
tapSquareSize = UnitScl.dp.scl(11f);
tapSquareSize = Scl.scl(11f);
}
@Override

View File

@@ -5,7 +5,7 @@ import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.scene.Element;
import io.anuke.arc.scene.ui.Image;
import io.anuke.arc.scene.ui.layout.Stack;
import io.anuke.arc.scene.ui.layout.UnitScl;
import io.anuke.arc.scene.ui.layout.Scl;
import io.anuke.mindustry.graphics.Pal;
public class ReqImage extends Stack{
@@ -21,7 +21,7 @@ public class ReqImage extends Stack{
@Override
public void draw(){
Lines.stroke(UnitScl.dp.scl(2f), Pal.removeBack);
Lines.stroke(Scl.scl(2f), Pal.removeBack);
Lines.line(x, y - 2f + height, x + width, y - 2f);
Draw.color(Pal.remove);
Lines.line(x, y + height, x + width, y);

View File

@@ -51,15 +51,15 @@ public class Styles{
over = buttonOver;
disabled = buttonDisabled;
font = Fonts.def;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
down = buttonDown;
up = button;
}},
squaret = new TextButtonStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
over = buttonSquareOver;
disabled = buttonDisabled;
down = buttonSquareDown;
@@ -68,27 +68,27 @@ public class Styles{
nodet = new TextButtonStyle(){{
disabled = button;
font = Fonts.def;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
up = buttonOver;
over = buttonDown;
}},
cleart = new TextButtonStyle(){{
over = flatOver;
font = Fonts.def;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
down = flatOver;
up = black;
}},
discordt = new TextButtonStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
fontColor = Color.white;
up = discordBanner;
}},
infot = new TextButtonStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
fontColor = Color.white;
up = infoBanner;
}},
clearPartialt = new TextButtonStyle(){{
@@ -96,38 +96,38 @@ public class Styles{
up = pane;
over = flatDown;
font = Fonts.def;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
}},
clearTogglet = new TextButtonStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
fontColor = Color.white;
checked = flatDown;
down = flatDown;
up = black;
over = flatOver;
disabled = black;
disabledFontColor = Color.GRAY;
disabledFontColor = Color.gray;
}},
clearToggleMenut = new TextButtonStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
fontColor = Color.white;
checked = flatDown;
down = flatDown;
up = clear;
over = flatOver;
disabled = black;
disabledFontColor = Color.GRAY;
disabledFontColor = Color.gray;
}},
togglet = new TextButtonStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
fontColor = Color.white;
checked = buttonDown;
down = buttonDown;
up = button;
over = buttonOver;
disabled = buttonDisabled;
disabledFontColor = Color.GRAY;
disabledFontColor = Color.gray;
}};
public static ImageButtonStyle
@@ -135,8 +135,8 @@ public class Styles{
down = buttonDown;
up = button;
over = buttonOver;
imageDisabledColor = Color.GRAY;
imageUpColor = Color.WHITE;
imageDisabledColor = Color.gray;
imageUpColor = Color.white;
disabled = buttonDisabled;
}},
nodei = new ImageButtonStyle(){{
@@ -150,12 +150,12 @@ public class Styles{
}},
emptyi = new ImageButtonStyle(){{
imageDownColor = Pal.accent;
imageUpColor = Color.WHITE;
imageUpColor = Color.white;
}},
emptytogglei = new ImageButtonStyle(){{
imageCheckedColor = Color.WHITE;
imageDownColor = Color.WHITE;
imageUpColor = Color.GRAY;
imageCheckedColor = Color.white;
imageDownColor = Color.white;
imageUpColor = Color.gray;
}},
selecti = new ImageButtonStyle(){{
checked = buttonSelect;
@@ -215,8 +215,8 @@ public class Styles{
public static KeybindDialogStyle
defaultKeybindDialog = new KeybindDialogStyle(){{
keyColor = Pal.accent;
keyNameColor = Color.WHITE;
controllerColor = Color.LIGHT_GRAY;
keyNameColor = Color.white;
controllerColor = Color.lightGray;
}};
public static SliderStyle
@@ -236,35 +236,35 @@ public class Styles{
public static LabelStyle
defaultLabel = new LabelStyle(){{
font = Fonts.def;
fontColor = Color.WHITE;
fontColor = Color.white;
}},
outlineLabel = new LabelStyle(){{
font = Fonts.outline;
fontColor = Color.WHITE;
fontColor = Color.white;
}};
public static TextFieldStyle
defaultField = new TextFieldStyle(){{
font = Fonts.chat;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
disabledBackground = underlineDisabled;
selection = Tex.selection;
background = underline;
invalidBackground = underlineRed;
cursor = Tex.cursor;
messageFont = Fonts.def;
messageFontColor = Color.GRAY;
messageFontColor = Color.gray;
}},
areaField = new TextFieldStyle(){{
font = Fonts.chat;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
selection = Tex.selection;
background = underline;
cursor = Tex.cursor;
messageFont = Fonts.def;
messageFontColor = Color.GRAY;
messageFontColor = Color.gray;
}};
public static CheckBoxStyle
defaultCheck = new CheckBoxStyle(){{
@@ -275,8 +275,8 @@ public class Styles{
checkboxOnDisabled = checkOnDisabled;
checkboxOffDisabled = checkDisabled;
font = Fonts.def;
fontColor = Color.WHITE;
disabledFontColor = Color.GRAY;
fontColor = Color.white;
disabledFontColor = Color.gray;
}};
public static DialogStyle
defaultDialog = new DialogStyle(){{

View File

@@ -64,7 +64,7 @@ public class AboutDialog extends FloatingDialog{
table.table(inset -> {
inset.add("[accent]" + Strings.capitalize(link.name.replace("-", " "))).growX().left();
inset.row();
inset.labelWrap(link.description).width(w - 100f).color(Color.LIGHT_GRAY).growX();
inset.labelWrap(link.description).width(w - 100f).color(Color.lightGray).growX();
}).padLeft(8);
table.addImageButton(Icon.link, () -> {

View File

@@ -37,7 +37,7 @@ public class CustomGameDialog extends FloatingDialog{
ScrollPane pane = new ScrollPane(maps);
pane.setFadeScrollBars(false);
int maxwidth = Mathf.clamp((int)(Core.graphics.getWidth() / UnitScl.dp.scl(200)), 1, 8);
int maxwidth = Mathf.clamp((int)(Core.graphics.getWidth() / Scl.scl(200)), 1, 8);
float images = 146f;
int i = 0;

View File

@@ -101,7 +101,7 @@ public class CustomRulesDialog extends FloatingDialog{
main.table(t -> {
t.left();
t.add(text).left().padRight(5)
.update(a -> a.setColor(condition.get() ? Color.WHITE : Color.GRAY));
.update(a -> a.setColor(condition.get() ? Color.white : Color.gray));
Vars.platform.addDialog(t.addField((integer ? (int)prov.get() : prov.get()) + "", s -> cons.accept(Strings.parseFloat(s)))
.padRight(100f)
.update(a -> a.setDisabled(!condition.get()))

View File

@@ -62,7 +62,7 @@ public class DatabaseDialog extends FloatingDialog{
image.addListener(listener);
if(!Vars.mobile && unlocked(unlock)){
image.addListener(new HandCursorListener());
image.update(() -> image.getColor().lerp(!listener.isOver() ? Color.LIGHT_GRAY : Color.WHITE, 0.4f * Time.delta()));
image.update(() -> image.getColor().lerp(!listener.isOver() ? Color.lightGray : Color.white, 0.4f * Time.delta()));
}
if(unlocked(unlock)){

View File

@@ -29,7 +29,7 @@ import io.anuke.mindustry.ui.TreeLayout.*;
import static io.anuke.mindustry.Vars.*;
public class DeployDialog extends FloatingDialog{
private final float nodeSize = UnitScl.dp.scl(230f);
private final float nodeSize = Scl.scl(230f);
private ObjectSet<ZoneNode> nodes = new ObjectSet<>();
private ZoneInfoDialog info = new ZoneInfoDialog();
private Rectangle bounds = new Rectangle();
@@ -40,8 +40,8 @@ public class DeployDialog extends FloatingDialog{
ZoneNode root = new ZoneNode(Zones.groundZero, null);
TreeLayout layout = new TreeLayout();
layout.gapBetweenLevels = layout.gapBetweenNodes = UnitScl.dp.scl(60f);
layout.gapBetweenNodes = UnitScl.dp.scl(120f);
layout.gapBetweenLevels = layout.gapBetweenNodes = Scl.scl(60f);
layout.gapBetweenNodes = Scl.scl(120f);
layout.layout(root);
bounds.set(layout.getBounds());
bounds.y += nodeSize*0.4f;
@@ -99,7 +99,7 @@ public class DeployDialog extends FloatingDialog{
if(draw.getRegion() == slot.getZone().preview && text != null){
draw.setRegion(new TextureRegion(text));
}
}).color(Color.DARK_GRAY).grow()));
}).color(Color.darkGray).grow()));
}
TextButton button = Elements.newButton(Core.bundle.format("resume", slot.getZone().localizedName()), Styles.squaret, () -> {
@@ -177,7 +177,7 @@ public class DeployDialog extends FloatingDialog{
if(zone.unlocked() && !hidden(zone)){
button.labelWrap(zone.localizedName()).style(Styles.outlineLabel).width(140).growX().get().setAlignment(Align.center);
}else{
Consumer<Element> flasher = zone.canUnlock() && !hidden(zone) ? e -> e.update(() -> e.getColor().set(Color.WHITE).lerp(Pal.accent, Mathf.absin(3f, 1f))) : e -> {};
Consumer<Element> flasher = zone.canUnlock() && !hidden(zone) ? e -> e.update(() -> e.getColor().set(Color.white).lerp(Pal.accent, Mathf.absin(3f, 1f))) : e -> {};
flasher.accept(button.addImage(Icon.locked).get());
button.row();
flasher.accept(button.add("$locked").get());
@@ -198,7 +198,7 @@ public class DeployDialog extends FloatingDialog{
}
stack.setSize(Tmp.v1.x, Tmp.v1.y);
stack.add(new Table(t -> t.margin(4f).add(new Image(node.zone.preview).setScaling(Scaling.stretch)).color(node.zone.unlocked() ? Color.DARK_GRAY : Color.fromGray(0.2f)).grow()));
stack.add(new Table(t -> t.margin(4f).add(new Image(node.zone.preview).setScaling(Scaling.stretch)).color(node.zone.unlocked() ? Color.darkGray : Color.fromGray(0.2f)).grow()));
stack.update(() -> stack.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f, Align.center));
Button button = new Button(Tex.buttonSquare);
@@ -233,7 +233,7 @@ public class DeployDialog extends FloatingDialog{
for(ZoneNode node : nodes){
for(ZoneNode child : node.allChildren){
Lines.stroke(UnitScl.dp.scl(4f), node.zone.locked() || child.zone.locked() ? Pal.gray : Pal.gray);
Lines.stroke(Scl.scl(4f), node.zone.locked() || child.zone.locked() ? Pal.gray : Pal.gray);
Draw.alpha(parentAlpha);
Lines.line(node.x + offsetX, node.y + offsetY, child.x + offsetX, child.y + offsetY);
}

View File

@@ -118,7 +118,7 @@ public class MapsDialog extends FloatingDialog{
ScrollPane pane = new ScrollPane(maps);
pane.setFadeScrollBars(false);
int maxwidth = Mathf.clamp((int)(Core.graphics.getWidth() / UnitScl.dp.scl(230)), 1, 8);
int maxwidth = Mathf.clamp((int)(Core.graphics.getWidth() / Scl.scl(230)), 1, 8);
float mapsize = 200f;
int i = 0;
@@ -137,7 +137,7 @@ public class MapsDialog extends FloatingDialog{
button.row();
button.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize - 20f);
button.row();
button.add(map.custom ? "$custom" : "$builtin").color(Color.GRAY).padTop(3);
button.add(map.custom ? "$custom" : "$builtin").color(Color.gray).padTop(3);
i++;
}
@@ -171,15 +171,15 @@ public class MapsDialog extends FloatingDialog{
t.top();
t.defaults().padTop(10).left();
t.add("$editor.name").padRight(10).color(Color.GRAY).padTop(0);
t.add("$editor.name").padRight(10).color(Color.gray).padTop(0);
t.row();
t.add(map.name()).growX().wrap().padTop(2);
t.row();
t.add("$editor.author").padRight(10).color(Color.GRAY);
t.add("$editor.author").padRight(10).color(Color.gray);
t.row();
t.add(map.custom && map.author().isEmpty() ? "Anuke" : map.author()).growX().wrap().padTop(2);
t.row();
t.add("$editor.description").padRight(10).color(Color.GRAY).top();
t.add("$editor.description").padRight(10).color(Color.gray).top();
t.row();
t.add(map.description()).growX().wrap().padTop(2);
}).height(mapsize).width(mapsize);

View File

@@ -30,7 +30,7 @@ public class MinimapDialog extends FloatingDialog{
cont.table(Tex.pane,t -> {
t.addRect((x, y, width, height) -> {
if(renderer.minimap.getRegion() == null) return;
Draw.color(Color.WHITE);
Draw.color(Color.white);
Draw.alpha(parentAlpha);
Draw.rect(renderer.minimap.getRegion(), x + width / 2f, y + height / 2f, width, height);
@@ -38,7 +38,7 @@ public class MinimapDialog extends FloatingDialog{
renderer.minimap.drawEntities(x, y, width, height);
}
}).grow();
}).size(Math.min(Core.graphics.getWidth() / 1.1f, Core.graphics.getHeight() / 1.3f) / UnitScl.dp.scl(1f)).padTop(-20f);
}).size(Math.min(Core.graphics.getWidth() / 1.1f, Core.graphics.getHeight() / 1.3f) / Scl.scl(1f)).padTop(-20f);
cont.addListener(new InputListener(){
@Override

View File

@@ -26,7 +26,7 @@ import io.anuke.mindustry.world.*;
import static io.anuke.mindustry.Vars.*;
public class TechTreeDialog extends FloatingDialog{
private final float nodeSize = UnitScl.dp.scl(60f);
private final float nodeSize = Scl.scl(60f);
private ObjectSet<TechTreeNode> nodes = new ObjectSet<>();
private TechTreeNode root = new TechTreeNode(TechTree.root, null);
private Rectangle bounds = new Rectangle();
@@ -56,8 +56,8 @@ public class TechTreeDialog extends FloatingDialog{
void treeLayout(){
TreeLayout layout = new TreeLayout();
layout.gapBetweenLevels = UnitScl.dp.scl(60f);
layout.gapBetweenNodes = UnitScl.dp.scl(40f);
layout.gapBetweenLevels = Scl.scl(60f);
layout.gapBetweenNodes = Scl.scl(40f);
LayoutNode node = new LayoutNode(root, null);
layout.layout(node);
bounds.set(layout.getBounds());
@@ -190,7 +190,7 @@ public class TechTreeDialog extends FloatingDialog{
button.getStyle().up = !locked(node.node) ? Tex.buttonOver : !data.hasItems(node.node.requirements) ? Tex.buttonRed : Tex.button;
((TextureRegionDrawable)button.getStyle().imageUp)
.setRegion(node.visible ? node.node.block.icon(Block.Icon.medium) : Core.atlas.find("icon-locked"));
button.getImage().setColor(!locked(node.node) ? Color.WHITE : Color.GRAY);
button.getImage().setColor(!locked(node.node) ? Color.white : Color.gray);
});
addChild(button);
}
@@ -276,9 +276,9 @@ public class TechTreeDialog extends FloatingDialog{
t.table(list -> {
list.left();
list.addImage(req.item.icon(Item.Icon.medium)).size(8 * 3).padRight(3);
list.add(req.item.localizedName()).color(Color.LIGHT_GRAY);
list.add(req.item.localizedName()).color(Color.lightGray);
list.label(() -> " " + Math.min(data.getItem(req.item), req.amount) + " / " + req.amount)
.update(l -> l.setColor(data.has(req.item, req.amount) ? Color.LIGHT_GRAY : Color.SCARLET));
.update(l -> l.setColor(data.has(req.item, req.amount) ? Color.lightGray : Color.scarlet));
}).fillX().left();
t.row();
}
@@ -297,7 +297,7 @@ public class TechTreeDialog extends FloatingDialog{
infoTable.row();
if(node.block.description != null){
infoTable.table(t -> t.margin(3f).left().labelWrap(node.block.description).color(Color.LIGHT_GRAY).growX()).fillX();
infoTable.table(t -> t.margin(3f).left().labelWrap(node.block.description).color(Color.lightGray).growX()).fillX();
}
@@ -316,7 +316,7 @@ public class TechTreeDialog extends FloatingDialog{
for(TechTreeNode child : node.children){
if(!child.visible) continue;
Lines.stroke(UnitScl.dp.scl(4f), locked(node.node) || locked(child.node) ? Pal.gray : Pal.accent);
Lines.stroke(Scl.scl(4f), locked(node.node) || locked(child.node) ? Pal.gray : Pal.accent);
Draw.alpha(parentAlpha);
Lines.line(node.x + offsetX, node.y + offsetY, child.x + offsetX, child.y + offsetY);
}

View File

@@ -46,7 +46,7 @@ public class ZoneInfoDialog extends FloatingDialog{
iteminfo.row();
}
iteminfo.addImage(stack.item.icon(Item.Icon.medium)).size(8 * 3).padRight(1);
iteminfo.add(stack.amount + "").color(Color.LIGHT_GRAY).padRight(5);
iteminfo.add(stack.amount + "").color(Color.lightGray).padRight(5);
}
};
@@ -68,8 +68,8 @@ public class ZoneInfoDialog extends FloatingDialog{
r.row();
for(ZoneRequirement other : zone.zoneRequirements){
r.addImage(Icon.terrain).padRight(4);
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY);
r.addImage(other.zone.bestWave() >= other.wave ? Icon.checkSmall : Icon.cancelSmall, other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.lightGray);
r.addImage(other.zone.bestWave() >= other.wave ? Icon.checkSmall : Icon.cancelSmall, other.zone.bestWave() >= other.wave ? Color.lightGray : Color.scarlet).padLeft(3);
r.row();
}
});
@@ -83,8 +83,8 @@ public class ZoneInfoDialog extends FloatingDialog{
r.row();
for(Block block : zone.blockRequirements){
r.addImage(block.icon(Block.Icon.small)).size(8 * 3).padRight(4);
r.add(block.localizedName).color(Color.LIGHT_GRAY);
r.addImage(data.isUnlocked(block) ? Icon.checkSmall : Icon.cancelSmall, data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
r.add(block.localizedName).color(Color.lightGray);
r.addImage(data.isUnlocked(block) ? Icon.checkSmall : Icon.cancelSmall, data.isUnlocked(block) ? Color.lightGray : Color.scarlet).padLeft(3);
r.row();
}

View File

@@ -29,9 +29,9 @@ public class ChatFragment extends Table{
private Label fieldlabel = new Label(">");
private BitmapFont font;
private GlyphLayout layout = new GlyphLayout();
private float offsetx = UnitScl.dp.scl(4), offsety = UnitScl.dp.scl(4), fontoffsetx = UnitScl.dp.scl(2), chatspace = UnitScl.dp.scl(50);
private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50);
private Color shadowColor = new Color(0, 0, 0, 0.4f);
private float textspacing = UnitScl.dp.scl(10);
private float textspacing = Scl.scl(10);
private Array<String> history = new Array<>();
private int historyPos = 0;
private int scrollPos = 0;
@@ -103,7 +103,7 @@ public class ChatFragment extends Table{
chatfield.setFilter((field, c) -> field.getText().length() < Vars.maxTextLength);
chatfield.getStyle().background = null;
chatfield.getStyle().font = Fonts.chat;
chatfield.getStyle().fontColor = Color.WHITE;
chatfield.getStyle().fontColor = Color.white;
chatfield.setStyle(chatfield.getStyle());
bottom().left().marginBottom(offsety).marginLeft(offsetx * 2).add(fieldlabel).padBottom(6f);
@@ -119,7 +119,7 @@ public class ChatFragment extends Table{
@Override
public void draw(){
float opacity = Core.settings.getInt("chatopacity") / 100f;
float textWidth = Math.min(Core.graphics.getWidth()/1.5f, UnitScl.dp.scl(700f));
float textWidth = Math.min(Core.graphics.getWidth()/1.5f, Scl.scl(700f));
Draw.color(shadowColor);
@@ -140,7 +140,7 @@ public class ChatFragment extends Table{
float theight = offsety + spacing + getMarginBottom();
for(int i = scrollPos; i < messages.size && i < messagesShown + scrollPos && (i < fadetime || chatOpen); i++){
layout.setText(font, messages.get(i).formattedMessage, Color.WHITE, textWidth, Align.bottomLeft, true);
layout.setText(font, messages.get(i).formattedMessage, Color.white, textWidth, Align.bottomLeft, true);
theight += layout.height + textspacing;
if(i - scrollPos == 0) theight -= textspacing + 1;
@@ -154,7 +154,7 @@ public class ChatFragment extends Table{
font.getCache().setAlphas(opacity);
}
Fill.crect(offsetx, theight - layout.height - 2, textWidth + UnitScl.dp.scl(4f), layout.height + textspacing);
Fill.crect(offsetx, theight - layout.height - 2, textWidth + Scl.scl(4f), layout.height + textspacing);
Draw.color(shadowColor);
Draw.alpha(opacity * shadowColor.a);

View File

@@ -103,7 +103,7 @@ public class HudFragment extends Fragment{
select.addImage().color(Pal.gray).width(4f).fillY();
float size = UnitScl.dp.scl(dsize);
float size = Scl.scl(dsize);
Array<Element> children = new Array<>(select.getChildren());
//now, you may be wondering, why is this necessary? the answer is, I don't know, but it fixes layout issues somehow
@@ -115,7 +115,7 @@ public class HudFragment extends Fragment{
if(fi < 4){
elem.setSize(size);
}else{
elem.setSize(UnitScl.dp.scl(4f), size);
elem.setSize(Scl.scl(4f), size);
}
elem.setPosition(fi * size, Core.graphics.getHeight(), Align.topLeft);
return true;
@@ -154,7 +154,7 @@ public class HudFragment extends Fragment{
addPlayButton(btable);
wavesMain.add(stack).width(dsize * 4 + 4f);
wavesMain.row();
wavesMain.table(Tex.button, t -> t.margin(10f).add(new Bar("boss.health", Pal.health, () -> state.boss() == null ? 0f : state.boss().healthf()).blink(Color.WHITE))
wavesMain.table(Tex.button, t -> t.margin(10f).add(new Bar("boss.health", Pal.health, () -> state.boss() == null ? 0f : state.boss().healthf()).blink(Color.white))
.grow()).fillX().visible(() -> state.rules.waves && state.boss() != null).height(60f).get();
wavesMain.row();
}
@@ -223,7 +223,7 @@ public class HudFragment extends Fragment{
}
}
Draw.color(Pal.accent, Color.WHITE, Mathf.absin(Time.time(), 8f, 1f));
Draw.color(Pal.accent, Color.white, Mathf.absin(Time.time(), 8f, 1f));
Lines.poly(position[0], position[1], 4, size[0] / 2f);
Draw.reset();
@@ -239,7 +239,7 @@ public class HudFragment extends Fragment{
//fps display
cont.table(info -> {
info.top().left().margin(4).visible(() -> Core.settings.getBool("fps"));
info.update(() -> info.setTranslation(state.rules.waves || state.isEditor() ? 0f : -UnitScl.dp.scl(dsize * 4 + 3), 0));
info.update(() -> info.setTranslation(state.rules.waves || state.isEditor() ? 0f : -Scl.scl(dsize * 4 + 3), 0));
IntFormat fps = new IntFormat("fps");
IntFormat ping = new IntFormat("ping");
@@ -256,7 +256,7 @@ public class HudFragment extends Fragment{
parent.fill(t -> {
t.touchable(Touchable.disabled);
t.table(Styles.black, c -> c.add("$nearpoint")
.update(l -> l.setColor(Tmp.c1.set(Color.WHITE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 10f, 1f))))
.update(l -> l.setColor(Tmp.c1.set(Color.white).lerp(Color.scarlet, Mathf.absin(Time.time(), 10f, 1f))))
.get().setAlignment(Align.center, Align.center))
.margin(6).update(u -> u.color.a = Mathf.lerpDelta(u.color.a, Mathf.num(spawner.playerNear()), 0.1f)).get().color.a = 0f;
});
@@ -310,7 +310,7 @@ public class HudFragment extends Fragment{
return coreAttackOpacity > 0;
});
t.table(Tex.button, top -> top.add("$coreattack").pad(2)
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
.update(label -> label.getColor().set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
});
//tutorial text
@@ -598,7 +598,7 @@ public class HudFragment extends Fragment{
if(inLaunchWave()){
builder.append("[#");
Tmp.c1.set(Color.WHITE).lerp(state.enemies() > 0 ? Color.WHITE : Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)).toString(builder);
Tmp.c1.set(Color.white).lerp(state.enemies() > 0 ? Color.white : Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)).toString(builder);
builder.append("]");
if(!canLaunch()){

View File

@@ -69,17 +69,17 @@ public class MenuFragment extends Fragment{
parent.fill((x, y, w, h) -> {
Texture logo = Core.assets.get("sprites/logo.png");
float logoscl = UnitScl.dp.scl(1);
float logow = Math.min(logo.getWidth() * logoscl, Core.graphics.getWidth() - UnitScl.dp.scl(20));
float logoscl = Scl.scl(1);
float logow = Math.min(logo.getWidth() * logoscl, Core.graphics.getWidth() - Scl.scl(20));
float logoh = logow * (float)logo.getHeight() / logo.getWidth();
float fx = (int)(Core.graphics.getWidth() / 2f);
float fy = (int)(Core.graphics.getHeight() - 6 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? UnitScl.dp.scl(30f) : 0f);
float fy = (int)(Core.graphics.getHeight() - 6 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? Scl.scl(30f) : 0f);
Draw.color();
Draw.rect(Draw.wrap(logo), fx, fy, logow, logoh);
Fonts.def.setColor(Color.WHITE);
Fonts.def.setColor(Color.white);
Fonts.def.draw(versionText, fx, fy - logoh/2f, Align.center);
}).touchable(Touchable.disabled);
}
@@ -208,7 +208,7 @@ public class MenuFragment extends Fragment{
submenu.clearChildren();
fadeInMenu();
//correctly offset the button
submenu.add().height((Core.graphics.getHeight() - out[0].getY(Align.topLeft)) / UnitScl.dp.scl(1f));
submenu.add().height((Core.graphics.getHeight() - out[0].getY(Align.topLeft)) / Scl.scl(1f));
submenu.row();
buttons(submenu, b.submenu);
}else{

View File

@@ -148,7 +148,7 @@ public class PlacementFragment extends Fragment{
button.update(() -> { //color unplacable things gray
TileEntity core = player.getClosestCore();
Color color = state.rules.infiniteResources || (core != null && (core.items.has(block.buildRequirements, state.rules.buildCostMultiplier) || state.rules.infiniteResources)) ? Color.WHITE : Color.GRAY;
Color color = state.rules.infiniteResources || (core != null && (core.items.has(block.buildRequirements, state.rules.buildCostMultiplier) || state.rules.infiniteResources)) ? Color.white : Color.gray;
button.forEach(elem -> elem.setColor(color));
button.setChecked(input.block == block);
});
@@ -210,7 +210,7 @@ public class PlacementFragment extends Fragment{
req.table(line -> {
line.left();
line.addImage(stack.item.icon(Item.Icon.small)).size(8 * 2);
line.add(stack.item.localizedName()).color(Color.LIGHT_GRAY).padLeft(2).left();
line.add(stack.item.localizedName()).color(Color.lightGray).padLeft(2).left();
line.labelWrap(() -> {
TileEntity core = player.getClosestCore();
if(core == null || state.rules.infiniteResources) return "*/*";

View File

@@ -81,7 +81,7 @@ public class PlayerListFragment extends Fragment{
super.draw();
Draw.color(Pal.gray);
Draw.alpha(parentAlpha);
Lines.stroke(UnitScl.dp.scl(4f));
Lines.stroke(Scl.scl(4f));
Lines.rect(x, y, width, height);
Draw.reset();
}