mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-10 15:57:37 +07:00
Automatic custom game saves
This commit is contained in:
@ -525,6 +525,7 @@ setting.mutemusic.name = Mute Music
|
|||||||
setting.sfxvol.name = SFX Volume
|
setting.sfxvol.name = SFX Volume
|
||||||
setting.mutesound.name = Mute Sound
|
setting.mutesound.name = Mute Sound
|
||||||
setting.crashreport.name = Send Anonymous Crash Reports
|
setting.crashreport.name = Send Anonymous Crash Reports
|
||||||
|
setting.savecreate.name = Auto-Create Saves
|
||||||
setting.chatopacity.name = Chat Opacity
|
setting.chatopacity.name = Chat Opacity
|
||||||
setting.playerchat.name = Display In-Game Chat
|
setting.playerchat.name = Display In-Game Chat
|
||||||
uiscale.reset = UI scale has been changed.\nPress "OK" to confirm this scale.\n[scarlet]Reverting and exiting in[accent] {0}[] seconds...
|
uiscale.reset = UI scale has been changed.\nPress "OK" to confirm this scale.\n[scarlet]Reverting and exiting in[accent] {0}[] seconds...
|
||||||
|
@ -26,6 +26,8 @@ import io.anuke.mindustry.world.*;
|
|||||||
import io.anuke.mindustry.world.blocks.storage.*;
|
import io.anuke.mindustry.world.blocks.storage.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.time.*;
|
||||||
|
import java.time.format.*;
|
||||||
|
|
||||||
import static io.anuke.arc.Core.*;
|
import static io.anuke.arc.Core.*;
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@ -230,6 +232,9 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
world.loadMap(map, rules);
|
world.loadMap(map, rules);
|
||||||
state.rules = rules;
|
state.rules = rules;
|
||||||
logic.play();
|
logic.play();
|
||||||
|
if(settings.getBool("savecreate")){
|
||||||
|
control.saves.addSave(map.name() + "-" + DateTimeFormatter.ofPattern("MMM dd h:mm").format(LocalDateTime.now()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
Time.runTask(2f, () -> Core.scene.setScrollFocus(pane));
|
Time.runTask(2f, () -> Core.scene.setScrollFocus(pane));
|
||||||
|
|
||||||
Array<SaveSlot> array = control.saves.getSaveSlots();
|
Array<SaveSlot> array = control.saves.getSaveSlots();
|
||||||
|
array.sort((slot, other) -> -Long.compare(slot.getTimestamp(), other.getTimestamp()));
|
||||||
|
|
||||||
for(SaveSlot slot : array){
|
for(SaveSlot slot : array){
|
||||||
if(slot.isHidden()) continue;
|
if(slot.isHidden()) continue;
|
||||||
|
@ -139,6 +139,8 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
game.checkPref("crashreport", true);
|
game.checkPref("crashreport", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
game.checkPref("savecreate", true);
|
||||||
|
|
||||||
game.pref(new Setting(){
|
game.pref(new Setting(){
|
||||||
@Override
|
@Override
|
||||||
public void add(SettingsTable table){
|
public void add(SettingsTable table){
|
||||||
|
Reference in New Issue
Block a user