This commit is contained in:
Anuken 2019-08-30 20:11:48 -04:00
parent 60306f146f
commit 52332e5821
3 changed files with 16 additions and 15 deletions

View File

@ -18,7 +18,7 @@ import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.game.*;
import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.input.*;
import io.anuke.mindustry.maps.*;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.ui.dialogs.*;
@ -26,8 +26,8 @@ import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.blocks.storage.*;
import java.io.*;
import java.time.*;
import java.time.format.*;
import java.text.*;
import java.util.*;
import static io.anuke.arc.Core.*;
import static io.anuke.mindustry.Vars.*;
@ -233,7 +233,7 @@ public class Control implements ApplicationListener, Loadable{
state.rules = rules;
logic.play();
if(settings.getBool("savecreate")){
control.saves.addSave(map.name() + "-" + DateTimeFormatter.ofPattern("MMM dd h:mm").format(LocalDateTime.now()));
control.saves.addSave(map.name() + " " + new SimpleDateFormat("MMM dd h:mm", Locale.getDefault()).format(new Date()));
}
});
}

View File

@ -206,6 +206,7 @@ public class Saves{
previewExecutor.submit(() -> {
try{
previewFile().writePNG(renderer.minimap.getPixmap());
requestedPreview = false;
}catch(Throwable t){
t.printStackTrace();
}

View File

@ -67,7 +67,7 @@ public class LoadDialog extends FloatingDialog{
button.defaults().left();
button.table(title -> {
title.add("[accent]" + slot.getName()).left().growX();
title.add("[accent]" + slot.getName()).left().growX().width(230f).wrap();
title.table(t -> {
t.right();
@ -119,7 +119,7 @@ public class LoadDialog extends FloatingDialog{
String color = "[lightgray]";
TextureRegion def = Core.atlas.find("nomap");
button.add(new BorderImage(def, 4f)).update(i -> {
button.left().add(new BorderImage(def, 4f)).update(i -> {
TextureRegionDrawable draw = (TextureRegionDrawable)i.getDrawable();
if(draw.getRegion().getTexture().isDisposed()){
draw.setRegion(def);
@ -129,23 +129,23 @@ public class LoadDialog extends FloatingDialog{
if(draw.getRegion() == def && text != null){
draw.setRegion(new TextureRegion(text));
}
}).size(160f).padRight(5);
}).left().size(160f).padRight(5);
button.table(meta -> {
meta.left();
meta.defaults().padBottom(3).left();
meta.left().top();
meta.defaults().padBottom(-2).left().width(250f);
meta.row();
meta.add(Core.bundle.format("save.map", color + (slot.getMap() == null ? Core.bundle.get("unknown") : slot.getMap().name())));
meta.labelWrap(Core.bundle.format("save.map", color + (slot.getMap() == null ? Core.bundle.get("unknown") : slot.getMap().name())));
meta.row();
meta.add(Core.bundle.format("save.wave", color + slot.getWave()));
meta.labelWrap(Core.bundle.format("save.wave", color + slot.getWave()));
meta.row();
meta.label(() -> Core.bundle.format("save.autosave", color + Core.bundle.get(slot.isAutosave() ? "on" : "off")));
meta.labelWrap(() -> Core.bundle.format("save.autosave", color + Core.bundle.get(slot.isAutosave() ? "on" : "off")));
meta.row();
meta.label(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime()));
meta.labelWrap(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime()));
meta.row();
meta.add(Core.bundle.format("save.date", color + slot.getDate())).colspan(2).padTop(5).right();
meta.labelWrap(Core.bundle.format("save.date", color + slot.getDate()));
meta.row();
});
}).left().growX().width(250f);
modifyButton(button, slot);