mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
fixed issue 228
This commit is contained in:
parent
120468f8ca
commit
7926fc5004
8 changed files with 38 additions and 10 deletions
|
@ -821,6 +821,14 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
GamePane gamePane = (GamePane) window;
|
||||
gamePane.hideGame();
|
||||
}
|
||||
if (window instanceof DraftPane) {
|
||||
DraftPane draftPane = (DraftPane) window;
|
||||
draftPane.hideDraft();
|
||||
}
|
||||
if (window instanceof TournamentPane) {
|
||||
TournamentPane tournamentPane = (TournamentPane) window;
|
||||
tournamentPane.hideTournament();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jScrollPane1" alignment="0" pref="582" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" alignment="0" pref="586" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
|
|
|
@ -53,6 +53,10 @@ public class DraftPane extends MagePane {
|
|||
this.draftPanel1.showDraft(draftId);
|
||||
}
|
||||
|
||||
public void hideDraft() {
|
||||
draftPanel1.hideDraft();
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="tournamentPanel" alignment="0" pref="526" max="32767" attributes="0"/>
|
||||
<Component id="tournamentPanel" alignment="0" pref="530" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
|
|
|
@ -54,6 +54,10 @@ public class TournamentPane extends MagePane {
|
|||
this.repaint();
|
||||
}
|
||||
|
||||
public void hideTournament() {
|
||||
tournamentPanel.hideTournament();
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
|
|
|
@ -113,6 +113,8 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public void hideTournament() {
|
||||
stopTasks();
|
||||
this.chatPanel1.disconnect();
|
||||
Component c = this.getParent();
|
||||
while (c != null && !(c instanceof TournamentPane)) {
|
||||
c = c.getParent();
|
||||
|
|
|
@ -169,6 +169,14 @@ public class User {
|
|||
}
|
||||
|
||||
private void reconnect() {
|
||||
for (Entry<UUID, Table> entry: tables.entrySet()) {
|
||||
joinedTable(entry.getValue().getRoomId(), entry.getValue().getId(), entry.getValue().isTournament());
|
||||
}
|
||||
for (Entry<UUID, TournamentSession> entry: tournamentSessions.entrySet()) {
|
||||
tournamentStarted(entry.getValue().getTournamentId(), entry.getKey());
|
||||
entry.getValue().init();
|
||||
entry.getValue().update();
|
||||
}
|
||||
for (Entry<UUID, GameSession> entry: gameSessions.entrySet()) {
|
||||
gameStarted(entry.getValue().getGameId(), entry.getKey());
|
||||
entry.getValue().init();
|
||||
|
@ -179,14 +187,6 @@ public class User {
|
|||
entry.getValue().init();
|
||||
entry.getValue().update();
|
||||
}
|
||||
for (Entry<UUID, TournamentSession> entry: tournamentSessions.entrySet()) {
|
||||
tournamentStarted(entry.getValue().getTournamentId(), entry.getKey());
|
||||
entry.getValue().init();
|
||||
entry.getValue().update();
|
||||
}
|
||||
for (Entry<UUID, Table> entry: tables.entrySet()) {
|
||||
joinedTable(entry.getValue().getRoomId(), entry.getValue().getId(), entry.getValue().isTournament());
|
||||
}
|
||||
}
|
||||
|
||||
public void addGame(UUID playerId, GameSession gameSession) {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
package mage.game.events;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -43,6 +44,7 @@ public class GameEvent {
|
|||
protected int amount;
|
||||
protected boolean flag;
|
||||
protected String data;
|
||||
protected Zone zone;
|
||||
|
||||
public enum EventType {
|
||||
|
||||
|
@ -182,4 +184,12 @@ public class GameEvent {
|
|||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Zone getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
public void setZone(Zone zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue