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

@@ -156,15 +156,15 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
Core.graphics.clear(Pal.darkerGray);
Draw.proj().setOrtho(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
float height = UnitScl.dp.scl(50f);
float height = Scl.scl(50f);
Draw.color(Color.BLACK);
Draw.color(Color.black);
Fill.poly(graphics.getWidth()/2f, graphics.getHeight()/2f, 6, Mathf.dst(graphics.getWidth()/2f, graphics.getHeight()/2f) * smoothProgress);
Draw.reset();
float w = graphics.getWidth()*0.6f;
Draw.color(Color.BLACK);
Draw.color(Color.black);
Fill.rect(graphics.getWidth()/2f, graphics.getHeight()/2f, w, height);
Draw.color(Pal.accent);
@@ -176,13 +176,13 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
if(assets.isLoaded("outline")){
BitmapFont font = assets.get("outline");
font.draw((int)(assets.getProgress() * 100) + "%", graphics.getWidth() / 2f, graphics.getHeight() / 2f + UnitScl.dp.scl(10f), Align.center);
font.draw(bundle.get("loading", "").replace("[accent]", ""), graphics.getWidth() / 2f, graphics.getHeight() / 2f + height / 2f + UnitScl.dp.scl(20), Align.center);
font.draw((int)(assets.getProgress() * 100) + "%", graphics.getWidth() / 2f, graphics.getHeight() / 2f + Scl.scl(10f), Align.center);
font.draw(bundle.get("loading", "").replace("[accent]", ""), graphics.getWidth() / 2f, graphics.getHeight() / 2f + height / 2f + Scl.scl(20), Align.center);
if(assets.getCurrentLoading() != null){
String name = assets.getCurrentLoading().fileName.toLowerCase();
String key = name.contains("content") ? "content" : name.contains("msav") || name.contains("maps") ? "map" : name.contains("ogg") || name.contains("mp3") ? "sound" : name.contains("png") ? "image" : "system";
font.draw(bundle.get("load." + key, ""), graphics.getWidth() / 2f, graphics.getHeight() / 2f - height / 2f - UnitScl.dp.scl(10f), Align.center);
font.draw(bundle.get("load." + key, ""), graphics.getWidth() / 2f, graphics.getHeight() / 2f - height / 2f - Scl.scl(10f), Align.center);
}
}
Draw.flush();

View File

@@ -258,7 +258,7 @@ public class Vars implements Loadable{
Core.keybinds.setDefaults(Binding.values());
Core.settings.load();
UnitScl.dp.setProduct(settings.getInt("uiscale", 100) / 100f);
Scl.setProduct(settings.getInt("uiscale", 100) / 100f);
if(!loadLocales) return;

View File

@@ -590,7 +590,7 @@ public class Blocks implements ContentList{
pyratiteMixer = new GenericSmelter("pyratite-mixer"){{
requirements(Category.crafting, ItemStack.with(Items.copper, 50, Items.lead, 25));
flameColor = Color.CLEAR;
flameColor = Color.clear;
hasItems = true;
hasPower = true;
outputItem = new ItemStack(Items.pyratite, 1);
@@ -661,7 +661,7 @@ public class Blocks implements ContentList{
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.rect(reg(frameRegions[(int)Mathf.absin(entity.totalProgress, 5f, 2.999f)]), tile.drawx(), tile.drawy());
Draw.color(Color.CLEAR, tile.entity.liquids.current().color, tile.entity.liquids.total() / liquidCapacity);
Draw.color(Color.clear, tile.entity.liquids.current().color, tile.entity.liquids.total() / liquidCapacity);
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy());
Draw.color();
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy());
@@ -1397,7 +1397,7 @@ public class Blocks implements ContentList{
smokeEffect = Fx.lancerLaserShootSmoke;
chargeEffect = Fx.lancerLaserCharge;
chargeBeginEffect = Fx.lancerLaserChargeBegin;
heatColor = Color.RED;
heatColor = Color.red;
size = 2;
health = 280 * size * size;
targetAir = false;
@@ -1414,7 +1414,7 @@ public class Blocks implements ContentList{
targetAir = false;
range = 90f;
shootEffect = Fx.lightningShoot;
heatColor = Color.RED;
heatColor = Color.red;
recoil = 1f;
size = 1;
health = 260;
@@ -1502,7 +1502,7 @@ public class Blocks implements ContentList{
@Override
public void draw(Bullet b){
super.draw(b);
Draw.color(Color.WHITE, Pal.lancerLaser, b.fin());
Draw.color(Color.white, Pal.lancerLaser, b.fin());
//Draw.alpha(b.fout());
for(int i = 0; i < 7; i++){
Tmp.v1.trns(b.rot(), i * 8f);

View File

@@ -250,7 +250,7 @@ public class Bullets implements ContentList{
splashDamageRadius = 25f;
splashDamage = 10f;
lifetime = 120f;
trailColor = Color.GRAY;
trailColor = Color.gray;
backColor = Pal.bulletYellowBack;
frontColor = Pal.bulletYellow;
hitEffect = Fx.blastExplosion;
@@ -396,7 +396,7 @@ public class Bullets implements ContentList{
Draw.color(Pal.heal);
Lines.stroke(2f);
Lines.lineAngleCenter(b.x, b.y, b.rot(), 7f);
Draw.color(Color.WHITE);
Draw.color(Color.white);
Lines.lineAngleCenter(b.x, b.y, b.rot(), 3f);
Draw.reset();
}
@@ -430,7 +430,7 @@ public class Bullets implements ContentList{
@Override
public void draw(Bullet b){
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.GRAY, b.fin());
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.gray, b.fin());
Fill.circle(b.x, b.y, 3f * b.fout());
Draw.reset();
}
@@ -498,7 +498,7 @@ public class Bullets implements ContentList{
};
lancerLaser = new BulletType(0.001f, 140){
Color[] colors = {Pal.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Pal.lancerLaser, Color.WHITE};
Color[] colors = {Pal.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Pal.lancerLaser, Color.white};
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
float length = 160f;
@@ -540,7 +540,7 @@ public class Bullets implements ContentList{
meltdownLaser = new BulletType(0.001f, 70){
Color tmpColor = new Color();
Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.WHITE};
Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white};
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
float[] strokes = {2f, 1.5f, 1f, 0.3f};
float[] lenscales = {1f, 1.12f, 1.15f, 1.17f};
@@ -688,7 +688,7 @@ public class Bullets implements ContentList{
bulletHeight = 12f;
hitEffect = Fx.pulverize;
backColor = new Color(0x4f4f4fff);
frontColor = Color.GRAY;
frontColor = Color.gray;
}
@Override

View File

@@ -93,14 +93,14 @@ public class Fx implements ContentList{
});
smoke = new Effect(100, e -> {
Draw.color(Color.GRAY, Pal.darkishGray, e.fin());
Draw.color(Color.gray, Pal.darkishGray, e.fin());
float size = 7f - e.fin() * 7f;
Draw.rect("circle", e.x, e.y, size, size);
Draw.reset();
});
magmasmoke = new Effect(110, e -> {
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Fill.circle(e.x, e.y, e.fslope() * 6f);
Draw.reset();
});
@@ -180,7 +180,7 @@ public class Fx implements ContentList{
hitBulletSmall = new Effect(14, e -> {
Draw.color(Color.WHITE, Pal.lightOrange, e.fin());
Draw.color(Color.white, Pal.lightOrange, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
@@ -199,7 +199,7 @@ public class Fx implements ContentList{
});
hitFuse = new Effect(14, e -> {
Draw.color(Color.WHITE, Pal.surge, e.fin());
Draw.color(Color.white, Pal.surge, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
@@ -218,7 +218,7 @@ public class Fx implements ContentList{
});
hitBulletBig = new Effect(13, e -> {
Draw.color(Color.WHITE, Pal.lightOrange, e.fin());
Draw.color(Color.white, Pal.lightOrange, e.fin());
Lines.stroke(0.5f + e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> {
@@ -252,7 +252,7 @@ public class Fx implements ContentList{
});
hitLancer = new Effect(12, e -> {
Draw.color(Color.WHITE);
Draw.color(Color.white);
Lines.stroke(e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> {
@@ -276,14 +276,14 @@ public class Fx implements ContentList{
});
hitLaser = new Effect(8, e -> {
Draw.color(Color.WHITE, Pal.heal, e.fin());
Draw.color(Color.white, Pal.heal, e.fin());
Lines.stroke(0.5f + e.fout());
Lines.circle(e.x, e.y, e.fin() * 5f);
Draw.reset();
});
despawn = new Effect(12, e -> {
Draw.color(Pal.lighterOrange, Color.GRAY, e.fin());
Draw.color(Pal.lighterOrange, Color.gray, e.fin());
Lines.stroke(e.fout());
Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> {
@@ -302,7 +302,7 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 10f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
@@ -326,7 +326,7 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 24f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
@@ -350,7 +350,7 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 34f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
@@ -374,7 +374,7 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 15f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
@@ -423,7 +423,7 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 25f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
@@ -461,7 +461,7 @@ public class Fx implements ContentList{
});
fireSmoke = new Effect(35f, e -> {
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
@@ -471,7 +471,7 @@ public class Fx implements ContentList{
});
steam = new Effect(35f, e -> {
Draw.color(Color.LIGHT_GRAY);
Draw.color(Color.lightGray);
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
@@ -481,7 +481,7 @@ public class Fx implements ContentList{
});
fireballsmoke = new Effect(25f, e -> {
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
@@ -511,7 +511,7 @@ public class Fx implements ContentList{
});
melting = new Effect(40f, e -> {
Draw.color(Liquids.slag.color, Color.WHITE, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f));
Draw.color(Liquids.slag.color, Color.white, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f));
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f);
@@ -559,35 +559,35 @@ public class Fx implements ContentList{
shockwave = new Effect(10f, 80f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
Draw.color(Color.white, Color.lightGray, e.fin());
Lines.stroke(e.fout() * 2f + 0.2f);
Lines.circle(e.x, e.y, e.fin() * 28f);
Draw.reset();
});
bigShockwave = new Effect(10f, 80f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
Draw.color(Color.white, Color.lightGray, e.fin());
Lines.stroke(e.fout() * 3f);
Lines.circle(e.x, e.y, e.fin() * 50f);
Draw.reset();
});
nuclearShockwave = new Effect(10f, 200f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
Draw.color(Color.white, Color.lightGray, e.fin());
Lines.stroke(e.fout() * 3f + 0.2f);
Lines.circle(e.x, e.y, e.fin() * 140f);
Draw.reset();
});
impactShockwave = new Effect(13f, 300f, e -> {
Draw.color(Pal.lighterOrange, Color.LIGHT_GRAY, e.fin());
Draw.color(Pal.lighterOrange, Color.lightGray, e.fin());
Lines.stroke(e.fout() * 4f + 0.2f);
Lines.circle(e.x, e.y, e.fin() * 200f);
Draw.reset();
});
spawnShockwave = new Effect(20f, 400f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
Draw.color(Color.white, Color.lightGray, e.fin());
Lines.stroke(e.fout() * 3f + 0.5f);
Lines.circle(e.x, e.y, e.fin() * (e.rotation + 50f));
Draw.reset();
@@ -599,14 +599,14 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 10f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.GRAY, e.fin());
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.gray, e.fin());
Lines.stroke(1.5f * e.fout());
Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> {
@@ -624,14 +624,14 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, (3f + i.fin() * 14f) * intensity);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, e.finpow(), (int)(6 * intensity), 21f * intensity, (x, y, in, out) -> {
Fill.circle(e.x + x, e.y + y, out * (2f + intensity) * 3 + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, out * (intensity) * 3);
});
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.GRAY, e.fin());
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.gray, e.fin());
Lines.stroke((1.7f * e.fout()) * (1f + (intensity - 1f) / 2f));
Angles.randLenVectors(e.id + 1, e.finpow(), (int)(9 * intensity), 40f * intensity, (x, y, in, out) -> {
@@ -647,14 +647,14 @@ public class Fx implements ContentList{
Lines.circle(e.x, e.y, 3f + i.fin() * 14f);
});
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.GRAY, e.fin());
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.gray, e.fin());
Lines.stroke(1.7f * e.fout());
Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> {
@@ -665,7 +665,7 @@ public class Fx implements ContentList{
});
blockExplosionSmoke = new Effect(30, e -> {
Draw.color(Color.GRAY);
Draw.color(Color.gray);
Angles.randLenVectors(e.id, 6, 4f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f);
@@ -693,7 +693,7 @@ public class Fx implements ContentList{
});
shootSmallSmoke = new Effect(20f, e -> {
Draw.color(Pal.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Pal.lighterOrange, Color.lightGray, Color.gray, e.fin());
Angles.randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
@@ -711,7 +711,7 @@ public class Fx implements ContentList{
});
shootBig2 = new Effect(10, e -> {
Draw.color(Pal.lightOrange, Color.GRAY, e.fin());
Draw.color(Pal.lightOrange, Color.gray, e.fin());
float w = 1.2f + 8 * e.fout();
Drawf.tri(e.x, e.y, w, 29f * e.fout(), e.rotation);
Drawf.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f);
@@ -719,7 +719,7 @@ public class Fx implements ContentList{
});
shootBigSmoke = new Effect(17f, e -> {
Draw.color(Pal.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Pal.lighterOrange, Color.lightGray, Color.gray, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f);
@@ -729,7 +729,7 @@ public class Fx implements ContentList{
});
shootBigSmoke2 = new Effect(18f, e -> {
Draw.color(Pal.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Pal.lightOrange, Color.lightGray, Color.gray, e.fin());
Angles.randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f);
@@ -739,7 +739,7 @@ public class Fx implements ContentList{
});
shootSmallFlame = new Effect(32f, e -> {
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.GRAY, e.fin());
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.gray, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 60f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
@@ -749,7 +749,7 @@ public class Fx implements ContentList{
});
shootPyraFlame = new Effect(33f, e -> {
Draw.color(Pal.lightPyraFlame, Pal.darkPyraFlame, Color.GRAY, e.fin());
Draw.color(Pal.lightPyraFlame, Pal.darkPyraFlame, Color.gray, e.fin());
Angles.randLenVectors(e.id, 10, e.finpow() * 70f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f);
@@ -759,7 +759,7 @@ public class Fx implements ContentList{
});
shootLiquid = new Effect(40f, e -> {
Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f));
Draw.color(e.color, Color.white, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f));
Angles.randLenVectors(e.id, 6, e.finpow() * 60f, e.rotation, 11f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f);
@@ -769,7 +769,7 @@ public class Fx implements ContentList{
});
shellEjectSmall = new GroundEffect(30f, 400f, e -> {
Draw.color(Pal.lightOrange, Color.LIGHT_GRAY, Pal.lightishGray, e.fin());
Draw.color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
float rot = Math.abs(e.rotation) + 90f;
int i = Mathf.sign(e.rotation);
@@ -784,7 +784,7 @@ public class Fx implements ContentList{
});
shellEjectMedium = new GroundEffect(34f, 400f, e -> {
Draw.color(Pal.lightOrange, Color.LIGHT_GRAY, Pal.lightishGray, e.fin());
Draw.color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (2f + e.finpow() * 10f) * i;
@@ -795,7 +795,7 @@ public class Fx implements ContentList{
2f, 3f, rot);
}
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Color.lightGray, Color.gray, e.fin());
for(int i : Mathf.signs){
float ex = e.x, ey = e.y, fout = e.fout();
@@ -808,7 +808,7 @@ public class Fx implements ContentList{
});
shellEjectBig = new GroundEffect(22f, 400f, e -> {
Draw.color(Pal.lightOrange, Color.LIGHT_GRAY, Pal.lightishGray, e.fin());
Draw.color(Pal.lightOrange, Color.lightGray, Pal.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (4f + e.finpow() * 8f) * i;
@@ -820,7 +820,7 @@ public class Fx implements ContentList{
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
}
Draw.color(Color.LIGHT_GRAY);
Draw.color(Color.lightGray);
for(int i : Mathf.signs){
float ex = e.x, ey = e.y, fout = e.fout();
@@ -881,7 +881,7 @@ public class Fx implements ContentList{
});
lightningShoot = new Effect(12f, e -> {
Draw.color(Color.WHITE, Pal.lancerLaser, e.fin());
Draw.color(Color.white, Pal.lancerLaser, e.fin());
Lines.stroke(e.fout() * 1.2f + 0.5f);
Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> {
@@ -895,7 +895,7 @@ public class Fx implements ContentList{
reactorsmoke = new Effect(17, e -> {
Angles.randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> {
float size = 1f + e.fout() * 5f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Color.lightGray, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -903,7 +903,7 @@ public class Fx implements ContentList{
nuclearsmoke = new Effect(40, e -> {
Angles.randLenVectors(e.id, 4, e.fin() * 13f, (x, y) -> {
float size = e.fslope() * 4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Color.lightGray, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -911,7 +911,7 @@ public class Fx implements ContentList{
nuclearcloud = new Effect(90, 200f, e -> {
Angles.randLenVectors(e.id, 10, e.finpow() * 90f, (x, y) -> {
float size = e.fout() * 14f;
Draw.color(Color.LIME, Color.GRAY, e.fin());
Draw.color(Color.lime, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -919,7 +919,7 @@ public class Fx implements ContentList{
impactsmoke = new Effect(60, e -> {
Angles.randLenVectors(e.id, 7, e.fin() * 20f, (x, y) -> {
float size = e.fslope() * 4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Color.lightGray, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -927,7 +927,7 @@ public class Fx implements ContentList{
impactcloud = new Effect(140, 400f, e -> {
Angles.randLenVectors(e.id, 20, e.finpow() * 160f, (x, y) -> {
float size = e.fout() * 15f;
Draw.color(Pal.lighterOrange, Color.LIGHT_GRAY, e.fin());
Draw.color(Pal.lighterOrange, Color.lightGray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -935,7 +935,7 @@ public class Fx implements ContentList{
redgeneratespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Pal.redSpark, Color.GRAY, e.fin());
Draw.color(Pal.redSpark, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
@@ -943,7 +943,7 @@ public class Fx implements ContentList{
generatespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Pal.orangeSpark, Color.GRAY, e.fin());
Draw.color(Pal.orangeSpark, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
@@ -951,14 +951,14 @@ public class Fx implements ContentList{
fuelburn = new Effect(23, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.color(Color.lightGray, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
});
plasticburn = new Effect(40, e -> {
Angles.randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> {
Draw.color(Color.valueOf("e9ead3"), Color.GRAY, e.fin());
Draw.color(Color.valueOf("e9ead3"), Color.gray, e.fin());
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
Draw.reset();
});
@@ -1000,21 +1000,21 @@ public class Fx implements ContentList{
});
producesmoke = new Effect(12, e -> {
Angles.randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> {
Draw.color(Color.WHITE, Pal.accent, e.fin());
Draw.color(Color.white, Pal.accent, e.fin());
Fill.square(e.x + x, e.y + y, 1f + e.fout() * 3f, 45);
Draw.reset();
});
});
smeltsmoke = new Effect(15, e -> {
Angles.randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> {
Draw.color(Color.WHITE, e.color, e.fin());
Draw.color(Color.white, e.color, e.fin());
Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45);
Draw.reset();
});
});
formsmoke = new Effect(40, e -> {
Angles.randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> {
Draw.color(Pal.plasticSmoke, Color.LIGHT_GRAY, e.fin());
Draw.color(Pal.plasticSmoke, Color.lightGray, e.fin());
Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45);
Draw.reset();
});
@@ -1022,7 +1022,7 @@ public class Fx implements ContentList{
blastsmoke = new Effect(26, e -> {
Angles.randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> {
float size = 2f + e.fout() * 6f;
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fin());
Draw.color(Color.lightGray, Color.darkGray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -1030,7 +1030,7 @@ public class Fx implements ContentList{
lava = new Effect(18, e -> {
Angles.randLenVectors(e.id, 3, 1f + e.fin() * 10f, (x, y) -> {
float size = e.fslope() * 4f;
Draw.color(Color.ORANGE, Color.GRAY, e.fin());
Draw.color(Color.orange, Color.gray, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
@@ -1056,53 +1056,53 @@ public class Fx implements ContentList{
Draw.reset();
});
purify = new Effect(10, e -> {
Draw.color(Color.ROYAL, Color.GRAY, e.fin());
Draw.color(Color.royal, Color.gray, e.fin());
Lines.stroke(2f);
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
Draw.reset();
});
purifyoil = new Effect(10, e -> {
Draw.color(Color.BLACK, Color.GRAY, e.fin());
Draw.color(Color.black, Color.gray, e.fin());
Lines.stroke(2f);
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
Draw.reset();
});
purifystone = new Effect(10, e -> {
Draw.color(Color.ORANGE, Color.GRAY, e.fin());
Draw.color(Color.orange, Color.gray, e.fin());
Lines.stroke(2f);
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
Draw.reset();
});
generate = new Effect(11, e -> {
Draw.color(Color.ORANGE, Color.YELLOW, e.fin());
Draw.color(Color.orange, Color.yellow, e.fin());
Lines.stroke(1f);
Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8);
Draw.reset();
});
mine = new Effect(20, e -> {
Angles.randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> {
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
Draw.color(e.color, Color.lightGray, e.fin());
Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45);
Draw.reset();
});
});
mineBig = new Effect(30, e -> {
Angles.randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> {
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
Draw.color(e.color, Color.lightGray, e.fin());
Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.2f, 45);
Draw.reset();
});
});
mineHuge = new Effect(40, e -> {
Angles.randLenVectors(e.id, 8, 5f + e.fin() * 10f, (x, y) -> {
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
Draw.color(e.color, Color.lightGray, e.fin());
Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45);
Draw.reset();
});
});
smelt = new Effect(20, e -> {
Angles.randLenVectors(e.id, 6, 2f + e.fin() * 5f, (x, y) -> {
Draw.color(Color.WHITE, e.color, e.fin());
Draw.color(Color.white, e.color, e.fin());
Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45);
Draw.reset();
});

View File

@@ -36,7 +36,7 @@ public class Renderer implements ApplicationListener{
public FrameBuffer shieldBuffer = new FrameBuffer(2, 2);
private Bloom bloom;
private Color clearColor;
private float targetscale = UnitScl.dp.scl(4);
private float targetscale = Scl.scl(4);
private float camerascale = targetscale;
private Rectangle rect = new Rectangle(), rect2 = new Rectangle();
private float shakeIntensity, shaketime;
@@ -100,14 +100,14 @@ public class Renderer implements ApplicationListener{
@Override
public void update(){
//TODO hack, find source of this bug
Color.WHITE.set(1f, 1f, 1f, 1f);
Color.white.set(1f, 1f, 1f, 1f);
camerascale = Mathf.lerpDelta(camerascale, targetscale, 0.1f);
camera.width = graphics.getWidth() / camerascale;
camera.height = graphics.getHeight() / camerascale;
if(state.is(State.menu)){
graphics.clear(Color.BLACK);
graphics.clear(Color.black);
}else{
Vector2 position = Tmp.v3.set(player);
@@ -263,7 +263,7 @@ public class Renderer implements ApplicationListener{
if(settings.getBool("animatedshields") && Shaders.shield != null){
Draw.flush();
shieldBuffer.begin();
graphics.clear(Color.CLEAR);
graphics.clear(Color.clear);
shieldGroup.draw();
shieldGroup.draw(shield -> true, ShieldEntity::drawOver);
Draw.flush();
@@ -348,7 +348,7 @@ public class Renderer implements ApplicationListener{
}
public void clampScale(){
float s = UnitScl.dp.scl(1f);
float s = Scl.scl(1f);
targetscale = Mathf.clamp(targetscale, s * 1.5f, Math.round(s * 6));
}

View File

@@ -104,7 +104,7 @@ public class UI implements ApplicationListener, Loadable{
ClickListener.clicked = () -> Sounds.press.play();
Colors.put("accent", Pal.accent);
Colors.put("highlight", Pal.accent.cpy().lerp(Color.WHITE, 0.3f));
Colors.put("highlight", Pal.accent.cpy().lerp(Color.white, 0.3f));
Colors.put("stat", Pal.stat);
loadExtraCursors();
}
@@ -131,7 +131,7 @@ public class UI implements ApplicationListener, Loadable{
@Override
public BitmapFont loadSync(AssetManager manager, String fileName, FileHandle file, FreeTypeFontLoaderParameter parameter){
if(fileName.equals("outline")){
parameter.fontParameters.borderWidth = UnitScl.dp.scl(2f);
parameter.fontParameters.borderWidth = Scl.scl(2f);
parameter.fontParameters.spaceX -= parameter.fontParameters.borderWidth;
}
parameter.fontParameters.size = fontParameter().size;
@@ -140,7 +140,7 @@ public class UI implements ApplicationListener, Loadable{
});
FreeTypeFontParameter param = new FreeTypeFontParameter(){{
borderColor = Color.DARK_GRAY;
borderColor = Color.darkGray;
incremental = true;
}};
@@ -163,8 +163,8 @@ public class UI implements ApplicationListener, Loadable{
static FreeTypeFontParameter fontParameter(){
return new FreeTypeFontParameter(){{
size = (int)(UnitScl.dp.scl(18f));
shadowColor = Color.DARK_GRAY;
size = (int)(Scl.scl(18f));
shadowColor = Color.darkGray;
shadowOffsetY = 2;
incremental = true;
}};
@@ -308,7 +308,7 @@ public class UI implements ApplicationListener, Loadable{
cont.margin(15f);
cont.add("$error.title");
cont.row();
cont.addImage().fillX().pad(2).height(4f).color(Color.SCARLET);
cont.addImage().fillX().pad(2).height(4f).color(Color.scarlet);
cont.row();
cont.add(text).pad(2f);
buttons.addButton("$ok", this::hide).size(120, 50).pad(4);
@@ -327,12 +327,12 @@ public class UI implements ApplicationListener, Loadable{
cont.margin(15);
cont.add("$error.title").colspan(2);
cont.row();
cont.addImage().width(300f).pad(2).colspan(2).height(4f).color(Color.SCARLET);
cont.addImage().width(300f).pad(2).colspan(2).height(4f).color(Color.scarlet);
cont.row();
cont.add((text.startsWith("$") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).wrap().growX().center().get().setAlignment(Align.center);
cont.row();
Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.parseException(exc, true)).color(Color.LIGHT_GRAY).left()), true);
Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.parseException(exc, true)).color(Color.lightGray).left()), true);
cont.addButton("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right();
cont.addButton("$ok", this::hide).size(100, 50).fillX().left();

View File

@@ -325,7 +325,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
button.table(t -> {
t.add(name).growX().wrap();
t.row();
t.add(description).color(Color.GRAY).growX().wrap();
t.add(description).color(Color.gray).growX().wrap();
}).growX().pad(10f).padLeft(5);
button.row();
@@ -437,7 +437,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
b.setStyle(Styles.clearTogglet);
b.add(Core.bundle.get("toolmode." + name)).left();
b.row();
b.add(Core.bundle.get("toolmode." + name + ".description")).color(Color.LIGHT_GRAY).left();
b.add(Core.bundle.get("toolmode." + name + ".description")).color(Color.lightGray).left();
}, () -> {
tool.mode = (tool.mode == mode ? -1 : mode);
table.remove();
@@ -492,8 +492,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
undo.setDisabled(() -> !editor.canUndo());
redo.setDisabled(() -> !editor.canRedo());
undo.update(() -> undo.getImage().setColor(undo.isDisabled() ? Color.GRAY : Color.WHITE));
redo.update(() -> redo.getImage().setColor(redo.isDisabled() ? Color.GRAY : Color.WHITE));
undo.update(() -> undo.getImage().setColor(undo.isDisabled() ? Color.gray : Color.white));
redo.update(() -> redo.getImage().setColor(redo.isDisabled() ? Color.gray : Color.white));
grid.update(() -> grid.setChecked(view.isGrid()));
addTool.accept(EditorTool.line);

View File

@@ -216,7 +216,7 @@ public class MapGenerateDialog extends FloatingDialog{
}
void rebuildFilters(){
int cols = Math.max((int)(Math.max(filterTable.getParent().getWidth(), Core.graphics.getWidth()/2f * 0.9f) / UnitScl.dp.scl(290f)), 1);
int cols = Math.max((int)(Math.max(filterTable.getParent().getWidth(), Core.graphics.getWidth()/2f * 0.9f) / Scl.scl(290f)), 1);
filterTable.clearChildren();
filterTable.top().left();
int i = 0;

View File

@@ -155,7 +155,7 @@ public class MapRenderer implements Disposable{
}
mesh.draw(idxDecal, region, wx * tilesize + offsetX, wy * tilesize + offsetY, width, height);
mesh.setColor(Color.WHITE);
mesh.setColor(Color.white);
}
@Override

View File

@@ -11,7 +11,7 @@ import io.anuke.arc.math.geom.*;
import io.anuke.arc.scene.Element;
import io.anuke.arc.scene.event.*;
import io.anuke.arc.scene.ui.TextField;
import io.anuke.arc.scene.ui.layout.UnitScl;
import io.anuke.arc.scene.ui.layout.Scl;
import io.anuke.arc.util.*;
import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.input.Binding;
@@ -241,7 +241,7 @@ public class MapView extends Element implements GestureListener{
Draw.reset();
if(grid){
Draw.color(Color.GRAY);
Draw.color(Color.gray);
image.setBounds(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight);
image.draw();
Draw.color();
@@ -258,7 +258,7 @@ public class MapView extends Element implements GestureListener{
float scaling = zoom * Math.min(width, height) / editor.width();
Draw.color(Pal.accent);
Lines.stroke(UnitScl.dp.scl(2f));
Lines.stroke(Scl.scl(2f));
if((!editor.drawBlock.isMultiblock() || tool == EditorTool.eraser) && tool != EditorTool.fill){
if(tool == EditorTool.line && drawing){
@@ -294,7 +294,7 @@ public class MapView extends Element implements GestureListener{
}
Draw.color(Pal.accent);
Lines.stroke(UnitScl.dp.scl(3f));
Lines.stroke(Scl.scl(3f));
Lines.rect(x, y, width, height);
Draw.reset();
@@ -320,7 +320,7 @@ public class MapView extends Element implements GestureListener{
public boolean zoom(float initialDistance, float distance){
if(!active()) return false;
float nzoom = distance - initialDistance;
zoom += nzoom / 10000f / UnitScl.dp.scl(1f) * zoom;
zoom += nzoom / 10000f / Scl.scl(1f) * zoom;
clampZoom();
return false;
}

View File

@@ -96,7 +96,7 @@ public class WaveInfoDialog extends FloatingDialog{
}}).width(390f).growY();
cont.table(Tex.clear, m -> {
m.add("$waves.preview").color(Color.LIGHT_GRAY).growX().center().get().setAlignment(Align.center, Align.center);
m.add("$waves.preview").color(Color.lightGray).growX().center().get().setAlignment(Align.center, Align.center);
m.row();
m.addButton("-", () -> {
}).update(t -> {
@@ -253,7 +253,7 @@ public class WaveInfoDialog extends FloatingDialog{
if(spawned[j] > 0){
UnitType type = content.getByID(ContentType.unit, j);
table.addImage(type.iconRegion).size(30f).padRight(4);
table.add(spawned[j] + "x").color(Color.LIGHT_GRAY).padRight(6);
table.add(spawned[j] + "x").color(Color.lightGray).padRight(6);
table.row();
}
}

View File

@@ -49,7 +49,7 @@ public class Effects{
}
public static void effect(Effect effect, float x, float y, float rotation){
provider.createEffect(effect, Color.WHITE, x, y, rotation, null);
provider.createEffect(effect, Color.white, x, y, rotation, null);
}
public static void effect(Effect effect, float x, float y){
@@ -61,7 +61,7 @@ public class Effects{
}
public static void effect(Effect effect, Position loc){
provider.createEffect(effect, Color.WHITE, loc.getX(), loc.getY(), 0f, null);
provider.createEffect(effect, Color.white, loc.getX(), loc.getY(), 0f, null);
}
public static void effect(Effect effect, Color color, float x, float y, float rotation){
@@ -73,7 +73,7 @@ public class Effects{
}
public static void effect(Effect effect, float x, float y, float rotation, Object data){
provider.createEffect(effect, Color.WHITE, x, y, rotation, data);
provider.createEffect(effect, Color.white, x, y, rotation, data);
}
/** Default value is 1000. Higher numbers mean more powerful shake (less falloff). */

View File

@@ -50,7 +50,7 @@ public class LiquidBulletType extends BulletType{
@Override
public void draw(Bullet b){
Draw.color(liquid.color, Color.WHITE, b.fout() / 100f);
Draw.color(liquid.color, Color.white, b.fout() / 100f);
Fill.circle(b.x, b.y, 0.5f + b.fout() * 2.5f);
}

View File

@@ -93,7 +93,7 @@ public class MassDriverBolt extends BulletType{
int amountDropped = Mathf.random(0, data.items[i]);
if(amountDropped > 0){
float angle = b.rot() + Mathf.range(100f);
Effects.effect(Fx.dropItem, Color.WHITE, b.x, b.y, angle, content.item(i));
Effects.effect(Fx.dropItem, Color.white, b.x, b.y, angle, content.item(i));
}
}
}

View File

@@ -110,7 +110,7 @@ public class Lightning extends TimedEntity implements DrawTrait, TimeTrait{
@Override
public void draw(){
Lines.stroke(3f * fout());
Draw.color(color, Color.WHITE, fin());
Draw.color(color, Color.white, fin());
Lines.beginLine();
Lines.linePoint(x, y);

View File

@@ -13,7 +13,7 @@ import static io.anuke.mindustry.Vars.effectGroup;
public class EffectEntity extends TimedEntity implements Poolable, DrawTrait{
public Effect effect;
public Color color = new Color(Color.WHITE);
public Color color = new Color(Color.white);
public Object data;
public float rotation = 0f;
@@ -63,7 +63,7 @@ public class EffectEntity extends TimedEntity implements Poolable, DrawTrait{
@Override
public void reset(){
effect = null;
color.set(Color.WHITE);
color.set(Color.white);
rotation = time = poffsetx = poffsety = 0f;
parent = null;
data = null;

View File

@@ -88,7 +88,7 @@ public interface MinerTrait extends Entity{
float ex = tile.worldx() + Mathf.sin(Time.time() + 48, swingScl, swingMag);
float ey = tile.worldy() + Mathf.sin(Time.time() + 48, swingScl + 2f, swingMag);
Draw.color(Color.LIGHT_GRAY, Color.WHITE, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl));
Draw.color(Color.lightGray, Color.white, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl));
Drawf.laser(Core.atlas.find("minelaser"), Core.atlas.find("minelaser-end"), px, py, ex, ey, 0.75f);

View File

@@ -9,7 +9,6 @@ import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.bullet.*;
import io.anuke.mindustry.entities.units.*;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.net.*;
import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.meta.*;
@@ -136,7 +135,7 @@ public abstract class FlyingUnit extends BaseUnit{
@Override
public void draw(){
Draw.mixcol(Color.WHITE, hitTime / hitDuration);
Draw.mixcol(Color.white, hitTime / hitDuration);
Draw.rect(type.region, x, y, rotation - 90);
drawWeapons();
@@ -153,7 +152,7 @@ public abstract class FlyingUnit extends BaseUnit{
Fill.circle(x + Angles.trnsx(rotation + 180, type.engineOffset), y + Angles.trnsy(rotation + 180, type.engineOffset),
type.engineSize + Mathf.absin(Time.time(), 2f, type.engineSize / 4f));
Draw.color(Color.WHITE);
Draw.color(Color.white);
Fill.circle(x + Angles.trnsx(rotation + 180, type.engineOffset - 1f), y + Angles.trnsy(rotation + 180, type.engineOffset - 1f),
(type.engineSize + Mathf.absin(Time.time(), 2f, type.engineSize / 4f)) / 2f);
Draw.color();

View File

@@ -125,14 +125,14 @@ public abstract class GroundUnit extends BaseUnit{
@Override
public void draw(){
Draw.mixcol(Color.WHITE, hitTime / hitDuration);
Draw.mixcol(Color.white, hitTime / hitDuration);
float ft = Mathf.sin(walkTime * type.speed * 5f, 6f, 2f + type.hitsize / 15f);
Floor floor = getFloorOn();
if(floor.isLiquid){
Draw.color(Color.WHITE, floor.color, 0.5f);
Draw.color(Color.white, floor.color, 0.5f);
}
for(int i : Mathf.signs){
@@ -143,9 +143,9 @@ public abstract class GroundUnit extends BaseUnit{
}
if(floor.isLiquid){
Draw.color(Color.WHITE, floor.color, drownTime * 0.4f);
Draw.color(Color.white, floor.color, drownTime * 0.4f);
}else{
Draw.color(Color.WHITE);
Draw.color(Color.white);
}
Draw.rect(type.baseRegion, x, y, baseRotation - 90);

View File

@@ -295,11 +295,11 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
Floor floor = getFloorOn();
Draw.color();
Draw.mixcol(Color.WHITE, hitTime / hitDuration);
Draw.mixcol(Color.white, hitTime / hitDuration);
if(!mech.flying){
if(floor.isLiquid){
Draw.color(Color.WHITE, floor.color, 0.5f);
Draw.color(Color.white, floor.color, 0.5f);
}
float boostTrnsY = -boostHeat * 3f;
@@ -319,9 +319,9 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
}
if(floor.isLiquid){
Draw.color(Color.WHITE, floor.color, drownTime);
Draw.color(Color.white, floor.color, drownTime);
}else{
Draw.color(Color.WHITE);
Draw.color(Color.white);
}
Draw.rect(mech.region, x, y, rotation - 90);
@@ -344,7 +344,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
@Override
public void drawStats(){
Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Time.time(), healthf() * 5f, 1f - healthf()));
Draw.color(Color.black, team.color, healthf() + Mathf.absin(Time.time(), healthf() * 5f, 1f - healthf()));
Draw.rect(getPowerCellRegion(), x + Angles.trnsx(rotation, mech.cellTrnsY, 0f), y + Angles.trnsy(rotation, mech.cellTrnsY, 0f), rotation - 90);
Draw.reset();
drawBackItems(itemtime, isLocal);
@@ -366,7 +366,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
Fill.circle(x + Angles.trnsx(rotation + 180, mech.engineOffset), y + Angles.trnsy(rotation + 180, mech.engineOffset),
size + Mathf.absin(Time.time(), 2f, size / 4f));
Draw.color(Color.WHITE);
Draw.color(Color.white);
Fill.circle(x + Angles.trnsx(rotation + 180, mech.engineOffset - 1f), y + Angles.trnsy(rotation + 180, mech.engineOffset - 1f),
(size + Mathf.absin(Time.time(), 2f, size / 4f)) / 2f);
Draw.color();
@@ -380,7 +380,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
boolean ints = font.usesIntegerPositions();
font.setUseIntegerPositions(false);
font.getData().setScale(0.25f / UnitScl.dp.scl(1f));
font.getData().setScale(0.25f / Scl.scl(1f));
layout.setText(font, name);
Draw.color(0f, 0f, 0f, 0.3f);
Fill.rect(x, y + nameHeight - layout.height / 2, layout.width + 2, layout.height + 3);
@@ -403,7 +403,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
float visualFadeTime = 1f - Mathf.curve(1f - textFadeTime, 0.9f);
font.setColor(1f, 1f, 1f, textFadeTime <= 0 || lastText == null ? 1f : visualFadeTime);
layout.setText(font, text, Color.WHITE, width, Align.bottom, true);
layout.setText(font, text, Color.white, width, Align.bottom, true);
Draw.color(0f, 0f, 0f, 0.3f * (textFadeTime <= 0 || lastText == null ? 1f : visualFadeTime));
Fill.rect(x, y + textHeight + layout.height - layout.height/2f, layout.width + 2, layout.height + 3);
@@ -413,7 +413,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
Draw.reset();
Pools.free(layout);
font.getData().setScale(1f);
font.setColor(Color.WHITE);
font.setColor(Color.white);
font.setUseIntegerPositions(ints);
}

View File

@@ -372,7 +372,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
}
public void drawStats(){
Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Time.time(), Math.max(healthf() * 5f, 1f), 1f - healthf()));
Draw.color(Color.black, team.color, healthf() + Mathf.absin(Time.time(), Math.max(healthf() * 5f, 1f), 1f - healthf()));
Draw.rect(getPowerCellRegion(), x, y, rotation - 90);
Draw.color();
@@ -403,7 +403,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
Fonts.outline.draw(item.amount + "",
x + Angles.trnsx(rotation + 180f, backTrns),
y + Angles.trnsy(rotation + 180f, backTrns) - 3,
Pal.accent, 0.25f * itemtime / UnitScl.dp.scl(1f), false, Align.center
Pal.accent, 0.25f * itemtime / Scl.scl(1f), false, Align.center
);
}
}

View File

@@ -60,7 +60,7 @@ public class Statuses implements Saveable{
public Color getStatusColor(){
if(statuses.size == 0){
return Tmp.c1.set(Color.WHITE);
return Tmp.c1.set(Color.white);
}
float r = 0f, g = 0f, b = 0f;

View File

@@ -10,7 +10,7 @@ public enum Team{
crux(Color.valueOf("e82d2d")),
green(Color.valueOf("4dd98b")),
purple(Color.valueOf("9a4bdf")),
blue(Color.ROYAL.cpy());
blue(Color.royal.cpy());
public final static Team[] all = values();
public final Color color;

View File

@@ -271,20 +271,20 @@ public class Tutorial{
Element element = Core.scene.findVisible(name);
if(element != null && !toggled(name)){
element.localToStageCoordinates(Tmp.v1.setZero());
float sin = Mathf.sin(11f, UnitScl.dp.scl(4f));
Lines.stroke(UnitScl.dp.scl(7f), Pal.place);
float sin = Mathf.sin(11f, Scl.scl(4f));
Lines.stroke(Scl.scl(7f), Pal.place);
Lines.rect(Tmp.v1.x - sin, Tmp.v1.y - sin, element.getWidth() + sin*2, element.getHeight() + sin*2);
float size = Math.max(element.getWidth(), element.getHeight()) + Mathf.absin(11f/2f, UnitScl.dp.scl(18f));
float size = Math.max(element.getWidth(), element.getHeight()) + Mathf.absin(11f/2f, Scl.scl(18f));
float angle = Angles.angle(Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, Tmp.v1.x + element.getWidth()/2f, Tmp.v1.y + element.getHeight()/2f);
Tmp.v2.trns(angle + 180f, size*1.4f);
float fs = UnitScl.dp.scl(40f);
float fs2 = UnitScl.dp.scl(56f);
float fs = Scl.scl(40f);
float fs2 = Scl.scl(56f);
Draw.color(Pal.gray);
Drawf.tri(Tmp.v1.x + element.getWidth()/2f + Tmp.v2.x, Tmp.v1.y + element.getHeight()/2f + Tmp.v2.y, fs2, fs2, angle);
Draw.color(Pal.place);
Tmp.v2.setLength(Tmp.v2.len() - UnitScl.dp.scl(4));
Tmp.v2.setLength(Tmp.v2.len() - Scl.scl(4));
Drawf.tri(Tmp.v1.x + element.getWidth()/2f + Tmp.v2.x, Tmp.v1.y + element.getHeight()/2f + Tmp.v2.y, fs, fs, angle);
Draw.reset();
}

View File

@@ -44,7 +44,7 @@ public class BlockRenderer implements Disposable{
shadows.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
shadows.resize(world.width(), world.height());
shadows.begin();
Core.graphics.clear(Color.WHITE);
Core.graphics.clear(Color.white);
Draw.proj().setOrtho(0, 0, shadows.getWidth(), shadows.getHeight());
Draw.color(shadowColor);
@@ -65,7 +65,7 @@ public class BlockRenderer implements Disposable{
fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
fog.resize(world.width(), world.height());
fog.begin();
Core.graphics.clear(Color.WHITE);
Core.graphics.clear(Color.white);
Draw.proj().setOrtho(0, 0, fog.getWidth(), fog.getHeight());
for(int x = 0; x < world.width(); x++){
@@ -129,10 +129,10 @@ public class BlockRenderer implements Disposable{
for(Tile tile : shadowEvents){
//clear it first
Draw.color(Color.WHITE);
Draw.color(Color.white);
Fill.rect(tile.x + 0.5f, tile.y + 0.5f, 1, 1);
//then draw the shadow
Draw.color(!tile.block().hasShadow ? Color.WHITE : shadowColor);
Draw.color(!tile.block().hasShadow ? Color.white : shadowColor);
Fill.rect(tile.x + 0.5f, tile.y + 0.5f, 1, 1);
}

View File

@@ -47,7 +47,7 @@ public enum CacheLayer{
renderer.blocks.floor.endc();
renderer.shieldBuffer.begin();
Core.graphics.clear(Color.CLEAR);
Core.graphics.clear(Color.clear);
renderer.blocks.floor.beginc();
}

View File

@@ -53,7 +53,7 @@ public class IndexedRenderer implements Disposable{
private Matrix3 projMatrix = new Matrix3();
private Matrix3 transMatrix = new Matrix3();
private Matrix3 combined = new Matrix3();
private float color = Color.WHITE.toFloatBits();
private float color = Color.white.toFloatBits();
public IndexedRenderer(int sprites){
resize(sprites);

View File

@@ -8,7 +8,7 @@ import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.graphics.glutils.FrameBuffer;
import io.anuke.arc.math.*;
import io.anuke.arc.scene.ui.layout.UnitScl;
import io.anuke.arc.scene.ui.layout.Scl;
import io.anuke.arc.util.*;
import io.anuke.arc.util.noise.RidgedPerlin;
import io.anuke.arc.util.noise.Simplex;
@@ -168,8 +168,8 @@ public class MenuRenderer implements Disposable{
//draw shadows
Draw.proj().setOrtho(0, 0, shadows.getWidth(), shadows.getHeight());
shadows.beginDraw(Color.CLEAR);
Draw.color(Color.BLACK);
shadows.beginDraw(Color.clear);
Draw.color(Color.black);
for(int x = 0; x < width; x++){
for(int y = 0; y < height; y++){
if(world.rawTile(x, y).block() != Blocks.air){
@@ -220,7 +220,7 @@ public class MenuRenderer implements Disposable{
public void render(){
time += Time.delta();
float scaling = Math.max(UnitScl.dp.scl(4f), Math.max(Core.graphics.getWidth() / ((width - 1f) * tilesize), Core.graphics.getHeight() / ((height - 1f) * tilesize)));
float scaling = Math.max(Scl.scl(4f), Math.max(Core.graphics.getWidth() / ((width - 1f) * tilesize), Core.graphics.getHeight() / ((height - 1f) * tilesize)));
camera.position.set(width * tilesize / 2f, height * tilesize / 2f);
camera.resize(Core.graphics.getWidth() / scaling,
Core.graphics.getHeight() / scaling);
@@ -270,7 +270,7 @@ public class MenuRenderer implements Disposable{
Fill.circle(x + Angles.trnsx(rotation + 180, engineOffset), y + Angles.trnsy(rotation + 180, engineOffset),
engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f));
Draw.color(Color.WHITE);
Draw.color(Color.white);
Fill.circle(x + Angles.trnsx(rotation + 180, engineOffset - 1f), y + Angles.trnsy(rotation + 180, engineOffset - 1f),
(engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f)) / 2f);
Draw.color();

View File

@@ -82,7 +82,7 @@ public class MinimapRenderer implements Disposable{
for(Unit unit : units){
float rx = (unit.x - rect.x) / rect.width * w, ry = (unit.y - rect.y) / rect.width * h;
Draw.color(unit.getTeam().color);
Fill.rect(x + rx, y + ry, UnitScl.dp.scl(baseSize / 2f), UnitScl.dp.scl(baseSize / 2f));
Fill.rect(x + rx, y + ry, Scl.scl(baseSize / 2f), Scl.scl(baseSize / 2f));
}
Draw.color();

View File

@@ -84,7 +84,7 @@ public class OverlayRenderer{
for(Tile core : state.teams.get(enemy).cores){
float dst = Mathf.dst(player.x, player.y, core.drawx(), core.drawy());
if(dst < state.rules.enemyCoreBuildRadius * 1.5f){
Draw.color(Color.DARK_GRAY);
Draw.color(Color.darkGray);
Lines.circle(core.drawx(), core.drawy() - 2, state.rules.enemyCoreBuildRadius);
Draw.color(Pal.accent, enemy.color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f));
Lines.circle(core.drawx(), core.drawy(), state.rules.enemyCoreBuildRadius);
@@ -94,7 +94,7 @@ public class OverlayRenderer{
}
Lines.stroke(2f);
Draw.color(Color.GRAY, Color.LIGHT_GRAY, Mathf.absin(Time.time(), 8f, 1f));
Draw.color(Color.gray, Color.lightGray, Mathf.absin(Time.time(), 8f, 1f));
for(Tile tile : spawner.getGroundSpawns()){
if(tile.withinDst(player.x, player.y, state.rules.dropZoneRadius + spawnerMargin)){

View File

@@ -51,7 +51,7 @@ public class Pal{
health = Color.valueOf("ff341c"),
heal = Color.valueOf("98ffa9"),
bar = Color.SLATE,
bar = Color.slate,
accent = Color.valueOf("ffd37f"),
stat = Color.valueOf("ffd37f"),
gray = Color.valueOf("454545"),

View File

@@ -5,7 +5,7 @@ import io.anuke.arc.Core;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.graphics.glutils.Shader;
import io.anuke.arc.scene.ui.layout.UnitScl;
import io.anuke.arc.scene.ui.layout.Scl;
import io.anuke.arc.util.Time;
public class Shaders{
@@ -48,7 +48,7 @@ public class Shaders{
setUniformf("u_resolution", Core.graphics.getWidth(), Core.graphics.getHeight());
setUniformi("u_time", (int)(time += Core.graphics.getDeltaTime() * 60f));
setUniformf("u_uv", Core.atlas.white().getU(), Core.atlas.white().getV());
setUniformf("u_scl", UnitScl.dp.scl(1f));
setUniformf("u_scl", Scl.scl(1f));
setUniformf("u_uv2", Core.atlas.white().getU2(), Core.atlas.white().getV2());
}
}
@@ -124,8 +124,8 @@ public class Shaders{
@Override
public void apply(){
setUniformf("u_dp", UnitScl.dp.scl(1f));
setUniformf("u_time", Time.time() / UnitScl.dp.scl(1f));
setUniformf("u_dp", Scl.scl(1f));
setUniformf("u_time", Time.time() / Scl.scl(1f));
setUniformf("u_offset",
Core.camera.position.x - Core.camera.width / 2,
Core.camera.position.y - Core.camera.height / 2);

View File

@@ -52,7 +52,7 @@ public abstract class InputHandler implements InputProcessor{
throw new ValidateException(player, "Player cannot drop an item.");
}
Effects.effect(Fx.dropItem, Color.WHITE, player.x, player.y, angle, player.item().item);
Effects.effect(Fx.dropItem, Color.white, player.x, player.y, angle, player.item().item);
player.clearItem();
}

View File

@@ -31,7 +31,7 @@ public class MobileInput extends InputHandler implements GestureListener{
private static final float maxPanSpeed = 1.3f;
private static Rectangle r1 = new Rectangle(), r2 = new Rectangle();
/** Distance to edge of screen to start panning. */
private final float edgePan = UnitScl.dp.scl(60f);
private final float edgePan = Scl.scl(60f);
//gesture data
private Vector2 vector = new Vector2();
@@ -192,7 +192,7 @@ public class MobileInput extends InputHandler implements GestureListener{
TextureRegion region = placeDraw.region;
Draw.mixcol(Pal.accent, Mathf.clamp((1f - request.scale) / 0.5f + 0.12f + Mathf.absin(Time.time(), 8f, 0.35f)));
Draw.tint(Color.WHITE, Pal.breakInvalid, request.redness);
Draw.tint(Color.white, Pal.breakInvalid, request.redness);
Draw.rect(region, tile.worldx() + offset, tile.worldy() + offset,
region.getWidth() * request.scale * Draw.scl * placeDraw.scalex,

View File

@@ -207,7 +207,7 @@ public class LegacyMapIO{
if(block.ore != null) tile.setOverlay(block.ore);
//place core
if(color == Color.rgba8888(Color.GREEN)){
if(color == Color.rgba8888(Color.green)){
for(int dx = 0; dx < 3; dx++){
for(int dy = 0; dy < 3; dy++){
int worldx = dx - 1 + x;

View File

@@ -73,7 +73,7 @@ public class MapIO{
Pixmap floors = new Pixmap(map.width, map.height, Format.RGBA8888);
Pixmap walls = new Pixmap(map.width, map.height, Format.RGBA8888);
int black = Color.rgba8888(Color.BLACK);
int black = Color.rgba8888(Color.black);
int shade = Color.rgba8888(0f, 0f, 0f, 0.5f);
CachedTile tile = new CachedTile(){
@Override

View File

@@ -59,7 +59,7 @@ public class MirrorFilter extends GenerateFilter{
clamper.accept(Tmp.v1.trns(angle - 90, size).add(image.getWidth()/2f + image.getX(), image.getHeight()/2f + image.getY()));
clamper.accept(Tmp.v2.set(Tmp.v1).sub(image.getWidth()/2f + image.getX(), image.getHeight()/2f + image.getY()).rotate(180f).add(image.getWidth()/2f + image.getX(), image.getHeight()/2f + image.getY()));
Lines.stroke(UnitScl.dp.scl(3f), Pal.accent);
Lines.stroke(Scl.scl(3f), Pal.accent);
Lines.line(Tmp.v1.x, Tmp.v1.y, Tmp.v2.x, Tmp.v2.y);
Draw.reset();
}

View File

@@ -17,7 +17,7 @@ public class StatusEffect extends Content{
public float damageMultiplier = 1f; //damage dealt
public float armorMultiplier = 1f; //armor points
public float speedMultiplier = 1f; //speed
public Color color = Color.WHITE.cpy(); //tint color
public Color color = Color.white.cpy(); //tint color
/** Transition handler map. */
private ObjectMap<StatusEffect, TransitionHandler> transitions = new ObjectMap<>();

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();
}

View File

@@ -258,7 +258,7 @@ public class Block extends BlockStorage{
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
boolean ints = font.usesIntegerPositions();
font.setUseIntegerPositions(false);
font.getData().setScale(1f / 4f / UnitScl.dp.scl(1f));
font.getData().setScale(1f / 4f / Scl.scl(1f));
layout.setText(font, text);
float width = layout.width;
@@ -267,13 +267,13 @@ public class Block extends BlockStorage{
float dx = x * tilesize + offset(), dy = y * tilesize + offset() + size * tilesize / 2f + 3;
font.draw(text, dx, dy + layout.height + 1, Align.center);
dy -= 1f;
Lines.stroke(2f, Color.DARK_GRAY);
Lines.stroke(2f, Color.darkGray);
Lines.line(dx - layout.width / 2f - 2f, dy, dx + layout.width / 2f + 1.5f, dy);
Lines.stroke(1f, color);
Lines.line(dx - layout.width / 2f - 2f, dy, dx + layout.width / 2f + 1.5f, dy);
font.setUseIntegerPositions(ints);
font.setColor(Color.WHITE);
font.setColor(Color.white);
font.getData().setScale(1f);
Draw.reset();
Pools.free(layout);
@@ -488,7 +488,7 @@ public class Block extends BlockStorage{
}
public void setBars(){
bars.add("health", entity -> new Bar("blocks.health", Pal.health, entity::healthf).blink(Color.WHITE));
bars.add("health", entity -> new Bar("blocks.health", Pal.health, entity::healthf).blink(Color.white));
if(hasLiquids){
Function<TileEntity, Liquid> current;

View File

@@ -32,7 +32,7 @@ public class DeflectorWall extends Wall{
if(entity.hit < 0.0001f) return;
Draw.color(Color.WHITE);
Draw.color(Color.white);
Draw.alpha(entity.hit * 0.5f);
Draw.blend(Blending.additive);
Fill.rect(tile.drawx(), tile.drawy(), tilesize * size, tilesize * size);

View File

@@ -247,7 +247,7 @@ public class ForceProjector extends Block{
public void drawOver(){
if(entity.hit <= 0f) return;
Draw.color(Color.WHITE);
Draw.color(Color.white);
Draw.alpha(entity.hit);
Fill.poly(x, y, 6, realRadius(entity));
Draw.color();

View File

@@ -217,7 +217,7 @@ public class ItemBridge extends Block{
int i = tile.absoluteRelativeTo(other.x, other.y);
Draw.color(Color.WHITE, Color.BLACK, Mathf.absin(Time.time(), 6f, 0.07f));
Draw.color(Color.white, Color.black, Mathf.absin(Time.time(), 6f, 0.07f));
Draw.alpha(Math.max(entity.uptime, 0.25f));
Draw.rect(endRegion, tile.drawx(), tile.drawy(), i * 90 + 90);

View File

@@ -166,7 +166,7 @@ public class NuclearReactor extends PowerGenerator{
if(entity.heat > flashThreshold){
float flash = 1f + ((entity.heat - flashThreshold) / (1f - flashThreshold)) * 5.4f;
entity.flash += flash * Time.delta();
Draw.color(Color.RED, Color.YELLOW, Mathf.absin(entity.flash, 9f, 1f));
Draw.color(Color.red, Color.yellow, Mathf.absin(entity.flash, 9f, 1f));
Draw.alpha(0.6f);
Draw.rect(lightsRegion, tile.drawx(), tile.drawy());
}

View File

@@ -12,7 +12,6 @@ import io.anuke.arc.util.*;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.ui.*;
import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.blocks.*;
@@ -286,7 +285,7 @@ public class PowerNode extends PowerBlock{
float fract = 1f-tile.entity.power.graph.getSatisfaction();
Draw.color(Color.WHITE, Pal.powerLight, fract*0.86f + Mathf.absin(3f, 0.1f));
Draw.color(Color.white, Pal.powerLight, fract*0.86f + Mathf.absin(3f, 0.1f));
Drawf.laser(laser, laserEnd, x1, y1, x2, y2, 0.4f);
Draw.color();
}

View File

@@ -142,7 +142,7 @@ public class Drill extends Block{
if(returnItem != null){
float width = drawPlaceText(Core.bundle.formatFloat("bar.drillspeed", 60f / (drillTime + hardnessDrillMultiplier * returnItem.hardness) * returnCount, 2), x, y, valid);
float dx = x * tilesize + offset() - width/2f - 4f, dy = y * tilesize + offset() + size * tilesize / 2f + 5;
Draw.mixcol(Color.DARK_GRAY, 1f);
Draw.mixcol(Color.darkGray, 1f);
Draw.rect(returnItem.icon(Item.Icon.large), dx, dy - 1);
Draw.reset();
Draw.rect(returnItem.icon(Item.Icon.large), dx, dy);
@@ -161,7 +161,7 @@ public class Drill extends Block{
if(entity.dominantItem != null){
float dx = tile.drawx() - size * tilesize/2f, dy = tile.drawy() + size * tilesize/2f;
Draw.mixcol(Color.DARK_GRAY, 1f);
Draw.mixcol(Color.darkGray, 1f);
Draw.rect(entity.dominantItem.icon(Item.Icon.large), dx, dy);
Draw.reset();
Draw.rect(entity.dominantItem.icon(Item.Icon.medium), dx, dy);

View File

@@ -77,7 +77,7 @@ public class Unloader extends Block{
SortedUnloaderEntity entity = tile.entity();
Draw.color(entity.sortItem == null ? Color.CLEAR : entity.sortItem.color);
Draw.color(entity.sortItem == null ? Color.clear : entity.sortItem.color);
Fill.square(tile.worldx(), tile.worldy(), 1f);
Draw.color();
}