Implemented replacement blocks

This commit is contained in:
Anuken
2017-09-07 22:14:21 -04:00
parent a5e877028e
commit d53f12aeb9
14 changed files with 47 additions and 15 deletions

View File

@@ -337,17 +337,30 @@ public class UI extends SceneModule{
new table(){{
atop();
aleft();
itemtable = new table().top().left().get();
itemtable.background("button");
defaults().size(60).units(Unit.dp);
new button("M", ()->{
});
new button("P", ()->{
});
new button("S", ()->{
});
row();
itemtable = new table("button").end().top().left().colspan(3).fillX().size(-1).get();
get().setVisible(play);
Label fps = new Label("");
fps.update(()->{
fps.setText(Settings.getBool("fps") ? (Gdx.graphics.getFramesPerSecond() + " FPS") : "");
});
Label fps = new Label(()->(Settings.getBool("fps") ? (Gdx.graphics.getFramesPerSecond() + " FPS") : ""));
row();
add(fps);
add(fps).colspan(3).size(-1);
}}.end();
@@ -599,13 +612,14 @@ public class UI extends SceneModule{
public void updateItems(){
itemtable.clear();
itemtable.left();
for(Item stack : Inventory.getItemTypes()){
Image image = new Image(Draw.region("icon-" + stack.name()));
Label label = new Label("" + Inventory.getAmount(stack));
label.setFontScale(fontscale*2f);
itemtable.add(image).size(32).units(Unit.dp);
itemtable.add(label);
itemtable.add(label).left();
itemtable.row();
}
}