Fixed many various things
This commit is contained in:
@@ -28,6 +28,7 @@ import io.anuke.ucore.scene.ui.TextField.TextFieldFilter;
|
||||
import io.anuke.ucore.scene.ui.TooltipManager;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Threads;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.ucore.scene.actions.Actions.*;
|
||||
@@ -239,6 +240,8 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
public void showInfoFade(String info){
|
||||
Threads.assertGraphics();
|
||||
|
||||
Table table = new Table();
|
||||
table.setFillParent(true);
|
||||
table.actions(Actions.fadeOut(7f, Interpolation.fade), Actions.removeActor());
|
||||
@@ -247,6 +250,8 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
public void showInfo(String info){
|
||||
Threads.assertGraphics();
|
||||
|
||||
new Dialog("$text.info.title", "dialog"){{
|
||||
getCell(content()).growX();
|
||||
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
||||
@@ -255,6 +260,8 @@ public class UI extends SceneModule{
|
||||
}
|
||||
|
||||
public void showInfo(String info, Runnable clicked){
|
||||
Threads.assertGraphics();
|
||||
|
||||
new Dialog("$text.info.title", "dialog"){{
|
||||
getCell(content()).growX();
|
||||
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Sectors{
|
||||
private final AsyncExecutor executor = new AsyncExecutor(6);
|
||||
|
||||
public void playSector(Sector sector){
|
||||
if(sector.hasSave() && SaveIO.breakingVersions.contains(sector.getSave().getBuild())){
|
||||
if(!headless && sector.hasSave() && SaveIO.breakingVersions.contains(sector.getSave().getBuild())){
|
||||
sector.getSave().delete();
|
||||
ui.showInfo("$text.save.old");
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package io.anuke.mindustry.maps.missions;
|
||||
|
||||
import io.anuke.mindustry.Vars;
|
||||
|
||||
/**A mission that just displays some text.*/
|
||||
public class MessageMission extends ActionMission{
|
||||
|
||||
public MessageMission(String text){
|
||||
super(() -> {
|
||||
if(!Vars.headless){
|
||||
Vars.ui.showInfo(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
game.checkPref("autotarget", true);
|
||||
}
|
||||
//game.sliderPref("sensitivity", 100, 10, 300, i -> i + "%");
|
||||
game.sliderPref("saveinterval", 60, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
|
||||
game.sliderPref("saveinterval", 120, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
|
||||
game.pref(new Setting(){
|
||||
@Override
|
||||
public void add(SettingsTable table){
|
||||
@@ -186,6 +186,10 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
}
|
||||
});
|
||||
|
||||
if(!mobile){
|
||||
game.checkPref("crashreport", true);
|
||||
}
|
||||
|
||||
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Bundles.get("setting.fpscap.none") : Bundles.format("setting.fpscap.text", s)));
|
||||
graphics.checkPref("multithread", mobile, threads::setEnabled);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user