Xmage 1.4.14v0

This commit is contained in:
LevelX2 2016-08-13 10:14:38 +02:00
parent 4bfac31370
commit 539b03bd1d
33 changed files with 60 additions and 57 deletions

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -24,10 +24,23 @@
* The views and conclusions contained in the software and documentation are those of the * 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 * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.client.deckeditor.collection.viewer; package mage.client.deckeditor.collection.viewer;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import javax.imageio.ImageIO;
import javax.swing.*;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardDimensions; import mage.cards.CardDimensions;
import mage.cards.MageCard; import mage.cards.MageCard;
@ -39,11 +52,11 @@ import mage.client.MageFrame;
import mage.client.cards.BigCard; import mage.client.cards.BigCard;
import mage.client.components.HoverButton; import mage.client.components.HoverButton;
import mage.client.plugins.impl.Plugins; import mage.client.plugins.impl.Plugins;
import mage.client.util.audio.AudioManager;
import mage.client.util.Command; import mage.client.util.Command;
import mage.client.util.Config; import mage.client.util.Config;
import mage.client.util.ImageHelper; import mage.client.util.ImageHelper;
import mage.client.util.NaturalOrderCardNumberComparator; import mage.client.util.NaturalOrderCardNumberComparator;
import mage.client.util.audio.AudioManager;
import mage.client.util.sets.ConstructedFormats; import mage.client.util.sets.ConstructedFormats;
import mage.components.ImagePanel; import mage.components.ImagePanel;
import mage.constants.Rarity; import mage.constants.Rarity;
@ -52,20 +65,6 @@ import org.apache.log4j.Logger;
import org.mage.card.arcane.GlowText; import org.mage.card.arcane.GlowText;
import org.mage.card.arcane.ManaSymbols; import org.mage.card.arcane.ManaSymbols;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/** /**
* Mage book with cards and page flipping. * Mage book with cards and page flipping.
* *
@ -204,7 +203,7 @@ public class MageBook extends JComponent {
currentPanel = jPanelRight; currentPanel = jPanelRight;
image = imageRight; image = imageRight;
currentTab = tab; currentTab = tab;
selectedTab = count-1; selectedTab = count - 1;
} }
} }
jPanelLeft.revalidate(); jPanelLeft.revalidate();
@ -233,8 +232,8 @@ public class MageBook extends JComponent {
} }
// calculate the x offset of the second (right) page // calculate the x offset of the second (right) page
int second_page_x = (conf.WIDTH - 2 * LEFT_RIGHT_PAGES_WIDTH) - int second_page_x = (conf.WIDTH - 2 * LEFT_RIGHT_PAGES_WIDTH)
(cardDimensions.frameWidth + CardPosition.GAP_X) * conf.CARD_COLUMNS + CardPosition.GAP_X - OFFSET_X; - (cardDimensions.frameWidth + CardPosition.GAP_X) * conf.CARD_COLUMNS + CardPosition.GAP_X - OFFSET_X;
rectangle.setLocation(second_page_x, OFFSET_Y); rectangle.setLocation(second_page_x, OFFSET_Y);
for (int i = conf.CARDS_PER_PAGE / 2; i < Math.min(conf.CARDS_PER_PAGE, size); i++) { for (int i = conf.CARDS_PER_PAGE / 2; i < Math.min(conf.CARDS_PER_PAGE, size); i++) {
@ -270,7 +269,7 @@ public class MageBook extends JComponent {
CardCriteria criteria = new CardCriteria(); CardCriteria criteria = new CardCriteria();
criteria.setCodes(set); criteria.setCodes(set);
List<CardInfo> cards = CardRepository.instance.findCards(criteria); List<CardInfo> cards = CardRepository.instance.findCards(criteria);
cards.sort(new NaturalOrderCardNumberComparator()); Collections.sort(cards, new NaturalOrderCardNumberComparator());
int start = page * conf.CARDS_PER_PAGE; int start = page * conf.CARDS_PER_PAGE;
int end = page * conf.CARDS_PER_PAGE + conf.CARDS_PER_PAGE; int end = page * conf.CARDS_PER_PAGE + conf.CARDS_PER_PAGE;
if (end > cards.size()) { if (end > cards.size()) {
@ -356,6 +355,7 @@ public class MageBook extends JComponent {
* Defines the position of the next card on the mage book * Defines the position of the next card on the mage book
*/ */
private static class CardPosition { private static class CardPosition {
private CardPosition() { private CardPosition() {
} }
@ -371,6 +371,7 @@ public class MageBook extends JComponent {
} }
abstract class Configuration { abstract class Configuration {
public int CARDS_PER_PAGE; public int CARDS_PER_PAGE;
public int CARD_ROWS; public int CARD_ROWS;
public int CARD_COLUMNS; public int CARD_COLUMNS;
@ -382,6 +383,7 @@ public class MageBook extends JComponent {
} }
class _3x3Configuration extends Configuration { class _3x3Configuration extends Configuration {
_3x3Configuration() { _3x3Configuration() {
this.WIDTH = 950; this.WIDTH = 950;
this.HEIGHT = 650; this.HEIGHT = 650;
@ -394,6 +396,7 @@ public class MageBook extends JComponent {
} }
class _4x4Configuration extends Configuration { class _4x4Configuration extends Configuration {
_4x4Configuration() { _4x4Configuration() {
this.WIDTH = 1250; this.WIDTH = 1250;
this.HEIGHT = 850; this.HEIGHT = 850;
@ -419,8 +422,8 @@ public class MageBook extends JComponent {
private static CardDimensions cardDimensions = new CardDimensions(1.2d); private static CardDimensions cardDimensions = new CardDimensions(1.2d);
private static final Logger log = Logger.getLogger(MageBook.class); private static final Logger log = Logger.getLogger(MageBook.class);
private Dimension cardDimension; private Dimension cardDimension;
private java.util.List<String> setsToDisplay = new ArrayList<String>(); private java.util.List<String> setsToDisplay = new ArrayList<>();
private java.util.List<HoverButton> tabs = new ArrayList<HoverButton>(); private java.util.List<HoverButton> tabs = new ArrayList<>();
private int selectedTab; private int selectedTab;
private static final String CENTER_PANEL_IMAGE_PATH = "/book_bg.jpg"; private static final String CENTER_PANEL_IMAGE_PATH = "/book_bg.jpg";

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-common</artifactId> <artifactId>mage-common</artifactId>

View file

@ -40,8 +40,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
*/ */
public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 13; public final static int MAGE_VERSION_PATCH = 14;
public final static String MAGE_VERSION_MINOR_PATCH = "v3"; public final static String MAGE_VERSION_MINOR_PATCH = "v0";
public final static String MAGE_VERSION_INFO = ""; public final static String MAGE_VERSION_INFO = "";
private final int major; private final int major;

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-plugins</artifactId> <artifactId>mage-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-counter-plugin</artifactId> <artifactId>mage-counter-plugin</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-plugins</artifactId> <artifactId>mage-plugins</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-deck-constructed</artifactId> <artifactId>mage-deck-constructed</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-deck-limited</artifactId> <artifactId>mage-deck-limited</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-game-commanderduel</artifactId> <artifactId>mage-game-commanderduel</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-game-commanderfreeforall</artifactId> <artifactId>mage-game-commanderfreeforall</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-game-freeforall</artifactId> <artifactId>mage-game-freeforall</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-game-momirduel</artifactId> <artifactId>mage-game-momirduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-game-tinyleadersduel</artifactId> <artifactId>mage-game-tinyleadersduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-game-twoplayerduel</artifactId> <artifactId>mage-game-twoplayerduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-player-ai-draftbot</artifactId> <artifactId>mage-player-ai-draftbot</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-player-ai-ma</artifactId> <artifactId>mage-player-ai-ma</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-player-ai</artifactId> <artifactId>mage-player-ai</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-player-ai-mcts</artifactId> <artifactId>mage-player-ai-mcts</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-player-aiminimax</artifactId> <artifactId>mage-player-aiminimax</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-player-human</artifactId> <artifactId>mage-player-human</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-tournament-boosterdraft</artifactId> <artifactId>mage-tournament-boosterdraft</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-tournament-constructed</artifactId> <artifactId>mage-tournament-constructed</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-tournament-sealed</artifactId> <artifactId>mage-tournament-sealed</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-server</artifactId> <artifactId>mage-server</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage-tests</artifactId> <artifactId>mage-tests</artifactId>

View file

@ -477,7 +477,7 @@ public class TestPlayer implements Player {
if (groups.length > 0) { if (groups.length > 0) {
if (groups[0].equals("Rollback")) { if (groups[0].equals("Rollback")) {
if (groups.length > 1 && groups[1].startsWith("turns=")) { if (groups.length > 1 && groups[1].startsWith("turns=")) {
int turns = Integer.parseUnsignedInt(groups[1].substring(6)); int turns = Integer.parseInt(groups[1].substring(6));
game.rollbackTurns(turns); game.rollbackTurns(turns);
actions.remove(action); actions.remove(action);
return true; return true;

View file

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
</parent> </parent>
<artifactId>mage</artifactId> <artifactId>mage</artifactId>

View file

@ -6,7 +6,7 @@
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.4.13</version> <version>1.4.14</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Mage Root</name> <name>Mage Root</name>
<description>Mage Root POM</description> <description>Mage Root POM</description>
@ -83,7 +83,7 @@
</repositories> </repositories>
<properties> <properties>
<mage-version>1.4.13</mage-version> <mage-version>1.4.14</mage-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>