This commit is contained in:
Anuken
2019-10-19 19:54:41 -04:00
parent 0faae5d5ca
commit a2a4c8c43d
4 changed files with 30 additions and 8 deletions

View File

@ -797,6 +797,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
textFadeTime = 0f;
target = null;
moveTarget = null;
isShooting = isBoosting = isBuilding = isTransferring = isTyping = false;
spawner = lastSpawner = null;
health = maxHealth();
mining = null;

View File

@ -4,11 +4,11 @@ import io.anuke.arc.*;
import io.anuke.arc.Graphics.*;
import io.anuke.arc.Graphics.Cursor.*;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.input.*;
import io.anuke.arc.math.*;
import io.anuke.arc.scene.*;
import io.anuke.arc.scene.event.*;
import io.anuke.arc.scene.ui.*;
import io.anuke.arc.scene.ui.layout.*;
import io.anuke.arc.util.ArcAnnotate.*;
import io.anuke.mindustry.*;
import io.anuke.mindustry.core.GameState.*;
@ -252,6 +252,17 @@ public class DesktopInput extends InputHandler{
return mode == breaking;
}
@Override
public void buildPlacementUI(Table table){
table.addImage().color(Pal.gray).height(4f).colspan(4).growX();
table.row();
table.left().margin(0f).defaults().size(48f).left();
table.addImageButton(Icon.wikiSmall, Styles.clearPartiali, () -> {
ui.schematics.show();
});
}
void pollInput(){
Tile selected = tileAt(Core.input.mouseX(), Core.input.mouseY());
int cursorX = tileX(Core.input.mouseX());
@ -306,11 +317,6 @@ public class DesktopInput extends InputHandler{
}
}
//TODO remove
if(Core.input.keyTap(KeyCode.V)){
ui.schematics.show();
}
if(sreq != null){
float offset = ((sreq.block.size + 2) % 2) * tilesize / 2f;
float x = Core.input.mouseWorld().x + offset;

View File

@ -105,8 +105,18 @@ public class TechTreeDialog extends FloatingDialog{
RadialTreeLayout layout = new RadialTreeLayout();
LayoutNode node = new LayoutNode(root, null);
layout.layout(node);
//bounds.y += nodeSize*1.5f;
float minx = 0f, miny = 0f, maxx = 0f, maxy = 0f;
copyInfo(node);
for(TechTreeNode n : nodes){
minx = Math.min(n.x - n.width/2f, minx);
maxx = Math.max(n.x + n.width/2f, maxx);
miny = Math.min(n.y - n.height/2f, miny);
maxy = Math.max(n.y + n.height/2f, maxy);
}
bounds = new Rectangle(minx, miny, maxx - minx, maxy - miny);
bounds.y += nodeSize*1.5f;
Log.info(bounds);
}
void copyInfo(LayoutNode node){
@ -262,7 +272,7 @@ public class TechTreeDialog extends FloatingDialog{
float rx = bounds.x + panX + ox, ry = panY + oy + bounds.y;
float rw = bounds.width, rh = bounds.height;
rx = Mathf.clamp(rx, -rw + pad, Core.graphics.getWidth() - pad);
ry = Mathf.clamp(ry, pad, Core.graphics.getHeight() - rh - pad);
ry = Mathf.clamp(ry, -rh + pad, Core.graphics.getHeight() - pad);
panX = rx - bounds.x - ox;
panY = ry - bounds.y - oy;
}

View File

@ -34,6 +34,11 @@ public class Fracker extends SolidPump{
topRegion = Core.atlas.find(name + "-top");
}
@Override
public boolean outputsItems(){
return false;
}
@Override
public void drawCracks(Tile tile){}