Multiplayer pausing as host works now
This commit is contained in:
@@ -115,8 +115,6 @@ public class Vars implements Loadable{
|
|||||||
public static final float iconXLarge = 8*6f, iconLarge = 8*5f, iconMed = 8*4f, iconSmall = 8*3f;
|
public static final float iconXLarge = 8*6f, iconLarge = 8*5f, iconMed = 8*4f, iconSmall = 8*3f;
|
||||||
/** for map generator dialog */
|
/** for map generator dialog */
|
||||||
public static boolean updateEditorOnChange = false;
|
public static boolean updateEditorOnChange = false;
|
||||||
/** Experimental flag for multiplayer pausing. DO NOT USE YET! */
|
|
||||||
public static boolean multiplayerPausing = false;
|
|
||||||
/** all choosable player colors in join/host dialog */
|
/** all choosable player colors in join/host dialog */
|
||||||
public static final Color[] playerColors = {
|
public static final Color[] playerColors = {
|
||||||
Color.valueOf("82759a"),
|
Color.valueOf("82759a"),
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ public class GameState{
|
|||||||
|
|
||||||
public void set(State astate){
|
public void set(State astate){
|
||||||
//horrible horrible horrible
|
//horrible horrible horrible
|
||||||
if(astate == State.paused && net.active() && multiplayerPausing) serverPaused = true;
|
if(astate == State.paused && net.active() && !headless) serverPaused = true;
|
||||||
if(astate != State.paused && net.active() && multiplayerPausing) serverPaused = false;
|
if(astate != State.paused && net.active() && !headless) serverPaused = false;
|
||||||
|
|
||||||
//cannot pause when in multiplayer
|
//cannot pause when in multiplayer
|
||||||
if(astate == State.paused && (net.active())) return;
|
if(astate == State.paused && net.active()) return;
|
||||||
|
|
||||||
Events.fire(new StateChangeEvent(state, astate));
|
Events.fire(new StateChangeEvent(state, astate));
|
||||||
state = astate;
|
state = astate;
|
||||||
|
|||||||
Reference in New Issue
Block a user