Fixed connection not resetting on game load / Experimental click changes
This commit is contained in:
@@ -17,6 +17,7 @@ import io.anuke.mindustry.core.GameState.*;
|
||||
import io.anuke.mindustry.game.Saves.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.io.SaveIO.*;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.*;
|
||||
import io.anuke.mindustry.type.Zone.*;
|
||||
import io.anuke.mindustry.ui.*;
|
||||
@@ -95,6 +96,8 @@ public class DeployDialog extends FloatingDialog{
|
||||
|
||||
hide();
|
||||
ui.loadAnd(() -> {
|
||||
logic.reset();
|
||||
Net.reset();
|
||||
try{
|
||||
control.saves.getZoneSlot().load();
|
||||
state.set(State.playing);
|
||||
|
||||
@@ -310,6 +310,7 @@ public class JoinDialog extends FloatingDialog{
|
||||
|
||||
Time.runTask(2f, () -> {
|
||||
logic.reset();
|
||||
Net.reset();
|
||||
Vars.netClient.beginConnecting();
|
||||
Net.connect(ip, port, () -> {
|
||||
hide();
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.files.FileHandle;
|
||||
import io.anuke.arc.scene.ui.ScrollPane;
|
||||
import io.anuke.arc.scene.ui.TextButton;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.files.*;
|
||||
import io.anuke.arc.scene.ui.*;
|
||||
import io.anuke.arc.scene.ui.layout.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.game.Saves.SaveSlot;
|
||||
import io.anuke.mindustry.io.SaveIO;
|
||||
import io.anuke.mindustry.io.SaveIO.SaveException;
|
||||
import io.anuke.mindustry.*;
|
||||
import io.anuke.mindustry.core.GameState.*;
|
||||
import io.anuke.mindustry.core.*;
|
||||
import io.anuke.mindustry.game.Saves.*;
|
||||
import io.anuke.mindustry.io.*;
|
||||
import io.anuke.mindustry.io.SaveIO.*;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
@@ -170,6 +170,7 @@ public class LoadDialog extends FloatingDialog{
|
||||
|
||||
ui.loadAnd(() -> {
|
||||
try{
|
||||
Net.reset();
|
||||
slot.load();
|
||||
state.set(State.playing);
|
||||
}catch(SaveException e){
|
||||
@@ -184,7 +185,6 @@ public class LoadDialog extends FloatingDialog{
|
||||
public void modifyButton(TextButton button, SaveSlot slot){
|
||||
button.clicked(() -> {
|
||||
if(!button.childrenPressed()){
|
||||
int build = slot.getBuild();
|
||||
runLoadSave(slot);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -43,6 +43,7 @@ public class LoadingFragment extends Fragment{
|
||||
}
|
||||
|
||||
public void show(String text){
|
||||
table.clearActions();
|
||||
table.touchable(Touchable.enabled);
|
||||
table.<Label>find("namelabel").setText(text);
|
||||
table.visible(true);
|
||||
@@ -51,6 +52,7 @@ public class LoadingFragment extends Fragment{
|
||||
}
|
||||
|
||||
public void hide(){
|
||||
table.clearActions();
|
||||
table.toFront();
|
||||
table.touchable(Touchable.disabled);
|
||||
table.actions(Actions.fadeOut(1f), Actions.visible(false));
|
||||
|
||||
Reference in New Issue
Block a user