Minor tweaks

This commit is contained in:
Anuken
2020-05-10 17:22:13 -04:00
parent c0ea4737fd
commit 686c451ea6
4 changed files with 13 additions and 11 deletions

View File

@@ -115,6 +115,14 @@ public class Drawf{
Draw.reset();
}
public static void select(float x, float y, float radius, Color color){
Lines.stroke(3f, Pal.gray);
Lines.square(x, y, radius + 1f);
Lines.stroke(1f, color);
Lines.square(x, y, radius);
Draw.reset();
}
public static void square(float x, float y, float radius, Color color){
Lines.stroke(3f, Pal.gray);
Lines.square(x, y, radius + 1f, 45);

View File

@@ -23,7 +23,7 @@ import static arc.Core.*;
public class LoadRenderer implements Disposable{
private static final Color color = new Color(Pal.accent).lerp(Color.black, 0.5f);
private static final Color colorRed = Pal.breakInvalid.lerp(Color.black, 0.3f);
private static final Color colorRed = Pal.breakInvalid.cpy().lerp(Color.black, 0.3f);
private static final String red = "[#" + colorRed + "]";
private static final String orange = "[#" + color + "]";
private static final FloatArray floats = new FloatArray();

View File

@@ -142,25 +142,19 @@ public class ItemBridge extends Block{
@Override
public void drawConfigure(){
Draw.color(Pal.accent);
Lines.stroke(1f);
Lines.square(x, y,
tile.block().size * tilesize / 2f + 1f);
Drawf.select(x, y, tile.block().size * tilesize / 2f + 2f, Pal.accent);
for(int i = 1; i <= range; i++){
for(int j = 0; j < 4; j++){
Tile other = tile.getNearby(Geometry.d4[j].x * i, Geometry.d4[j].y * i);
if(linkValid(tile, other)){
boolean linked = other.pos() == link;
Draw.color(linked ? Pal.place : Pal.breakInvalid);
Lines.square(other.drawx(), other.drawy(),
other.block().size * tilesize / 2f + 1f + (linked ? 0f : Mathf.absin(Time.time(), 4f, 1f)));
Drawf.select(other.drawx(), other.drawy(),
other.block().size * tilesize / 2f + 2f + (linked ? 0f : Mathf.absin(Time.time(), 4f, 1f)), linked ? Pal.place : Pal.breakInvalid);
}
}
}
Draw.reset();
}
@Override