Fix issues with updating mobile player as connecting player

This commit is contained in:
drdev
2015-06-13 18:11:54 +00:00
parent 075e257884
commit ff3bdcc676
2 changed files with 10 additions and 7 deletions

View File

@@ -39,9 +39,9 @@ import forge.toolbox.FEvent;
import forge.toolbox.FList; import forge.toolbox.FList;
import forge.toolbox.FEvent.FEventHandler; import forge.toolbox.FEvent.FEventHandler;
import forge.toolbox.FLabel; import forge.toolbox.FLabel;
import forge.toolbox.FOptionPane;
import forge.toolbox.FScrollPane; import forge.toolbox.FScrollPane;
import forge.util.Utils; import forge.util.Utils;
import forge.util.gui.SOptionPane;
public abstract class LobbyScreen extends LaunchScreen implements ILobbyView { public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
private static final ForgePreferences prefs = FModel.getPreferences(); private static final ForgePreferences prefs = FModel.getPreferences();
@@ -177,6 +177,7 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
protected void initLobby(GameLobby lobby0) { protected void initLobby(GameLobby lobby0) {
lobby = lobby0; lobby = lobby0;
lobby.setListener(this); lobby.setListener(this);
btnStart.setVisible(lobby.hasControl());
} }
private void updateVariantSelection() { private void updateVariantSelection() {
@@ -504,11 +505,14 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
} }
void setReady(final int index, final boolean ready) { void setReady(final int index, final boolean ready) {
if (ready && decks[index] == null) { if (ready) {
SOptionPane.showErrorDialog("Select a deck before readying!"); updateDeck(index);
if (decks[index] == null) {
FOptionPane.showErrorDialog("Select a deck before readying!");
update(false); update(false);
return; return;
} }
}
firePlayerChangeListener(index); firePlayerChangeListener(index);
} }

View File

@@ -614,7 +614,7 @@ public class PlayerPanel extends FContainer {
avatarLabel.setEnabled(mayEdit); avatarLabel.setEnabled(mayEdit);
txtPlayerName.setEnabled(mayEdit); txtPlayerName.setEnabled(mayEdit);
nameRandomiser.setEnabled(mayEdit); nameRandomiser.setEnabled(mayEdit);
humanAiSwitch.setEnabled(mayEdit && mayControl); humanAiSwitch.setEnabled(mayEdit);
updateVariantControlsVisibility(); updateVariantControlsVisibility();
//if panel has height already, ensure height updated to account for button visibility changes //if panel has height already, ensure height updated to account for button visibility changes
@@ -626,7 +626,6 @@ public class PlayerPanel extends FContainer {
public void setMayControl(boolean mayControl0) { public void setMayControl(boolean mayControl0) {
if (mayControl == mayControl0) { return; } if (mayControl == mayControl0) { return; }
mayControl = mayControl0; mayControl = mayControl0;
humanAiSwitch.setEnabled(mayEdit && mayControl);
} }
public void setMayRemove(boolean mayRemove0) { public void setMayRemove(boolean mayRemove0) {