mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 03:08:38 +07:00
Data clearing / Bugfixes
This commit is contained in:
parent
bf5055f944
commit
9c36026991
@ -27,7 +27,7 @@ allprojects {
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
roboVMVersion = '2.3.0'
|
roboVMVersion = '2.3.0'
|
||||||
uCoreVersion = 'e8b535aa79075670c3478c7d24cacec8c58e8fc2'
|
uCoreVersion = '367f0b0bab5936ce47155f17a74150451a0cddea'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
@ -254,18 +254,23 @@ text.fps=FPS: {0}
|
|||||||
text.tps=TPS: {0}
|
text.tps=TPS: {0}
|
||||||
text.ping=Ping: {0}ms
|
text.ping=Ping: {0}ms
|
||||||
text.language.restart=Please restart your game for the language settings to take effect.
|
text.language.restart=Please restart your game for the language settings to take effect.
|
||||||
text.settings.language=Language
|
|
||||||
text.settings=Settings
|
text.settings=Settings
|
||||||
text.tutorial=Tutorial
|
text.tutorial=Tutorial
|
||||||
text.editor=Editor
|
text.editor=Editor
|
||||||
text.mapeditor=Map Editor
|
text.mapeditor=Map Editor
|
||||||
text.donate=Donate
|
text.donate=Donate
|
||||||
|
text.settings.language=Language
|
||||||
text.settings.reset=Reset to Defaults
|
text.settings.reset=Reset to Defaults
|
||||||
text.settings.rebind=Rebind
|
text.settings.rebind=Rebind
|
||||||
text.settings.controls=Controls
|
text.settings.controls=Controls
|
||||||
text.settings.game=Game
|
text.settings.game=Game
|
||||||
text.settings.sound=Sound
|
text.settings.sound=Sound
|
||||||
text.settings.graphics=Graphics
|
text.settings.graphics=Graphics
|
||||||
|
text.settings.cleardata=Clear Game Data...
|
||||||
|
text.settings.clear.confirm=Are you sure you want to clear your data?\nThis cannot be undone!
|
||||||
|
text.settings.clearsectors=Clear Sectors
|
||||||
|
text.settings.clearunlocks=Clear Unlocks
|
||||||
|
text.settings.clearall=Clear All
|
||||||
text.paused=Paused
|
text.paused=Paused
|
||||||
text.yes=Yes
|
text.yes=Yes
|
||||||
text.no=No
|
text.no=No
|
||||||
|
@ -151,7 +151,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
String versionString;
|
String versionString;
|
||||||
|
|
||||||
if(host.version == -1){
|
if(host.version == -1){
|
||||||
versionString = Bundles.format("text.server.version", Bundles.get("text.server.custombuild"));
|
versionString = Bundles.format("text.server.version", Bundles.get("text.server.custombuild"), "");
|
||||||
}else if(host.version == 0){
|
}else if(host.version == 0){
|
||||||
versionString = Bundles.get("text.server.outdated");
|
versionString = Bundles.get("text.server.outdated");
|
||||||
}else if(host.version < Version.build && Version.build != -1){
|
}else if(host.version < Version.build && Version.build != -1){
|
||||||
|
@ -5,6 +5,7 @@ import com.badlogic.gdx.Input.Keys;
|
|||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
|
import io.anuke.mindustry.game.Saves.SaveSlot;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
@ -16,6 +17,7 @@ import io.anuke.ucore.scene.event.InputListener;
|
|||||||
import io.anuke.ucore.scene.ui.Image;
|
import io.anuke.ucore.scene.ui.Image;
|
||||||
import io.anuke.ucore.scene.ui.ScrollPane;
|
import io.anuke.ucore.scene.ui.ScrollPane;
|
||||||
import io.anuke.ucore.scene.ui.SettingsDialog;
|
import io.anuke.ucore.scene.ui.SettingsDialog;
|
||||||
|
import io.anuke.ucore.scene.ui.SettingsDialog.SettingsTable.Setting;
|
||||||
import io.anuke.ucore.scene.ui.Slider;
|
import io.anuke.ucore.scene.ui.Slider;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
import io.anuke.ucore.util.Bundles;
|
import io.anuke.ucore.util.Bundles;
|
||||||
@ -133,6 +135,44 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
game.checkPref("effects", true);
|
game.checkPref("effects", true);
|
||||||
//game.sliderPref("sensitivity", 100, 10, 300, i -> i + "%");
|
//game.sliderPref("sensitivity", 100, 10, 300, i -> i + "%");
|
||||||
game.sliderPref("saveinterval", 60, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
|
game.sliderPref("saveinterval", 60, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
|
||||||
|
game.pref(new Setting(){
|
||||||
|
@Override
|
||||||
|
public void add(SettingsTable table){
|
||||||
|
table.addButton("$text.settings.cleardata", () -> {
|
||||||
|
FloatingDialog dialog = new FloatingDialog("$text.settings.cleardata");
|
||||||
|
dialog.setFillParent(false);
|
||||||
|
dialog.content().defaults().size(230f, 50f).pad(3);
|
||||||
|
dialog.addCloseButton();
|
||||||
|
dialog.content().addButton("$text.settings.clearsectors", () -> {
|
||||||
|
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
|
||||||
|
Settings.putString("sectors", "{}");
|
||||||
|
Settings.save();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dialog.content().row();
|
||||||
|
dialog.content().addButton("$text.settings.clearunlocks", () -> {
|
||||||
|
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
|
||||||
|
Settings.putString("unlocks", "{}");
|
||||||
|
Settings.save();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dialog.content().row();
|
||||||
|
dialog.content().addButton("$text.settings.clearall", () -> {
|
||||||
|
ui.showConfirm("$text.confirm", "$text.settings.clear.confirm", () -> {
|
||||||
|
for(SaveSlot slot : control.getSaves().getSaveSlots()){
|
||||||
|
slot.delete();
|
||||||
|
}
|
||||||
|
Settings.prefs().clear();
|
||||||
|
Settings.save();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dialog.content().row();
|
||||||
|
dialog.show();
|
||||||
|
}).size(220f, 60f).pad(6).left();
|
||||||
|
table.add();
|
||||||
|
table.row();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if(!gwt){
|
if(!gwt){
|
||||||
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Bundles.get("setting.fpscap.none") : Bundles.format("setting.fpscap.text", s)));
|
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Bundles.get("setting.fpscap.none") : Bundles.format("setting.fpscap.text", s)));
|
||||||
|
@ -2,6 +2,8 @@ package io.anuke.mindustry.server;
|
|||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.Timer;
|
||||||
|
import com.badlogic.gdx.utils.Timer.Task;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.Player;
|
import io.anuke.mindustry.entities.Player;
|
||||||
import io.anuke.mindustry.game.Difficulty;
|
import io.anuke.mindustry.game.Difficulty;
|
||||||
@ -43,6 +45,7 @@ public class ServerControl extends Module{
|
|||||||
private int gameOvers;
|
private int gameOvers;
|
||||||
private boolean inExtraRound;
|
private boolean inExtraRound;
|
||||||
private Team winnerTeam;
|
private Team winnerTeam;
|
||||||
|
private Task lastTask;
|
||||||
|
|
||||||
public ServerControl(String[] args){
|
public ServerControl(String[] args){
|
||||||
Settings.defaultList(
|
Settings.defaultList(
|
||||||
@ -161,7 +164,7 @@ public class ServerControl extends Module{
|
|||||||
|
|
||||||
handler.register("stop", "Stop hosting the server.", arg -> {
|
handler.register("stop", "Stop hosting the server.", arg -> {
|
||||||
Net.closeServer();
|
Net.closeServer();
|
||||||
Timers.clear();
|
if(lastTask != null) lastTask.cancel();
|
||||||
state.set(State.menu);
|
state.set(State.menu);
|
||||||
netServer.reset();
|
netServer.reset();
|
||||||
Log.info("Stopped server.");
|
Log.info("Stopped server.");
|
||||||
@ -173,6 +176,8 @@ public class ServerControl extends Module{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(lastTask != null) lastTask.cancel();
|
||||||
|
|
||||||
Map result = null;
|
Map result = null;
|
||||||
|
|
||||||
if(arg.length > 0){
|
if(arg.length > 0){
|
||||||
@ -636,6 +641,7 @@ public class ServerControl extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
info("&lyCore destroyed.");
|
info("&lyCore destroyed.");
|
||||||
|
inExtraRound = false;
|
||||||
Events.fire(new GameOverEvent());
|
Events.fire(new GameOverEvent());
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -849,7 +855,14 @@ public class ServerControl extends Module{
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(wait){
|
if(wait){
|
||||||
Timers.run(60f * roundExtraTime, r);
|
lastTask = new Task(){
|
||||||
|
@Override
|
||||||
|
public void run(){
|
||||||
|
r.run();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Timer.schedule(lastTask, roundExtraTime);
|
||||||
}else{
|
}else{
|
||||||
r.run();
|
r.run();
|
||||||
}
|
}
|
||||||
@ -886,7 +899,7 @@ public class ServerControl extends Module{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
if(!inExtraRound){
|
if(!inExtraRound && state.mode.isPvp){
|
||||||
checkPvPGameOver();
|
checkPvPGameOver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user