mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix issues with updating mobile player as connecting player
This commit is contained in:
@@ -39,9 +39,9 @@ import forge.toolbox.FEvent;
|
||||
import forge.toolbox.FList;
|
||||
import forge.toolbox.FEvent.FEventHandler;
|
||||
import forge.toolbox.FLabel;
|
||||
import forge.toolbox.FOptionPane;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.util.Utils;
|
||||
import forge.util.gui.SOptionPane;
|
||||
|
||||
public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
private static final ForgePreferences prefs = FModel.getPreferences();
|
||||
@@ -177,6 +177,7 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
protected void initLobby(GameLobby lobby0) {
|
||||
lobby = lobby0;
|
||||
lobby.setListener(this);
|
||||
btnStart.setVisible(lobby.hasControl());
|
||||
}
|
||||
|
||||
private void updateVariantSelection() {
|
||||
@@ -504,10 +505,13 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
}
|
||||
|
||||
void setReady(final int index, final boolean ready) {
|
||||
if (ready && decks[index] == null) {
|
||||
SOptionPane.showErrorDialog("Select a deck before readying!");
|
||||
update(false);
|
||||
return;
|
||||
if (ready) {
|
||||
updateDeck(index);
|
||||
if (decks[index] == null) {
|
||||
FOptionPane.showErrorDialog("Select a deck before readying!");
|
||||
update(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
firePlayerChangeListener(index);
|
||||
|
||||
@@ -614,7 +614,7 @@ public class PlayerPanel extends FContainer {
|
||||
avatarLabel.setEnabled(mayEdit);
|
||||
txtPlayerName.setEnabled(mayEdit);
|
||||
nameRandomiser.setEnabled(mayEdit);
|
||||
humanAiSwitch.setEnabled(mayEdit && mayControl);
|
||||
humanAiSwitch.setEnabled(mayEdit);
|
||||
updateVariantControlsVisibility();
|
||||
|
||||
//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) {
|
||||
if (mayControl == mayControl0) { return; }
|
||||
mayControl = mayControl0;
|
||||
humanAiSwitch.setEnabled(mayEdit && mayControl);
|
||||
}
|
||||
|
||||
public void setMayRemove(boolean mayRemove0) {
|
||||
|
||||
Reference in New Issue
Block a user