Many bugfixes for multiplayer, QoL, balancing, new difficulties
This commit is contained in:
@@ -3,7 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.world.GameMode;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.world.Map;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
|
||||
content().addButton("$text.quit", () -> {
|
||||
ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
if(Net.active() && Net.client()) Net.disconnect();
|
||||
if(Net.active() && Net.client()) Vars.netClient.disconnectQuietly();
|
||||
runSave();
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
@@ -110,7 +110,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
|
||||
new imagebutton("icon-quit", isize, () -> {
|
||||
Vars.ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
if(Net.active() && Net.client()) Net.disconnect();
|
||||
if(Net.active() && Net.client()) Vars.netClient.disconnectQuietly();
|
||||
runSave();
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.Align;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.game.Difficulty;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
@@ -106,7 +107,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
void addSettings(){
|
||||
sound.volumePrefs();
|
||||
|
||||
game.sliderPref("difficulty", 1, 0, 2, i -> Bundles.get("setting.difficulty." + (i == 0 ? "easy" : i == 1 ? "normal" : "hard")));
|
||||
game.sliderPref("difficulty", 1, 0, Difficulty.values().length-1, i -> Difficulty.values()[i].toString());
|
||||
game.screenshakePref();
|
||||
game.checkPref("smoothcam", true);
|
||||
game.checkPref("effects", true);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ChatFragment extends Table implements Fragment{
|
||||
private final static int messagesShown = 10;
|
||||
private final static int maxLength = 150;
|
||||
private Array<ChatMessage> messages = new Array<>();
|
||||
private float fadetime;
|
||||
private float fadetime, lastfade;
|
||||
private boolean chatOpen = false;
|
||||
private TextField chatfield;
|
||||
private Label fieldlabel = new Label(">");
|
||||
@@ -157,12 +157,13 @@ public class ChatFragment extends Table implements Fragment{
|
||||
scene.setKeyboardFocus(chatfield);
|
||||
chatfield.fireClick();
|
||||
chatOpen = !chatOpen;
|
||||
lastfade = fadetime;
|
||||
fadetime = messagesShown + 1;
|
||||
}else if(chatOpen){
|
||||
scene.setKeyboardFocus(null);
|
||||
chatOpen = !chatOpen;
|
||||
fadetime = lastfade;
|
||||
sendMessage();
|
||||
fadetime = messagesShown + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +181,7 @@ public class ChatFragment extends Table implements Fragment{
|
||||
messages.insert(0, new ChatMessage(message, sender));
|
||||
|
||||
fadetime += 1f;
|
||||
fadetime = Math.min(fadetime, messagesShown) + 2f;
|
||||
fadetime = Math.min(fadetime, messagesShown) + 1f;
|
||||
}
|
||||
|
||||
private static class ChatMessage{
|
||||
|
||||
Reference in New Issue
Block a user