mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
fix merge
This commit is contained in:
parent
955e1c76b6
commit
87ec2baab7
4 changed files with 43 additions and 26 deletions
|
|
@ -102,6 +102,11 @@
|
|||
<artifactId>beansbinding</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.swinglabs</groupId>
|
||||
<artifactId>swing-layout</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ import mage.client.remote.CallbackClientImpl;
|
|||
import mage.client.table.TablesPane;
|
||||
import mage.client.tournament.TournamentPane;
|
||||
import mage.client.tournament.TournamentPanel;
|
||||
import mage.client.util.SettingsManager;
|
||||
import mage.game.match.MatchOptions;
|
||||
import mage.interfaces.MageClient;
|
||||
import mage.interfaces.callback.CallbackClient;
|
||||
|
|
@ -173,7 +174,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
initComponents();
|
||||
setSize(1024, 768);
|
||||
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
SettingsManager.getInstance().setScreenWidthAndHeight(1024, 768);
|
||||
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
|
||||
|
||||
session = new Session(this);
|
||||
callbackClient = new CallbackClientImpl(this);
|
||||
|
|
@ -211,8 +213,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
public void componentResized(ComponentEvent e) {
|
||||
int width = ((JComponent) e.getSource()).getWidth();
|
||||
int height = ((JComponent) e.getSource()).getHeight();
|
||||
if (!liteMode)
|
||||
backgroundPane.setSize(width, height);
|
||||
SettingsManager.getInstance().setScreenWidthAndHeight(width, height);
|
||||
if (!liteMode) {
|
||||
backgroundPane.setSize(width, height);
|
||||
}
|
||||
JPanel arrowsPanel = ArrowBuilder.getArrowsPanelRef();
|
||||
if (arrowsPanel != null) arrowsPanel.setSize(width, height);
|
||||
if (title != null) {
|
||||
|
|
@ -761,7 +765,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
}//GEN-LAST:event_btnCollectionViewerActionPerformed
|
||||
|
||||
private void btnPreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPreferencesActionPerformed
|
||||
PhasesDialog.main(new String[]{});
|
||||
PreferencesDialog.main(new String[]{});
|
||||
}//GEN-LAST:event_btnPreferencesActionPerformed
|
||||
|
||||
public void exitApp() {
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
if (cardInfoPane instanceof CardInfoPane) {
|
||||
((CardInfoPane)cardInfoPane).setCard(new CardView(card));
|
||||
}
|
||||
hidePopup();
|
||||
}
|
||||
|
||||
} else if (event.getEventName().equals("shift-double-click") && mode == DeckEditorMode.Constructed) {
|
||||
|
|
@ -181,6 +182,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
if (cardInfoPane instanceof CardInfoPane) {
|
||||
((CardInfoPane)cardInfoPane).setCard(new CardView(card));
|
||||
}
|
||||
hidePopup();
|
||||
}
|
||||
refreshDeck();
|
||||
}
|
||||
|
|
@ -194,7 +196,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
public void event(Event event) {
|
||||
if (event.getEventName().equals("double-click")) {
|
||||
for (Card card: deck.getCards()) {
|
||||
if (card.getId().equals((UUID)event.getSource())) {
|
||||
if (card.getId().equals(event.getSource())) {
|
||||
deck.getCards().remove(card);
|
||||
if (mode == DeckEditorMode.Limited || mode == DeckEditorMode.Sideboard) {
|
||||
deck.getSideboard().add(card);
|
||||
|
|
@ -203,16 +205,18 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
break;
|
||||
}
|
||||
}
|
||||
hidePopup();
|
||||
refreshDeck();
|
||||
}
|
||||
else if (event.getEventName().equals("shift-double-click") && mode == DeckEditorMode.Constructed) {
|
||||
for (Card card: deck.getCards()) {
|
||||
if (card.getId().equals((UUID)event.getSource())) {
|
||||
if (card.getId().equals(event.getSource())) {
|
||||
deck.getCards().remove(card);
|
||||
deck.getSideboard().add(card);
|
||||
break;
|
||||
}
|
||||
}
|
||||
hidePopup();
|
||||
refreshDeck();
|
||||
}
|
||||
}
|
||||
|
|
@ -225,7 +229,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
if (event.getEventName().equals("double-click")) {
|
||||
//boolean isListView = cardSelector.getCardsList() instanceof TableModel;
|
||||
for (Card card: deck.getSideboard()) {
|
||||
if (card.getId().equals((UUID)event.getSource())) {
|
||||
if (card.getId().equals(event.getSource())) {
|
||||
deck.getSideboard().remove(card);
|
||||
//if (!isListView) {
|
||||
deck.getCards().add(card);
|
||||
|
|
@ -233,6 +237,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
break;
|
||||
}
|
||||
}
|
||||
hidePopup();
|
||||
refreshDeck();
|
||||
}
|
||||
}
|
||||
|
|
@ -243,6 +248,10 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
this.repaint();
|
||||
}
|
||||
|
||||
private void hidePopup() {
|
||||
Plugins.getInstance().getActionCallback().mouseExited(null, null);
|
||||
}
|
||||
|
||||
public void hideDeckEditor() {
|
||||
Component c = this.getParent();
|
||||
while (c != null && !(c instanceof DeckEditorPane)) {
|
||||
|
|
@ -579,27 +588,26 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
int ret = fcImportDeck.showOpenDialog(this);
|
||||
if (ret == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fcImportDeck.getSelectedFile();
|
||||
if (file != null) {
|
||||
try {
|
||||
setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
DeckImporter importer = getDeckImporter(file.getPath());
|
||||
if (importer != null) {
|
||||
deck = Deck.load(importer.importDeck(file.getPath()));
|
||||
}
|
||||
else {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Unknown deck format", "Error importing deck", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(DeckEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
try {
|
||||
setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
DeckImporter importer = getDeckImporter(file.getPath());
|
||||
if (importer != null) {
|
||||
deck = Deck.load(importer.importDeck(file.getPath()));
|
||||
}
|
||||
finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
else {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Unknown deck format", "Error importing deck", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
refreshDeck();
|
||||
try {
|
||||
MageFrame.getPreferences().put("lastImportFolder", file.getCanonicalPath());
|
||||
} catch (IOException ex) { }
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(DeckEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
refreshDeck();
|
||||
try {
|
||||
if (file != null)
|
||||
MageFrame.getPreferences().put("lastImportFolder", file.getCanonicalPath());
|
||||
} catch (IOException ex) { }
|
||||
}
|
||||
fcImportDeck.setSelectedFile(null);
|
||||
}//GEN-LAST:event_btnImportActionPerformed
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<plugin-version>0.5</plugin-version>
|
||||
<plugin-version>0.6</plugin-version>
|
||||
<jspf-version>0.9.1</jspf-version>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue