Fixed many various things
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
##Packr, build stuff
|
##Packr, build stuff
|
||||||
|
|
||||||
|
logs/
|
||||||
/core/assets/mindustry-saves/
|
/core/assets/mindustry-saves/
|
||||||
/core/assets/mindustry-maps/
|
/core/assets/mindustry-maps/
|
||||||
/core/assets/bundles/output/
|
/core/assets/bundles/output/
|
||||||
|
|||||||
@@ -42,12 +42,13 @@ public class TextFieldDialogListener extends ClickListener{
|
|||||||
|
|
||||||
AndroidTextFieldDialog dialog = new AndroidTextFieldDialog();
|
AndroidTextFieldDialog dialog = new AndroidTextFieldDialog();
|
||||||
|
|
||||||
dialog.setTextPromptListener(text -> {
|
dialog.setTextPromptListener(text ->
|
||||||
field.clearText();
|
Gdx.app.postRunnable(() -> {
|
||||||
field.appendText(text);
|
field.clearText();
|
||||||
field.fire(new ChangeListener.ChangeEvent());
|
field.appendText(text);
|
||||||
Gdx.graphics.requestRendering();
|
field.fire(new ChangeListener.ChangeEvent());
|
||||||
});
|
Gdx.graphics.requestRendering();
|
||||||
|
}));
|
||||||
|
|
||||||
if(type == 0){
|
if(type == 0){
|
||||||
dialog.setInputType(InputType.TYPE_CLASS_TEXT);
|
dialog.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ setting.musicvol.name = Music Volume
|
|||||||
setting.mutemusic.name = Mute Music
|
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
|
||||||
text.keybind.title = Rebind Keys
|
text.keybind.title = Rebind Keys
|
||||||
category.general.name = General
|
category.general.name = General
|
||||||
category.view.name = View
|
category.view.name = View
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ mode.sandbox.name = Песочница
|
|||||||
mode.sandbox.description = Бесконечные ресурсы и нет таймера для волн, но можно самим вызвать волну.
|
mode.sandbox.description = Бесконечные ресурсы и нет таймера для волн, но можно самим вызвать волну.
|
||||||
mode.custom.warning = [scarlet]РАЗБЛОКИРОВАННОЕ В ПОЛЬЗОВАТЕЛЬСКИХ ИГРАХ ИЛИ НА СЕРВЕРАХ НЕ СОХРАНЯЕТСЯ[]\n\nИграйте в секторах для разблокировки чего-либо
|
mode.custom.warning = [scarlet]РАЗБЛОКИРОВАННОЕ В ПОЛЬЗОВАТЕЛЬСКИХ ИГРАХ ИЛИ НА СЕРВЕРАХ НЕ СОХРАНЯЕТСЯ[]\n\nИграйте в секторах для разблокировки чего-либо
|
||||||
mode.custom.warning.read = Внимательно прочитайте это!:\n[scarlet]РАЗБЛОКИРОВАННОЕ В ПОЛЬЗОВАТЕЛЬСКИХ ИГРАХ ИЛИ ДРУГИХ РЕЖИМАХ ИГРЫ НЕ РАСПРОСТРАНЯЕТСЯ НА СЕКТОРА ИЛИ ДРУГИЕ РЕЖИМЫ ИГРЫ!\n\n[LIGHT_GRAY](Я бы хотел, чтобы это не было необходимо, но, по-видимому, это так)
|
mode.custom.warning.read = Внимательно прочитайте это!:\n[scarlet]РАЗБЛОКИРОВАННОЕ В ПОЛЬЗОВАТЕЛЬСКИХ ИГРАХ ИЛИ ДРУГИХ РЕЖИМАХ ИГРЫ НЕ РАСПРОСТРАНЯЕТСЯ НА СЕКТОРА ИЛИ ДРУГИЕ РЕЖИМЫ ИГРЫ!\n\n[LIGHT_GRAY](Я бы хотел, чтобы это не было необходимо, но, по-видимому, это так)
|
||||||
mode.freebuild.name = Cвободная\nстройка
|
mode.freebuild.name = Свободная\nстройка
|
||||||
mode.freebuild.description = ограниченные ресурсы и нет таймера для волн.
|
mode.freebuild.description = ограниченные ресурсы и нет таймера для волн.
|
||||||
mode.pvp.name = Противо-\nстояние
|
mode.pvp.name = Противо-\nстояние
|
||||||
mode.pvp.description = боритесь против других игроков.
|
mode.pvp.description = боритесь против других игроков.
|
||||||
|
|||||||
@@ -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.TooltipManager;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
import io.anuke.ucore.util.Threads;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.ucore.scene.actions.Actions.*;
|
import static io.anuke.ucore.scene.actions.Actions.*;
|
||||||
@@ -239,6 +240,8 @@ public class UI extends SceneModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showInfoFade(String info){
|
public void showInfoFade(String info){
|
||||||
|
Threads.assertGraphics();
|
||||||
|
|
||||||
Table table = new Table();
|
Table table = new Table();
|
||||||
table.setFillParent(true);
|
table.setFillParent(true);
|
||||||
table.actions(Actions.fadeOut(7f, Interpolation.fade), Actions.removeActor());
|
table.actions(Actions.fadeOut(7f, Interpolation.fade), Actions.removeActor());
|
||||||
@@ -247,6 +250,8 @@ public class UI extends SceneModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showInfo(String info){
|
public void showInfo(String info){
|
||||||
|
Threads.assertGraphics();
|
||||||
|
|
||||||
new Dialog("$text.info.title", "dialog"){{
|
new Dialog("$text.info.title", "dialog"){{
|
||||||
getCell(content()).growX();
|
getCell(content()).growX();
|
||||||
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
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){
|
public void showInfo(String info, Runnable clicked){
|
||||||
|
Threads.assertGraphics();
|
||||||
|
|
||||||
new Dialog("$text.info.title", "dialog"){{
|
new Dialog("$text.info.title", "dialog"){{
|
||||||
getCell(content()).growX();
|
getCell(content()).growX();
|
||||||
content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
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);
|
private final AsyncExecutor executor = new AsyncExecutor(6);
|
||||||
|
|
||||||
public void playSector(Sector sector){
|
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();
|
sector.getSave().delete();
|
||||||
ui.showInfo("$text.save.old");
|
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.checkPref("autotarget", 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", 120, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
|
||||||
game.pref(new Setting(){
|
game.pref(new Setting(){
|
||||||
@Override
|
@Override
|
||||||
public void add(SettingsTable table){
|
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.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);
|
graphics.checkPref("multithread", mobile, threads::setEnabled);
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,16 @@ public class CrashHandler{
|
|||||||
public static void handle(Throwable e){
|
public static void handle(Throwable e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
|
try{
|
||||||
|
//check crash report setting
|
||||||
|
if(!Settings.getBool("crashreport")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}catch(Throwable ignored){
|
||||||
|
//don't send since we don't know if the user has the setting set
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(!OS.isMac){
|
if(!OS.isMac){
|
||||||
try{
|
try{
|
||||||
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
|
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
|||||||
import static io.anuke.mindustry.Vars.threads;
|
import static io.anuke.mindustry.Vars.threads;
|
||||||
|
|
||||||
public class KryoServer implements ServerProvider {
|
public class KryoServer implements ServerProvider {
|
||||||
final boolean tcpOnly = System.getProperty("java.version") == null;
|
|
||||||
final Server server;
|
final Server server;
|
||||||
final CopyOnWriteArrayList<KryoConnection> connections = new CopyOnWriteArrayList<>();
|
final CopyOnWriteArrayList<KryoConnection> connections = new CopyOnWriteArrayList<>();
|
||||||
final CopyOnWriteArraySet<Integer> missing = new CopyOnWriteArraySet<>();
|
final CopyOnWriteArraySet<Integer> missing = new CopyOnWriteArraySet<>();
|
||||||
@@ -150,11 +149,7 @@ public class KryoServer implements ServerProvider {
|
|||||||
lastconnection = 0;
|
lastconnection = 0;
|
||||||
connections.clear();
|
connections.clear();
|
||||||
missing.clear();
|
missing.clear();
|
||||||
if(tcpOnly){
|
server.bind(port, port);
|
||||||
server.bind(port);
|
|
||||||
}else{
|
|
||||||
server.bind(port, port);
|
|
||||||
}
|
|
||||||
|
|
||||||
serverThread = new Thread(() -> {
|
serverThread = new Thread(() -> {
|
||||||
try{
|
try{
|
||||||
@@ -172,7 +167,7 @@ public class KryoServer implements ServerProvider {
|
|||||||
connections.clear();
|
connections.clear();
|
||||||
lastconnection = 0;
|
lastconnection = 0;
|
||||||
|
|
||||||
async(server::close);
|
async(server::stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user