Merge branch 'master' of https://github.com/Anuken/Mindustry into schematics

This commit is contained in:
Anuken
2019-10-17 21:58:55 -04:00
29 changed files with 1937 additions and 1416 deletions

View File

@@ -48,6 +48,7 @@ public class LoadoutDialog extends FloatingDialog{
buttons.addImageTextButton("$settings.reset", Icon.refreshSmall, () -> {
resetter.run();
reseed();
updater.run();
setup();
}).size(210f, 64f);
@@ -55,10 +56,7 @@ public class LoadoutDialog extends FloatingDialog{
public void show(int capacity, Array<ItemStack> stacks, Runnable reseter, Runnable updater, Runnable hider){
this.originalStacks = stacks;
this.stacks = stacks.map(ItemStack::copy);
this.stacks.addAll(content.items().select(i -> i.type == ItemType.material &&
!stacks.contains(stack -> stack.item == i)).map(i -> new ItemStack(i, 0)));
this.stacks.sort(Structs.comparingInt(s -> s.item.id));
reseed();
this.resetter = reseter;
this.updater = updater;
this.capacity = capacity;
@@ -110,6 +108,13 @@ public class LoadoutDialog extends FloatingDialog{
}
}
private void reseed(){
this.stacks = originalStacks.map(ItemStack::copy);
this.stacks.addAll(content.items().select(i -> i.type == ItemType.material &&
!stacks.contains(stack -> stack.item == i)).map(i -> new ItemStack(i, 0)));
this.stacks.sort(Structs.comparingInt(s -> s.item.id));
}
private int step(int amount){
if(amount < 1000){
return 100;

View File

@@ -41,11 +41,11 @@ public class ModsDialog extends FloatingDialog{
mods.reloadContent();
setup();
ui.loadfrag.hide();
}catch(Exception e){
}catch(Throwable e){
ui.showException(e);
}
});
}catch(Exception e){
}catch(Throwable e){
ui.showException(e);
}
}, t -> Core.app.post(() -> ui.showException(t)));

View File

@@ -250,8 +250,9 @@ public class HudFragment extends Fragment{
});
parent.fill(t -> {
t.visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial);
//minimap
t.add(new Minimap().visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial));
t.add(new Minimap());
t.row();
//position
t.label(() -> world.toTile(player.x) + "," + world.toTile(player.y))