- CheckStyle.

This commit is contained in:
Chris
2012-12-01 16:08:54 +00:00
parent 042dc9ab20
commit 88af2acb11
8 changed files with 105 additions and 87 deletions

View File

@@ -60,20 +60,21 @@ public enum CMatchUI implements CardContainer {
String strAvatarIcon = p.getLobbyPlayer().getPicture(); String strAvatarIcon = p.getLobbyPlayer().getPicture();
if (strAvatarIcon != null) { if (strAvatarIcon != null) {
final File f = new File(ForgeProps.getFile(NewConstants.IMAGE_ICON), strAvatarIcon); final File f = new File(ForgeProps.getFile(NewConstants.IMAGE_ICON), strAvatarIcon);
if (f.exists()) if (f.exists()) {
return new ImageIcon(f.getPath()).getImage(); return new ImageIcon(f.getPath()).getImage();
}
} }
int iAvatar = p.getLobbyPlayer().getAvatarIndex(); int iAvatar = p.getLobbyPlayer().getAvatarIndex();
return FSkin.getAvatars().get(iAvatar >= 0 ? iAvatar : defaultIndex); return FSkin.getAvatars().get(iAvatar >= 0 ? iAvatar : defaultIndex);
} }
private void setAvatar(final VField view, final Image img) private void setAvatar(final VField view, final Image img) {
{
view.getLblAvatar().setIcon(new ImageIcon(img)); view.getLblAvatar().setIcon(new ImageIcon(img));
view.getLblAvatar().getResizeTimer().start(); view.getLblAvatar().getResizeTimer().start();
} }
/** /**
* Instantiates at a match with a specified number of players * Instantiates at a match with a specified number of players
* and hands. * and hands.
@@ -83,10 +84,10 @@ public enum CMatchUI implements CardContainer {
*/ */
public void initMatch(final List<Player> players, Player localPlayer) { public void initMatch(final List<Player> players, Player localPlayer) {
// TODO fix for use with multiplayer // TODO fix for use with multiplayer
final String[] indices = Singletons.getModel().getPreferences().getPref(FPref.UI_AVATARS).split(","); final String[] indices = Singletons.getModel().getPreferences().getPref(FPref.UI_AVATARS).split(",");
// Instantiate all required field slots (user at 0) <-- that's not guaranteed // Instantiate all required field slots (user at 0) <-- that's not guaranteed
final List<VField> fields = new ArrayList<VField>(); final List<VField> fields = new ArrayList<VField>();
final List<VCommand> commands = new ArrayList<VCommand>(); final List<VCommand> commands = new ArrayList<VCommand>();
@@ -97,14 +98,16 @@ public enum CMatchUI implements CardContainer {
setAvatar(humanField, FSkin.getAvatars().get(Integer.parseInt(indices[0]))); setAvatar(humanField, FSkin.getAvatars().get(Integer.parseInt(indices[0])));
humanField.getLayoutControl().initialize(); humanField.getLayoutControl().initialize();
humanCommand.getLayoutControl().initialize(); humanCommand.getLayoutControl().initialize();
int i = 1; int i = 1;
for (Player p : players) { for (Player p : players) {
if (p.equals(localPlayer)) continue; if (p.equals(localPlayer)) {
continue;
}
// A field must be initialized after it's instantiated, to update player info. // A field must be initialized after it's instantiated, to update player info.
// No player, no init. // No player, no init.
VField f = new VField(EDocID.valueOf("FIELD_" + i), p); VField f = new VField(EDocID.valueOf("FIELD_" + i), p);
setAvatar(f, getPlayerAvatar(p, Integer.parseInt(indices[i%2]))); setAvatar(f, getPlayerAvatar(p, Integer.parseInt(indices[i % 2])));
f.getLayoutControl().initialize(); f.getLayoutControl().initialize();
fields.add(f); fields.add(f);
VCommand c = new VCommand(EDocID.valueOf("COMMAND_" + i), p); VCommand c = new VCommand(EDocID.valueOf("COMMAND_" + i), p);
@@ -112,11 +115,11 @@ public enum CMatchUI implements CardContainer {
commands.add(c); commands.add(c);
i++; i++;
} }
// Instantiate all required hand slots (user at 0) // Instantiate all required hand slots (user at 0)
final List<VHand> hands = new ArrayList<VHand>(); final List<VHand> hands = new ArrayList<VHand>();
VHand newHand = new VHand(EDocID.HAND_0, localPlayer); VHand newHand = new VHand(EDocID.HAND_0, localPlayer);
newHand.getLayoutControl().initialize(); newHand.getLayoutControl().initialize();
hands.add(newHand); hands.add(newHand);
@@ -167,12 +170,13 @@ public enum CMatchUI implements CardContainer {
public VField getFieldViewFor(Player p) { public VField getFieldViewFor(Player p) {
for (final VField f : VMatchUI.SINGLETON_INSTANCE.getFieldViews()) { for (final VField f : VMatchUI.SINGLETON_INSTANCE.getFieldViews()) {
if ( f.getLayoutControl().getPlayer().equals(p)) if (f.getLayoutControl().getPlayer().equals(p)) {
return f; return f;
}
} }
return null; return null;
} }
/** /**
* *
* Fires up trample dialog. Very old code, due for refactoring with new UI. * Fires up trample dialog. Very old code, due for refactoring with new UI.
@@ -235,8 +239,8 @@ public enum CMatchUI implements CardContainer {
public void setCard(final InventoryItem c) { public void setCard(final InventoryItem c) {
CDetail.SINGLETON_INSTANCE.showCard(c); CDetail.SINGLETON_INSTANCE.showCard(c);
CPicture.SINGLETON_INSTANCE.showCard(c); CPicture.SINGLETON_INSTANCE.showCard(c);
} }
@Override @Override
public Card getCard() { public Card getCard() {
return CDetail.SINGLETON_INSTANCE.getCurrentCard(); return CDetail.SINGLETON_INSTANCE.getCurrentCard();

View File

@@ -32,7 +32,7 @@ public class ControlWinLose {
private final ViewWinLose view; private final ViewWinLose view;
protected final MatchController match; protected final MatchController match;
/** @param v &emsp; ViewWinLose /** @param v &emsp; ViewWinLose
* @param match */ * @param match */
public ControlWinLose(final ViewWinLose v, MatchController match) { public ControlWinLose(final ViewWinLose v, MatchController match) {
this.view = v; this.view = v;
@@ -69,14 +69,14 @@ public class ControlWinLose {
public void actionOnContinue() { public void actionOnContinue() {
SOverlayUtils.hideOverlay(); SOverlayUtils.hideOverlay();
saveOptions(); saveOptions();
boolean isAnte = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ANTE); boolean isAnte = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ANTE);
//This is called from QuestWinLose also. If we're in a quest, this is already handled elsewhere //This is called from QuestWinLose also. If we're in a quest, this is already handled elsewhere
if (isAnte && match.getGameType() != GameType.Quest) { if (isAnte && match.getGameType() != GameType.Quest) {
executeAnte(); executeAnte();
} }
match.startRound(); match.startRound();
} }
@@ -111,14 +111,19 @@ public class ControlWinLose {
*/ */
private void executeAnte() { private void executeAnte() {
List<GameOutcome> games = match.getPlayedGames(); List<GameOutcome> games = match.getPlayedGames();
GameOutcome lastGame = match.getLastGameOutcome(); GameOutcome lastGame = match.getLastGameOutcome();
if ( games.isEmpty() ) return; if (games.isEmpty()) {
return;
for (Player p: Singletons.getModel().getGame().getRegisteredPlayers()) { }
if (!p.getName().equals(lastGame.getWinner().getName())) continue; // not a loser
for (Player p : Singletons.getModel().getGame().getRegisteredPlayers()) {
if (!p.getName().equals(lastGame.getWinner().getName())) {
continue; // not a loser
}
// remove all the lost cards from owners' decks // remove all the lost cards from owners' decks
List<CardPrinted> losses = new ArrayList<CardPrinted>(); List<CardPrinted> losses = new ArrayList<CardPrinted>();
for (Player loser : Singletons.getModel().getGame().getRegisteredPlayers()) { for (Player loser : Singletons.getModel().getGame().getRegisteredPlayers()) {

View File

@@ -44,7 +44,7 @@ public class GauntletWinLose extends ControlWinLose {
* Instantiates a new gauntlet win/lose handler. * Instantiates a new gauntlet win/lose handler.
* *
* @param view0 ViewWinLose object * @param view0 ViewWinLose object
* @param match * @param match
*/ */
public GauntletWinLose(final ViewWinLose view0, MatchController match) { public GauntletWinLose(final ViewWinLose view0, MatchController match) {
super(view0, match); super(view0, match);
@@ -82,7 +82,8 @@ public class GauntletWinLose extends ControlWinLose {
LobbyPlayer questPlayer = Singletons.getControl().getLobby().getQuestPlayer(); LobbyPlayer questPlayer = Singletons.getControl().getLobby().getQuestPlayer();
if (match.isMatchOver()) { if (match.isMatchOver()) {
// In all cases, update stats. // In all cases, update stats.
lstEventRecords.set(gd.getCompleted(), match.getGamesWonBy(questPlayer) + " - " + ( match.getPlayedGames().size() - match.getGamesWonBy(questPlayer) ) ); lstEventRecords.set(gd.getCompleted(), match.getGamesWonBy(questPlayer) + " - "
+ (match.getPlayedGames().size() - match.getGamesWonBy(questPlayer)));
gd.setCompleted(gd.getCompleted() + 1); gd.setCompleted(gd.getCompleted() + 1);
// Win match case // Win match case

View File

@@ -181,7 +181,7 @@ public class LimitedWinLose extends ControlWinLose {
SOverlayUtils.hideOverlay(); SOverlayUtils.hideOverlay();
saveOptions(); saveOptions();
gauntlet.nextRound(); gauntlet.nextRound();
} }
else { // noone will get here - if round is lost, the button is inivisible anyway else { // noone will get here - if round is lost, the button is inivisible anyway
super.actionOnContinue(); super.actionOnContinue();
} }

View File

@@ -92,7 +92,7 @@ public class QuestWinLose extends ControlWinLose {
* Instantiates a new quest win lose handler. * Instantiates a new quest win lose handler.
* *
* @param view0 ViewWinLose object * @param view0 ViewWinLose object
* @param match2 * @param match2
*/ */
public QuestWinLose(final ViewWinLose view0, MatchController match2) { public QuestWinLose(final ViewWinLose view0, MatchController match2) {
super(view0, match2); super(view0, match2);
@@ -117,28 +117,32 @@ public class QuestWinLose extends ControlWinLose {
public final boolean populateCustomPanel() { public final boolean populateCustomPanel() {
this.getView().getBtnRestart().setVisible(false); this.getView().getBtnRestart().setVisible(false);
qData.getCards().resetNewList(); qData.getCards().resetNewList();
QuestController qc = Singletons.getModel().getQuest(); QuestController qc = Singletons.getModel().getQuest();
LobbyPlayer questPlayer = Singletons.getControl().getLobby().getQuestPlayer(); LobbyPlayer questPlayer = Singletons.getControl().getLobby().getQuestPlayer();
if (isAnte) { if (isAnte) {
//do per-game actions //do per-game actions
GameOutcome outcome = match.getLastGameOutcome(); GameOutcome outcome = match.getLastGameOutcome();
// Ante returns to owners in a draw // Ante returns to owners in a draw
if (!outcome.isDraw()) { if (!outcome.isDraw()) {
boolean isHumanWinner = outcome.getWinner().equals(questPlayer); boolean isHumanWinner = outcome.getWinner().equals(questPlayer);
final List<CardPrinted> anteCards = new ArrayList<CardPrinted>(); final List<CardPrinted> anteCards = new ArrayList<CardPrinted>();
for( Player p : Singletons.getModel().getGame().getRegisteredPlayers() ) { for (Player p : Singletons.getModel().getGame().getRegisteredPlayers()) {
if (p.getLobbyPlayer().equals(questPlayer) == isHumanWinner) continue; if (p.getLobbyPlayer().equals(questPlayer) == isHumanWinner) {
for(Card c : p.getCardsIn(ZoneType.Ante)) continue;
}
for (Card c : p.getCardsIn(ZoneType.Ante)) {
anteCards.add(CardDb.instance().getCard(c)); anteCards.add(CardDb.instance().getCard(c));
}
} }
if (isHumanWinner) { if (isHumanWinner) {
qc.getCards().addAllCards(anteCards); qc.getCards().addAllCards(anteCards);
this.anteWon(anteCards); this.anteWon(anteCards);
} else { } else {
for(CardPrinted c : anteCards) for (CardPrinted c : anteCards) {
qc.getCards().loseCard(c); qc.getCards().loseCard(c);
}
this.anteLost(anteCards); this.anteLost(anteCards);
} }
} }
@@ -159,7 +163,7 @@ public class QuestWinLose extends ControlWinLose {
// TODO: We don't have a enum for difficulty? // TODO: We don't have a enum for difficulty?
int difficulty = qData.getAchievements().getDifficulty(); int difficulty = qData.getAchievements().getDifficulty();
final int wins = qData.getAchievements().getWin(); final int wins = qData.getAchievements().getWin();
// Win case // Win case
if (this.wonMatch) { if (this.wonMatch) {
@@ -181,7 +185,7 @@ public class QuestWinLose extends ControlWinLose {
} }
// Award jackpot every 80 games won (currently 10 rares) // Award jackpot every 80 games won (currently 10 rares)
if ((wins > 0) && ((wins % 80) == 0)) { if ((wins > 0) && ((wins % 80) == 0)) {
this.awardJackpot(); this.awardJackpot();
} }
@@ -335,23 +339,23 @@ public class QuestWinLose extends ControlWinLose {
sb.append(diff + " opponent: " + credBase + " credits.<br>"); sb.append(diff + " opponent: " + credBase + " credits.<br>");
// Gameplay bonuses (for each game win) // Gameplay bonuses (for each game win)
boolean hasNeverLost = true; boolean hasNeverLost = true;
LobbyPlayer localHuman = Singletons.getControl().getLobby().getQuestPlayer(); LobbyPlayer localHuman = Singletons.getControl().getLobby().getQuestPlayer();
for (final GameOutcome game : match.getPlayedGames()) { for (final GameOutcome game : match.getPlayedGames()) {
if (!game.isWinner(localHuman)) { if (!game.isWinner(localHuman)) {
hasNeverLost = false; hasNeverLost = false;
continue; // no rewards for losing a game continue; // no rewards for losing a game
} }
// Alternate win // Alternate win
// final PlayerStatistics aiRating = game.getStatistics(computer.getName()); // final PlayerStatistics aiRating = game.getStatistics(computer.getName());
PlayerStatistics humanRating = null; PlayerStatistics humanRating = null;
for(Entry<LobbyPlayer, PlayerStatistics> kvRating : game ) { for (Entry<LobbyPlayer, PlayerStatistics> kvRating : game) {
if( kvRating.getKey().equals(localHuman)) { if (kvRating.getKey().equals(localHuman)) {
humanRating = kvRating.getValue(); humanRating = kvRating.getValue();
continue; continue;
} }
final PlayerOutcome outcome = kvRating.getValue().getOutcome(); final PlayerOutcome outcome = kvRating.getValue().getOutcome();
final GameLossReason whyAiLost = outcome.lossState; final GameLossReason whyAiLost = outcome.lossState;
final int altReward = this.getCreditsRewardForAltWin(whyAiLost); final int altReward = this.getCreditsRewardForAltWin(whyAiLost);
@@ -375,7 +379,7 @@ public class QuestWinLose extends ControlWinLose {
break; break;
} }
} }
credGameplay += 50; credGameplay += 50;
sb.append(String.format("Alternate win condition: <u>%s</u>! " + "Bonus: %d credits.<br>", sb.append(String.format("Alternate win condition: <u>%s</u>! " + "Bonus: %d credits.<br>",
winConditionName, 50)); winConditionName, 50));
@@ -708,9 +712,11 @@ public class QuestWinLose extends ControlWinLose {
* @return int * @return int
*/ */
private int getCreditsRewardForAltWin(final GameLossReason whyAiLost) { private int getCreditsRewardForAltWin(final GameLossReason whyAiLost) {
QuestPreferences qp = Singletons.getModel().getQuestPreferences(); QuestPreferences qp = Singletons.getModel().getQuestPreferences();
if ( null == whyAiLost) // Felidar, Helix Pinnacle, etc. if (null == whyAiLost) {
// Felidar, Helix Pinnacle, etc.
return qp.getPreferenceInt(QPref.REWARDS_UNDEFEATED); return qp.getPreferenceInt(QPref.REWARDS_UNDEFEATED);
}
switch (whyAiLost) { switch (whyAiLost) {
case LifeReachedZero: case LifeReachedZero:
return 0; // nothing special here, ordinary kill return 0; // nothing special here, ordinary kill

View File

@@ -58,7 +58,7 @@ public enum TargetingOverlay {
private final List<Point[]> arcs = new ArrayList<Point[]>(); private final List<Point[]> arcs = new ArrayList<Point[]>();
private CardPanel activePanel = null; private CardPanel activePanel = null;
/** /**
* Semi-transparent overlay panel. Should be used with layered panes. * Semi-transparent overlay panel. Should be used with layered panes.
*/ */
@@ -122,7 +122,7 @@ public enum TargetingOverlay {
// Only work with the active panel // Only work with the active panel
if (activePanel == null) { return; } if (activePanel == null) { return; }
Card c = activePanel.getCard(); Card c = activePanel.getCard();
Card enchanting = c.getEnchantingCard(); Card enchanting = c.getEnchantingCard();
List<Card> enchantedBy = c.getEnchantedBy(); List<Card> enchantedBy = c.getEnchantedBy();
List<Card> blocking = c.getBlockedThisTurn(); List<Card> blocking = c.getBlockedThisTurn();
@@ -207,7 +207,7 @@ public enum TargetingOverlay {
*/ */
// Arrow drawing code by the MAGE team, used with permission. // Arrow drawing code by the MAGE team, used with permission.
private Area getArrow (float length, float bendPercent) { private Area getArrow(float length, float bendPercent) {
float p1x = 0, p1y = 0; float p1x = 0, p1y = 0;
float p2x = length, p2y = 0; float p2x = length, p2y = 0;
float cx = length / 2, cy = length / 8f * bendPercent; float cx = length / 2, cy = length / 8f * bendPercent;
@@ -216,10 +216,10 @@ public enum TargetingOverlay {
float headSize = 17; float headSize = 17;
float adjSize, ex, ey, abs_e; float adjSize, ex, ey, abs_e;
adjSize = (float)(bodyWidth / 2 / Math.sqrt(2)); adjSize = (float) (bodyWidth / 2 / Math.sqrt(2));
ex = p2x - cx; ex = p2x - cx;
ey = p2y - cy; ey = p2y - cy;
abs_e = (float)Math.sqrt(ex * ex + ey * ey); abs_e = (float) Math.sqrt(ex * ex + ey * ey);
ex /= abs_e; ex /= abs_e;
ey /= abs_e; ey /= abs_e;
GeneralPath bodyPath = new GeneralPath(); GeneralPath bodyPath = new GeneralPath();
@@ -229,10 +229,10 @@ public enum TargetingOverlay {
bodyPath.quadTo(cx, cy, p2x - (ey + ex) * adjSize, p2y + (ex - ey) * adjSize); bodyPath.quadTo(cx, cy, p2x - (ey + ex) * adjSize, p2y + (ex - ey) * adjSize);
bodyPath.closePath(); bodyPath.closePath();
adjSize = (float)(headSize / Math.sqrt(2)); adjSize = (float) (headSize / Math.sqrt(2));
ex = p2x - cx; ex = p2x - cx;
ey = p2y - cy; ey = p2y - cy;
abs_e = (float)Math.sqrt(ex * ex + ey * ey); abs_e = (float) Math.sqrt(ex * ex + ey * ey);
ex /= abs_e; ex /= abs_e;
ey /= abs_e; ey /= abs_e;
GeneralPath headPath = new GeneralPath(); GeneralPath headPath = new GeneralPath();
@@ -251,10 +251,12 @@ public enum TargetingOverlay {
float ey = endY - startY; float ey = endY - startY;
if (ex == 0 && ey == 0) { return; } if (ex == 0 && ey == 0) { return; }
float length = (float)Math.sqrt(ex * ex + ey * ey); float length = (float) Math.sqrt(ex * ex + ey * ey);
float bendPercent = (float)Math.asin(ey / length); float bendPercent = (float) Math.asin(ey / length);
if (endX > startX) bendPercent = -bendPercent; if (endX > startX) {
bendPercent = -bendPercent;
}
Area arrow = getArrow(length, bendPercent); Area arrow = getArrow(length, bendPercent);
AffineTransform af = g2d.getTransform(); AffineTransform af = g2d.getTransform();
@@ -289,16 +291,16 @@ public enum TargetingOverlay {
assembleArcs(); assembleArcs();
if (arcs.size() < 1) { return; } if (arcs.size() < 1) { return; }
for (Point[] p : arcs) { for (Point[] p : arcs) {
if (p[0] == null || p[1] == null) { if (p[0] == null || p[1] == null) {
continue; continue;
} }
int endX = (int)p[0].getX(); int endX = (int) p[0].getX();
int endY = (int)p[0].getY(); int endY = (int) p[0].getY();
int startX = (int)p[1].getX(); int startX = (int) p[1].getX();
int startY = (int)p[1].getY(); int startY = (int) p[1].getY();
Color color = FSkin.getColor(FSkin.Colors.CLR_ACTIVE); Color color = FSkin.getColor(FSkin.Colors.CLR_ACTIVE);
drawArrow(g2d, startX, startY, endX, endY, color); drawArrow(g2d, startX, startY, endX, endY, color);

View File

@@ -82,20 +82,20 @@ public class VAssignDamage {
private boolean canAssignToIndex(Integer selectedIndex) { private boolean canAssignToIndex(Integer selectedIndex) {
Integer active = this.activeIndex; Integer active = this.activeIndex;
if (selectedIndex == null) { if (selectedIndex == null) {
// Trying to assign to the opponent // Trying to assign to the opponent
if (active == null) { if (active == null) {
return true; return true;
} }
if (active != this.lstDamage.size() -1) { if (active != this.lstDamage.size() - 1) {
return false; return false;
} }
int activeLethal = this.deathtouch ? 1 : lstDefenders.get(active).getLethalDamage(); int activeLethal = this.deathtouch ? 1 : lstDefenders.get(active).getLethalDamage();
int assignedToActive = lstDamage.get(active); int assignedToActive = lstDamage.get(active);
if (assignedToActive < activeLethal) { if (assignedToActive < activeLethal) {
return false; return false;
} }
@@ -105,22 +105,22 @@ public class VAssignDamage {
if (active == null) { if (active == null) {
return false; return false;
} }
if (active.equals(selectedIndex)) { if (active.equals(selectedIndex)) {
return true; return true;
} }
int activeLethal = this.deathtouch ? 1 : lstDefenders.get(active).getLethalDamage(); int activeLethal = this.deathtouch ? 1 : lstDefenders.get(active).getLethalDamage();
int assignedToActive = lstDamage.get(active); int assignedToActive = lstDamage.get(active);
if (active != selectedIndex - 1 || assignedToActive < activeLethal) { if (active != selectedIndex - 1 || assignedToActive < activeLethal) {
return false; return false;
} }
} }
return true; return true;
} }
// Mouse actions // Mouse actions
private final MouseAdapter madDefender = new MouseAdapter() { private final MouseAdapter madDefender = new MouseAdapter() {
@Override @Override
@@ -143,7 +143,7 @@ public class VAssignDamage {
public void mousePressed(final MouseEvent evt) { public void mousePressed(final MouseEvent evt) {
Card source = ((CardPanel) evt.getSource()).getCard(); Card source = ((CardPanel) evt.getSource()).getCard();
int index = lstDefenders.indexOf(source); int index = lstDefenders.indexOf(source);
// Allow click if this is active, or next to active and active has lethal // Allow click if this is active, or next to active and active has lethal
if (!VAssignDamage.this.canAssignToIndex(index)) { if (!VAssignDamage.this.canAssignToIndex(index)) {
return; return;
@@ -154,7 +154,7 @@ public class VAssignDamage {
// If lethal damage has already been assigned just act like it's 0. // If lethal damage has already been assigned just act like it's 0.
int lethal = VAssignDamage.this.deathtouch ? 1 : Math.max(0, source.getLethalDamage()); int lethal = VAssignDamage.this.deathtouch ? 1 : Math.max(0, source.getLethalDamage());
int assignedDamage = 1; int assignedDamage = 1;
// Add damage for left clicks, as much as we can for ctrl clicking // Add damage for left clicks, as much as we can for ctrl clicking
if (SwingUtilities.isLeftMouseButton(evt)) { if (SwingUtilities.isLeftMouseButton(evt)) {
if (meta) { if (meta) {
@@ -166,7 +166,7 @@ public class VAssignDamage {
assignCombatantDamage(source, assignedDamage); assignCombatantDamage(source, assignedDamage);
} }
// Remove damage for right clicks, as much as we can for ctrl clicking // Remove damage for right clicks, as much as we can for ctrl clicking
else if (SwingUtilities.isRightMouseButton(evt)) { else if (SwingUtilities.isRightMouseButton(evt)) {
if (meta) { if (meta) {
@@ -246,10 +246,10 @@ public class VAssignDamage {
private final Command cmdOK = new Command() { @Override private final Command cmdOK = new Command() { @Override
public void execute() { finish(); } }; public void execute() { finish(); } };
private final Command cmdReset = new Command() { @Override private final Command cmdReset = new Command() { @Override
public void execute() { resetAssignDamage(); } }; public void execute() { resetAssignDamage(); } };
private final Command cmdAuto = new Command() { @Override private final Command cmdAuto = new Command() { @Override
public void execute() { autoAssignDamage(); } }; public void execute() { autoAssignDamage(); } };

View File

@@ -45,7 +45,7 @@ public enum VMatchUI implements IVTopLevelUI {
EDocID.valueOf("FIELD_" + i).setDoc( EDocID.valueOf("FIELD_" + i).setDoc(
new VEmptyDoc(EDocID.valueOf("FIELD_" + i))); new VEmptyDoc(EDocID.valueOf("FIELD_" + i)));
} }
// Create empty docs for all field slots // Create empty docs for all field slots
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
EDocID.valueOf("COMMAND_" + i).setDoc( EDocID.valueOf("COMMAND_" + i).setDoc(
@@ -103,7 +103,7 @@ public enum VMatchUI implements IVTopLevelUI {
lstFields.get(1).getParentCell().addDoc(lstFields.get(i)); lstFields.get(1).getParentCell().addDoc(lstFields.get(i));
} }
} }
// Add extra players alternatively to existing user/AI field panels. // Add extra players alternatively to existing user/AI field panels.
for (int i = 2; i < lstCommands.size(); i++) { for (int i = 2; i < lstCommands.size(); i++) {
// If already in layout, no need to add again. // If already in layout, no need to add again.