This commit is contained in:
Anuken
2019-07-06 18:42:05 -04:00
parent ec7bb78ee4
commit 3dfef06bba
26 changed files with 29 additions and 15 deletions

View File

@@ -14,13 +14,21 @@ public class MapPlayDialog extends FloatingDialog{
CustomRulesDialog dialog = new CustomRulesDialog();
Rules rules;
Gamemode selectedGamemode = Gamemode.survival;
Map lastMap;
public MapPlayDialog(){
super("");
setFillParent(false);
onResize(() -> {
if(lastMap != null){
show(lastMap);
}
});
}
public void show(Map map){
this.lastMap = map;
title.setText(map.name());
cont.clearChildren();

View File

@@ -52,6 +52,7 @@ public class BlockInventoryFragment extends Fragment{
@Override
public void build(Group parent){
table = new Table();
table.setName("inventory");
table.setTransform(true);
parent.setTransform(true);
parent.addChild(table);
@@ -69,10 +70,11 @@ public class BlockInventoryFragment extends Fragment{
}
public void hide(){
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interpolation.pow3Out), Actions.visible(false), Actions.run(() -> {
table.clear();
table.actions(Actions.scaleTo(0f, 1f, 0.06f, Interpolation.pow3Out), Actions.run(() -> {
table.clearChildren();
table.clearListeners();
table.update(null);
}));
}), Actions.visible(false));
table.touchable(Touchable.disabled);
tile = null;
}
@@ -82,9 +84,11 @@ public class BlockInventoryFragment extends Fragment{
IntSet container = new IntSet();
table.clearChildren();
table.clearActions();
table.background("inventory");
table.touchable(Touchable.enabled);
table.update(() -> {
if(state.is(State.menu) || tile == null || tile.entity == null || !tile.block().isAccessible() || tile.entity.items.total() == 0){
hide();
}else{
@@ -170,9 +174,13 @@ public class BlockInventoryFragment extends Fragment{
updateTablePosition();
table.visible(true);
if(actions){
table.actions(Actions.scaleTo(0f, 1f), Actions.visible(true),
Actions.scaleTo(1f, 1f, 0.07f, Interpolation.pow3Out));
table.setScale(0f, 1f);
table.actions(Actions.scaleTo(1f, 1f, 0.07f, Interpolation.pow3Out));
}else{
table.setScale(1f, 1f);
}
}

View File

@@ -146,7 +146,7 @@ public class MenuFragment extends Fragment{
new Buttoni("$play", "icon-play-2",
new Buttoni("$campaign", "icon-play-2", ui.deploy::show),
new Buttoni("$joingame", "icon-add", ui.join::show),
new Buttoni("$customgame", "icon-terrain", ui.custom::show),
new Buttoni("$customgame", "icon-editor", ui.custom::show),
new Buttoni("$loadgame", "icon-load", ui.load::show)
),
new Buttoni("$editor", "icon-editor", ui.maps::show),