mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28: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.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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user