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

@@ -243,7 +243,7 @@ public class EntityProcess extends BaseProcessor{
fbuilder.initializer(varInitializers.get(f)); fbuilder.initializer(varInitializers.get(f));
} }
if(!isFinal) fbuilder.addModifiers(Modifier.PROTECTED); fbuilder.addModifiers(f.has(ReadOnly.class) ? Modifier.PROTECTED : Modifier.PUBLIC);
fbuilder.addAnnotations(f.annotations().map(AnnotationSpec::get)); fbuilder.addAnnotations(f.annotations().map(AnnotationSpec::get));
builder.addField(fbuilder.build()); builder.addField(fbuilder.build());
specVariables.put(builder.fieldSpecs.get(builder.fieldSpecs.size() - 1), f); specVariables.put(builder.fieldSpecs.get(builder.fieldSpecs.size() - 1), f);

View File

@@ -115,6 +115,14 @@ public class Drawf{
Draw.reset(); 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){ public static void square(float x, float y, float radius, Color color){
Lines.stroke(3f, Pal.gray); Lines.stroke(3f, Pal.gray);
Lines.square(x, y, radius + 1f, 45); Lines.square(x, y, radius + 1f, 45);

View File

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

View File

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