From 8a454d38a76ef544de11367b20a710cedcf07260 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 12 Dec 2010 11:15:57 +0300 Subject: [PATCH 01/10] Fixed NullPointerException thrown time to time for ability picker shown for cards in hand. --- .../mage/client/util/gui/GuiDisplayUtil.java | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java b/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java index fabcffcbc14..f409280d993 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/GuiDisplayUtil.java @@ -4,6 +4,7 @@ import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; +import java.awt.GraphicsConfiguration; import java.awt.Insets; import javax.swing.JButton; @@ -107,20 +108,25 @@ public class GuiDisplayUtil { public static void keepComponentInsideScreen(int x, int y, Component c) { Dimension screenDim = c.getToolkit().getScreenSize(); - Insets insets = c.getToolkit().getScreenInsets(c.getGraphicsConfiguration()); - - if (x + c.getWidth() > screenDim.width - insets.right) { - x = (screenDim.width - insets.right) - c.getWidth(); - } else if (x < insets.left) { - x = insets.left; + GraphicsConfiguration g = c.getGraphicsConfiguration(); + if (g != null) { + Insets insets = c.getToolkit().getScreenInsets(g); + + if (x + c.getWidth() > screenDim.width - insets.right) { + x = (screenDim.width - insets.right) - c.getWidth(); + } else if (x < insets.left) { + x = insets.left; + } + + if (y + c.getHeight() > screenDim.height - insets.bottom) { + y = (screenDim.height - insets.bottom) - c.getHeight(); + } else if (y < insets.top) { + y = insets.top; + } + + c.setLocation(x, y); + } else { + System.out.println("null"); } - - if (y + c.getHeight() > screenDim.height - insets.bottom) { - y = (screenDim.height - insets.bottom) - c.getHeight(); - } else if (y < insets.top) { - y = insets.top; - } - - c.setLocation(x, y); } } From 6ce81d6ed9ad679f9fb2122a4436190194cc81dc Mon Sep 17 00:00:00 2001 From: Loki Date: Sun, 12 Dec 2010 11:09:25 +0200 Subject: [PATCH 02/10] Seaside Citadel --- Mage.Server/config/init.txt | 6 +- .../sets/shardsofalara/SeasideCitadel.java | 68 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/shardsofalara/SeasideCitadel.java diff --git a/Mage.Server/config/init.txt b/Mage.Server/config/init.txt index 7d070f1070b..5e8aaa01e20 100644 --- a/Mage.Server/config/init.txt +++ b/Mage.Server/config/init.txt @@ -6,5 +6,9 @@ # nickname - Player's name you connect to the game with # # -battlefield:player:Jace, the Mind Sculptor:1 +hand:player:Fiery Fall:1 +hand:player:Constricting Tendrils:1 +battlefield:player:Mountain:5 +battlefield:player:Island:5 battlefield:computer:Bloodbraid Elf:1 + diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SeasideCitadel.java b/Mage.Sets/src/mage/sets/shardsofalara/SeasideCitadel.java new file mode 100644 index 00000000000..f86e5798833 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/SeasideCitadel.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.shardsofalara; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; + +/** + * + * @author Loki + */ +public class SeasideCitadel extends CardImpl { + + public SeasideCitadel (UUID ownerId) { + super(ownerId, 229, "Seaside Citadel", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "ALA"; + this.addAbility(new EntersBattlefieldTappedAbility()); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } + + public SeasideCitadel (final SeasideCitadel card) { + super(card); + } + + @Override + public SeasideCitadel copy() { + return new SeasideCitadel(this); + } + + @Override + public String getArt() { + return ""; + } +} From b26db988176dbc9549dfcc17b6439266fa9ee552 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Sun, 12 Dec 2010 17:02:24 +0300 Subject: [PATCH 03/10] Phase stops - done. --- Mage.Client/pom.xml | 10 + .../src/main/java/mage/client/MageFrame.java | 30 +- .../mage/client/dialog/JoinTableDialog.java | 2 + .../java/mage/client/dialog/PhasesDialog.form | 326 ++++++++++++++++++ .../java/mage/client/dialog/PhasesDialog.java | 306 +++++++++++++--- .../java/mage/client/game/FeedbackPanel.java | 4 + .../main/java/mage/client/game/GamePanel.java | 4 + .../java/mage/client/game/PlayAreaPanel.java | 32 +- .../java/mage/client/util/PhaseManager.java | 75 ++++ Mage/src/mage/game/GameImpl.java | 2 +- 10 files changed, 706 insertions(+), 85 deletions(-) create mode 100644 Mage.Client/src/main/java/mage/client/dialog/PhasesDialog.form create mode 100644 Mage.Client/src/main/java/mage/client/util/PhaseManager.java diff --git a/Mage.Client/pom.xml b/Mage.Client/pom.xml index 304316f9c2a..f8bd7c6ac67 100644 --- a/Mage.Client/pom.xml +++ b/Mage.Client/pom.xml @@ -60,6 +60,16 @@ jetlang 0.2.4 + + com.jgoodies + forms + 1.2.1 + + + com.intellij + forms_rt + 7.0.3 +