GUI: fix that cheat button shows for all players instead current user only (related to #5289);

This commit is contained in:
Oleg Agafonov 2020-07-29 20:22:25 +04:00
parent 7cfe39ae21
commit 1045f352bc
3 changed files with 9 additions and 3 deletions

View file

@ -494,7 +494,7 @@ public class PlayAreaPanel extends javax.swing.JPanel {
}
public final void init(PlayerView player, BigCard bigCard, UUID gameId, int priorityTime) {
this.playerPanel.init(gameId, player.getPlayerId(), bigCard, priorityTime);
this.playerPanel.init(gameId, player.getPlayerId(), player.getControlled(), bigCard, priorityTime);
this.battlefieldPanel.init(gameId, bigCard);
this.gameId = gameId;
this.playerId = player.getPlayerId();

View file

@ -86,11 +86,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
deadBackgroundColor = currentTheme.getPlayerPanel_deadBackgroundColor();
}
public void init(UUID gameId, UUID playerId, BigCard bigCard, int priorityTime) {
public void init(UUID gameId, UUID playerId, boolean controlled, BigCard bigCard, int priorityTime) {
this.gameId = gameId;
this.playerId = playerId;
this.bigCard = bigCard;
cheat.setVisible(SessionHandler.isTestMode());
cheat.setVisible(SessionHandler.isTestMode() && controlled);
cheat.setFocusable(false);
flagName = null;
if (priorityTime > 0) {