Finish map editor core functionality

This commit is contained in:
Anuken
2017-12-19 00:05:41 -05:00
parent 7953a21073
commit a6e72c93f0
38 changed files with 712 additions and 335 deletions

View File

@@ -1,6 +1,7 @@
package io.anuke.mindustry.ui;
import com.badlogic.gdx.graphics.Colors;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import io.anuke.ucore.core.Draw;
@@ -8,6 +9,18 @@ import io.anuke.ucore.scene.ui.Image;
import io.anuke.ucore.scene.ui.layout.Unit;
public class BorderImage extends Image{
private float thickness = 3f;
public BorderImage(){}
public BorderImage(Texture texture){
super(texture);
}
public BorderImage(Texture texture, float thick){
super(texture);
thickness = thick;
}
@Override
public void draw(Batch batch, float alpha){
@@ -17,7 +30,7 @@ public class BorderImage extends Image{
float scaleY = getScaleY();
Draw.color(Colors.get("accent"));
Draw.thick(Unit.dp.inPixels(3f));
Draw.thick(Unit.dp.inPixels(thickness));
Draw.linerect(x + imageX, y + imageY, imageWidth * scaleX, imageHeight * scaleY);
Draw.reset();
}

View File

@@ -23,11 +23,16 @@ public class LevelDialog extends FloatingDialog{
super("Level Select");
getTitleTable().getCell(title()).growX().center();
getTitleTable().center();
addCloseButton();
setup();
}
public void reload(){
content().clear();
setup();
}
void setup(){
addCloseButton();
Table maps = new Table();
ScrollPane pane = new ScrollPane(maps);
pane.setFadeScrollBars(false);