mirror of
https://github.com/correl/mage.git
synced 2025-03-16 09:16:26 -09:00
commit
b64bf15c5f
457 changed files with 5951 additions and 3154 deletions
|
@ -613,7 +613,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static MagePane getTopMost(MagePane exclude) {
|
public static MagePane getTopMost(MagePane exclude) {
|
||||||
MagePane topmost = null;
|
MagePane topmost = null;
|
||||||
int best = Integer.MAX_VALUE;
|
int best = Integer.MAX_VALUE;
|
||||||
for (Component frame : desktopPane.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER)) {
|
for (Component frame : desktopPane.getComponentsInLayer(JLayeredPane.DEFAULT_LAYER)) {
|
||||||
|
|
|
@ -1217,7 +1217,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
||||||
String searchStr = "";
|
String searchStr = "";
|
||||||
if (searchByTextField.getText().length() >= 3) {
|
if (searchByTextField.getText().length() >= 3) {
|
||||||
useText = true;
|
useText = true;
|
||||||
searchStr = searchByTextField.getText().toLowerCase();
|
searchStr = searchByTextField.getText().toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CardType cardType : selectByTypeButtons.keySet()) {
|
for (CardType cardType : selectByTypeButtons.keySet()) {
|
||||||
|
@ -1267,20 +1267,20 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
||||||
boolean s = card.isSelected();
|
boolean s = card.isSelected();
|
||||||
// Name
|
// Name
|
||||||
if (!s) {
|
if (!s) {
|
||||||
s |= card.getName().toLowerCase().contains(searchStr);
|
s |= card.getName().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
// Sub & Super Types
|
// Sub & Super Types
|
||||||
if (!s) {
|
if (!s) {
|
||||||
for (SuperType str : card.getSuperTypes()) {
|
for (SuperType str : card.getSuperTypes()) {
|
||||||
s |= str.toString().toLowerCase().contains(searchStr);
|
s |= str.toString().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
for (SubType str : card.getSubTypes()) {
|
for (SubType str : card.getSubTypes()) {
|
||||||
s |= str.toString().toLowerCase().contains(searchStr);
|
s |= str.toString().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Rarity
|
// Rarity
|
||||||
if (!s) {
|
if (!s) {
|
||||||
s |= card.getRarity().toString().toLowerCase().contains(searchStr);
|
s |= card.getRarity().toString().toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
// Type line
|
// Type line
|
||||||
if (!s) {
|
if (!s) {
|
||||||
|
@ -1288,7 +1288,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
||||||
for (CardType type : card.getCardTypes()) {
|
for (CardType type : card.getCardTypes()) {
|
||||||
t += ' ' + type.toString();
|
t += ' ' + type.toString();
|
||||||
}
|
}
|
||||||
s |= t.toLowerCase().contains(searchStr);
|
s |= t.toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
// Casting cost
|
// Casting cost
|
||||||
if (!s) {
|
if (!s) {
|
||||||
|
@ -1296,12 +1296,12 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
||||||
for (String m : card.getManaCost()) {
|
for (String m : card.getManaCost()) {
|
||||||
mc += m;
|
mc += m;
|
||||||
}
|
}
|
||||||
s |= mc.toLowerCase().contains(searchStr);
|
s |= mc.toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
// Rules
|
// Rules
|
||||||
if (!s) {
|
if (!s) {
|
||||||
for (String str : card.getRules()) {
|
for (String str : card.getRules()) {
|
||||||
s |= str.toLowerCase().contains(searchStr);
|
s |= str.toLowerCase(Locale.ENGLISH).contains(searchStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
card.setSelected(s);
|
card.setSelected(s);
|
||||||
|
@ -1348,21 +1348,21 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
||||||
}
|
}
|
||||||
// Sub & Super Types
|
// Sub & Super Types
|
||||||
for (SuperType type : card.getSuperTypes()) {
|
for (SuperType type : card.getSuperTypes()) {
|
||||||
t += ' ' + type.toString().toLowerCase();
|
t += ' ' + type.toString().toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
for (SubType str : card.getSubTypes()) {
|
for (SubType str : card.getSubTypes()) {
|
||||||
t += " " + str.toString().toLowerCase();
|
t += " " + str.toString().toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String qty : qtys.keySet()) {
|
for (String qty : qtys.keySet()) {
|
||||||
int value = qtys.get(qty);
|
int value = qtys.get(qty);
|
||||||
if (t.toLowerCase().contains(qty)) {
|
if (t.toLowerCase(Locale.ENGLISH).contains(qty)) {
|
||||||
qtys.put(qty, ++value);
|
qtys.put(qty, ++value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rules
|
// Rules
|
||||||
for (String str : card.getRules()) {
|
for (String str : card.getRules()) {
|
||||||
if (str.toLowerCase().contains(qty)) {
|
if (str.toLowerCase(Locale.ENGLISH).contains(qty)) {
|
||||||
qtys.put(qty, ++value);
|
qtys.put(qty, ++value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1380,10 +1380,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
||||||
}
|
}
|
||||||
mc = mc.replaceAll("\\{([WUBRG]).([WUBRG])\\}", "{$1}{$2}");
|
mc = mc.replaceAll("\\{([WUBRG]).([WUBRG])\\}", "{$1}{$2}");
|
||||||
mc = mc.replaceAll("\\{", "#");
|
mc = mc.replaceAll("\\{", "#");
|
||||||
mc = mc.toLowerCase();
|
mc = mc.toLowerCase(Locale.ENGLISH);
|
||||||
for (String pip : pips.keySet()) {
|
for (String pip : pips.keySet()) {
|
||||||
int value = pips.get(pip);
|
int value = pips.get(pip);
|
||||||
while (mc.toLowerCase().contains(pip)) {
|
while (mc.toLowerCase(Locale.ENGLISH).contains(pip)) {
|
||||||
pips.put(pip, ++value);
|
pips.put(pip, ++value);
|
||||||
mc = mc.replaceFirst(pip, "");
|
mc = mc.replaceFirst(pip, "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ import java.awt.Font;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -196,15 +197,15 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
||||||
|
|
||||||
Pattern profanityPattern = Pattern.compile(".*(1ab1a|1d1ot|13p3r|13sb1ans|13sbo|13s13|13sb1an|13sbo|13sy|1nbr3d|1nc3st|1njun|1ub3|\\Wbj|\\Wcum|\\Wdum|\\Wfag|\\Wfap|\\W[sf]uk|\\Wj1s|\\Wp3do|\\Wp33|\\Wpoo\\W|\\Wt1t|aho13|an1ngu|ana1|anus|ar3o1a|ar3o13|ary1an|axyx|axyxhat|axyxho13|axyxmast3r|axyxmunch|axyxw1p3|b1atch|b1gt1t|b1mbo|b1ow|b1tch|ba1s|bab3|bang|barf|bastard|bawdy|b3an3r|b3ard3dc1am|b3ast1a1ty|b3atch|b3at3r|b3av3r|b3otch|b3yotch|bo1nk|bod1y|bon3d|bon3r|bon3|bob|bot13|boty|bow31|br3ast|bug3r|bukak3|bung|busty|buxyx|c1t|caca|cahon3|cam31to3|carp3tmunch3r|cawk|c3rv1x|ch1nc|ch1nk|chod3|co1ta1|cockb1ock|cockho1st3r|cocknock3r|cocksmok3r|cocksuck3r|cock|condom|corksuck3r|crabs|cums1ut|cumshot|cumsta1n|cnt|cun1ngus|cuntfac3|cunthunt3r|cunt|d1ck|d1k3|d1do|d1mw1t|d1ng13|d1psh1p|dago|dam1t|damn1t|damn3d|damn|dawg13sty13|dog13sty13|dogysty13|dong|dop3y|douch3|drunk|dumb|dumas|dum|dumbas|dumy|dyk3|3jacu1at3|3n1arg3m3nt|3r3ct1on|3r3ct|3rot1c|3xtacy|3xtasy|f.ck|f1osy|f1st3d|f1st1ng|f1sty|fa1gt|fa1g|fack|fag1t|fag3d|fagot|fag|[sf]cuk|f31at1o|f31at3|f31ch1ng|f31ch3r|f31ch|f31tch3r|f31tch|foad|fobar|fond13|for3sk1n|fu.k|fudg3pack3r|[sf]uk|g1ans|g1go1o|ganja|ghay|gh3y|go1d3nshow3r|gonad|gok|gr1ngo|h1t13r|handjob|hardon|hokah|hok3r|homo|honky|hor|hotch|hot3r|horny|hump1ng|hump3d|hump|hym3n|j1sm|j1s3d|j1sm|j1s|jackas|jackho13|jackof|j3rk3d|j3rkof|j3rk|junk13|junky|k1an|k1k3|k1nky|knob3nd|kyk3|mams|masa|mast3rba|masturba|max1|m3ns3s|m3nstruat|m[sf]uck1ng|mofo|moron|moth3rf|mthrf|muf|n1ger|n1ga|n1mrod|n1ny|n1p13|nak3d|napa1m|napy|nas1|n3gro|noky|nympho|op1at3|op1um|ora1y|ora1|org13s|organ|orgasm|orgy|ovary|ovum|p1owb1t3r|p1mp|p1nko|p1s3d|p1sof|p1s|pak1|pant13|panty|past13|pasty|p3ck3r|p3doph1|p3p3|p3n1a1|p3n13|p3n1s|p3n3trat1on|p3n3trat3|p3rv3rs1on|p3yot3|pha1c|phuck|po1ack|po1ock|pontang|pop|pr1ck|pr1g|pron|pub1|pub3|punkas|punky|pus1|pusy|puto|qu1cky|qu1ck13|qu1m|qu3af|qu3ro|qu3rs|qu3r|r1mjob|r1tard|racy|rap1st|rap3d|rap3r|rap3|raunch|r31ch|r3cta1|r3ctum|r3ctus|r3tard|r3tar|rtard|rumpram3r|rump|s1av3|s13as|s1ut|sack|sad1s|scag|sch1ong|sch1so|scr3w|scrog|scrot|scrud|scum|s3aman|s3am3n|s3duc3|s3m3n|s3xua1|sh1t|skag|skank|sm3gma|smut|sn1p3r|snatch|sodom|sp1ck|sp1c|sp1k|sp3rm|spunk|st3amy|stfu|ston3d|str1p|strok3|stup1d|suck|sumofab1atch|t1nk13|t1t[sf]uck|tampon|tard|t3abag1ng|t3at|t3st1|t3st3|t3urd|thrust|tramp|trans|trashy|twat|ug1y|unw3d|ur1n3a|ut3rus|vag1na|vu1gar|vu1va|w1g3r|wang|wank3r|wank|w31n3r|w31rdo|w3dg13|w3n13|w3tback|w3w3|wh1t3y|wh1s|whor3).*");
|
Pattern profanityPattern = Pattern.compile(".*(1ab1a|1d1ot|13p3r|13sb1ans|13sbo|13s13|13sb1an|13sbo|13sy|1nbr3d|1nc3st|1njun|1ub3|\\Wbj|\\Wcum|\\Wdum|\\Wfag|\\Wfap|\\W[sf]uk|\\Wj1s|\\Wp3do|\\Wp33|\\Wpoo\\W|\\Wt1t|aho13|an1ngu|ana1|anus|ar3o1a|ar3o13|ary1an|axyx|axyxhat|axyxho13|axyxmast3r|axyxmunch|axyxw1p3|b1atch|b1gt1t|b1mbo|b1ow|b1tch|ba1s|bab3|bang|barf|bastard|bawdy|b3an3r|b3ard3dc1am|b3ast1a1ty|b3atch|b3at3r|b3av3r|b3otch|b3yotch|bo1nk|bod1y|bon3d|bon3r|bon3|bob|bot13|boty|bow31|br3ast|bug3r|bukak3|bung|busty|buxyx|c1t|caca|cahon3|cam31to3|carp3tmunch3r|cawk|c3rv1x|ch1nc|ch1nk|chod3|co1ta1|cockb1ock|cockho1st3r|cocknock3r|cocksmok3r|cocksuck3r|cock|condom|corksuck3r|crabs|cums1ut|cumshot|cumsta1n|cnt|cun1ngus|cuntfac3|cunthunt3r|cunt|d1ck|d1k3|d1do|d1mw1t|d1ng13|d1psh1p|dago|dam1t|damn1t|damn3d|damn|dawg13sty13|dog13sty13|dogysty13|dong|dop3y|douch3|drunk|dumb|dumas|dum|dumbas|dumy|dyk3|3jacu1at3|3n1arg3m3nt|3r3ct1on|3r3ct|3rot1c|3xtacy|3xtasy|f.ck|f1osy|f1st3d|f1st1ng|f1sty|fa1gt|fa1g|fack|fag1t|fag3d|fagot|fag|[sf]cuk|f31at1o|f31at3|f31ch1ng|f31ch3r|f31ch|f31tch3r|f31tch|foad|fobar|fond13|for3sk1n|fu.k|fudg3pack3r|[sf]uk|g1ans|g1go1o|ganja|ghay|gh3y|go1d3nshow3r|gonad|gok|gr1ngo|h1t13r|handjob|hardon|hokah|hok3r|homo|honky|hor|hotch|hot3r|horny|hump1ng|hump3d|hump|hym3n|j1sm|j1s3d|j1sm|j1s|jackas|jackho13|jackof|j3rk3d|j3rkof|j3rk|junk13|junky|k1an|k1k3|k1nky|knob3nd|kyk3|mams|masa|mast3rba|masturba|max1|m3ns3s|m3nstruat|m[sf]uck1ng|mofo|moron|moth3rf|mthrf|muf|n1ger|n1ga|n1mrod|n1ny|n1p13|nak3d|napa1m|napy|nas1|n3gro|noky|nympho|op1at3|op1um|ora1y|ora1|org13s|organ|orgasm|orgy|ovary|ovum|p1owb1t3r|p1mp|p1nko|p1s3d|p1sof|p1s|pak1|pant13|panty|past13|pasty|p3ck3r|p3doph1|p3p3|p3n1a1|p3n13|p3n1s|p3n3trat1on|p3n3trat3|p3rv3rs1on|p3yot3|pha1c|phuck|po1ack|po1ock|pontang|pop|pr1ck|pr1g|pron|pub1|pub3|punkas|punky|pus1|pusy|puto|qu1cky|qu1ck13|qu1m|qu3af|qu3ro|qu3rs|qu3r|r1mjob|r1tard|racy|rap1st|rap3d|rap3r|rap3|raunch|r31ch|r3cta1|r3ctum|r3ctus|r3tard|r3tar|rtard|rumpram3r|rump|s1av3|s13as|s1ut|sack|sad1s|scag|sch1ong|sch1so|scr3w|scrog|scrot|scrud|scum|s3aman|s3am3n|s3duc3|s3m3n|s3xua1|sh1t|skag|skank|sm3gma|smut|sn1p3r|snatch|sodom|sp1ck|sp1c|sp1k|sp3rm|spunk|st3amy|stfu|ston3d|str1p|strok3|stup1d|suck|sumofab1atch|t1nk13|t1t[sf]uck|tampon|tard|t3abag1ng|t3at|t3st1|t3st3|t3urd|thrust|tramp|trans|trashy|twat|ug1y|unw3d|ur1n3a|ut3rus|vag1na|vu1gar|vu1va|w1g3r|wang|wank3r|wank|w31n3r|w31rdo|w3dg13|w3n13|w3tback|w3w3|wh1t3y|wh1s|whor3).*");
|
||||||
Pattern profanity2Pattern = Pattern.compile(".*(1ab1a|1d1ot|13p3r|13sb1ans|13sbo|13s13|13sb1an|13sbo|13sy|1nbr3d|1nc3st|1njun|1ub3|\\Wbj|\\Wcum|\\Wdum|\\Wfag|\\Wfap|\\W[sf]uk|\\Wj1s|\\Wp3do|\\Wp3|\\Wpo\\W|\\Wt1t|aho13|an1ngu|ana1|anus|ar3o1a|ar3o13|ary1an|axyx|axyxhat|axyxho13|axyxmast3r|axyxmunch|axyxw1p3|b1atch|b1gt1t|b1mbo|b1ow|b1tch|ba1s|bab3|bang|barf|bastard|bawdy|b3an3r|b3ard3dc1am|b3ast1a1ty|b3atch|b3at3r|b3av3r|b3otch|b3yotch|bo1nk|bod1y|bon3d|bon3r|bon3|bob|bot13|boty|bow31|br3ast|bug3r|bukak3|bung|busty|buxyx|c1t|caca|cahon3|cam31to3|carp3tmunch3r|cawk|c3rv1x|ch1nc|ch1nk|chod3|co1ta1|cockb1ock|cockho1st3r|cocknock3r|cocksmok3r|cocksuck3r|cock|condom|corksuck3r|crabs|cums1ut|cumshot|cumsta1n|cnt|cun1ngus|cuntfac3|cunthunt3r|cunt|d1ck|d1k3|d1do|d1mw1t|d1ng13|d1psh1p|dago|dam1t|damn1t|damn3d|damn|dawg13sty13|dog13sty13|dogysty13|dong|dop3y|douch3|drunk|dumb|dum|dumas|dumbas|dumy|dyk3|3jacu1at3|3n1arg3m3nt|3r3ct1on|3r3ct|3rot1c|3xtacy|3xtasy|f.ck|f1osy|f1st3d|f1st1ng|f1sty|fa1gt|fa1g|fack|fag1t|fag3d|fagot|fag|[sf]cuk|f31at1o|f31at3|f31ch1ng|f31ch3r|f31ch|f31tch3r|f31tch|foad|fobar|fond13|for3sk1n|fu.k|fudg3pack3r|[sf]uk|g1ans|g1go1o|ganja|ghay|gh3y|go1d3nshow3r|gonad|gr1ngo|h1t13r|handjob|hardon|hokah|hok3r|homo|honky|hor|hotch|hot3r|horny|hump1ng|hump3d|hump|hym3n|j1sm|j1s3d|j1sm|j1s|jackas|jackho13|jackof|j3rk3d|j3rkof|j3rk|junk13|junky|k1an|k1k3|k1nky|knob3nd|kyk3|mams|masa|mast3rba|masturba|max1|m3ns3s|m3nstruat|m[sf]uck1ng|mofo|moron|moth3rf|mthrf|muf|n1ga|n1ger|n1mrod|n1ny|n1p13|nak3d|napa1m|napy|nas1|n3gro|noky|nympho|op1at3|op1um|ora1y|ora1|org13s|organ|orgasm|orgy|ovary|ovum|p1owb1t3r|p1mp|p1nko|p1s3d|p1sof|p1s|pak1|pant13|panty|past13|pasty|p3ck3r|p3doph1|p3p3|p3n1a1|p3n13|p3n1s|p3n3trat1on|p3n3trat3|p3rv3rs1on|p3yot3|pha1c|phuck|po1ack|po1ock|pontang|pop|porno|porn|pr1ck|pr1g|pron|pub1|pub3|punkas|punky|pus1|pusy|puto|qu1cky|qu1ck13|qu1m|qu3af|qu3ro|qu3rs|qu3r|r1mjob|r1tard|racy|rap1st|rap3d|rap3r|rap3|raunch|r31ch|r3cta1|r3ctum|r3ctus|r3tard|r3tar|rtard|rumpram3r|rump|s1av3|s13as|s1ut|sack|sad1s|scag|sch1ong|sch1so|scr3w|scrog|scrot|scrud|scum|s3aman|s3am3n|s3duc3|s3m3n|s3xua1|sh1t|skag|skank|sm3gma|smut|sn1p3r|snatch|sodom|sp1ck|sp1c|sp1k|sp3rm|spunk|st3amy|stfu|ston3d|str1p|strok3|stup1d|suck|sumofab1atch|t1nk13|t1t[sf]uck|tampon|tard|t3abag1ng|t3at|t3st1|t3st3|t3urd|thrust|tramp|trans|trashy|twat|ug1y|unw3d|ur1n3a|ut3rus|vag1na|vu1gar|vu1va|w1g3r|wang|wank3r|wank|w31n3r|w31rdo|w3dg13|w3n13|w3tback|w3w3|wh1t3y|wh1s|whor3).*");
|
Pattern profanity2Pattern = Pattern.compile(".*(1ab1a|1d1ot|13p3r|13sb1ans|13sbo|13s13|13sb1an|13sbo|13sy|1nbr3d|1nc3st|1njun|1ub3|\\Wbj|\\Wcum|\\Wdum|\\Wfag|\\Wfap|\\W[sf]uk|\\Wj1s|\\Wp3do|\\Wp3|\\Wpo\\W|\\Wt1t|aho13|an1ngu|ana1|anus|ar3o1a|ar3o13|ary1an|axyx|axyxhat|axyxho13|axyxmast3r|axyxmunch|axyxw1p3|b1atch|b1gt1t|b1mbo|b1ow|b1tch|ba1s|bab3|bang|barf|bastard|bawdy|b3an3r|b3ard3dc1am|b3ast1a1ty|b3atch|b3at3r|b3av3r|b3otch|b3yotch|bo1nk|bod1y|bon3d|bon3r|bon3|bob|bot13|boty|bow31|br3ast|bug3r|bukak3|bung|busty|buxyx|c1t|caca|cahon3|cam31to3|carp3tmunch3r|cawk|c3rv1x|ch1nc|ch1nk|chod3|co1ta1|cockb1ock|cockho1st3r|cocknock3r|cocksmok3r|cocksuck3r|cock|condom|corksuck3r|crabs|cums1ut|cumshot|cumsta1n|cnt|cun1ngus|cuntfac3|cunthunt3r|cunt|d1ck|d1k3|d1do|d1mw1t|d1ng13|d1psh1p|dago|dam1t|damn1t|damn3d|damn|dawg13sty13|dog13sty13|dogysty13|dong|dop3y|douch3|drunk|dumb|dum|dumas|dumbas|dumy|dyk3|3jacu1at3|3n1arg3m3nt|3r3ct1on|3r3ct|3rot1c|3xtacy|3xtasy|f.ck|f1osy|f1st3d|f1st1ng|f1sty|fa1gt|fa1g|fack|fag1t|fag3d|fagot|fag|[sf]cuk|f31at1o|f31at3|f31ch1ng|f31ch3r|f31ch|f31tch3r|f31tch|foad|fobar|fond13|for3sk1n|fu.k|fudg3pack3r|[sf]uk|g1ans|g1go1o|ganja|ghay|gh3y|go1d3nshow3r|gonad|gr1ngo|h1t13r|handjob|hardon|hokah|hok3r|homo|honky|hor|hotch|hot3r|horny|hump1ng|hump3d|hump|hym3n|j1sm|j1s3d|j1sm|j1s|jackas|jackho13|jackof|j3rk3d|j3rkof|j3rk|junk13|junky|k1an|k1k3|k1nky|knob3nd|kyk3|mams|masa|mast3rba|masturba|max1|m3ns3s|m3nstruat|m[sf]uck1ng|mofo|moron|moth3rf|mthrf|muf|n1ga|n1ger|n1mrod|n1ny|n1p13|nak3d|napa1m|napy|nas1|n3gro|noky|nympho|op1at3|op1um|ora1y|ora1|org13s|organ|orgasm|orgy|ovary|ovum|p1owb1t3r|p1mp|p1nko|p1s3d|p1sof|p1s|pak1|pant13|panty|past13|pasty|p3ck3r|p3doph1|p3p3|p3n1a1|p3n13|p3n1s|p3n3trat1on|p3n3trat3|p3rv3rs1on|p3yot3|pha1c|phuck|po1ack|po1ock|pontang|pop|porno|porn|pr1ck|pr1g|pron|pub1|pub3|punkas|punky|pus1|pusy|puto|qu1cky|qu1ck13|qu1m|qu3af|qu3ro|qu3rs|qu3r|r1mjob|r1tard|racy|rap1st|rap3d|rap3r|rap3|raunch|r31ch|r3cta1|r3ctum|r3ctus|r3tard|r3tar|rtard|rumpram3r|rump|s1av3|s13as|s1ut|sack|sad1s|scag|sch1ong|sch1so|scr3w|scrog|scrot|scrud|scum|s3aman|s3am3n|s3duc3|s3m3n|s3xua1|sh1t|skag|skank|sm3gma|smut|sn1p3r|snatch|sodom|sp1ck|sp1c|sp1k|sp3rm|spunk|st3amy|stfu|ston3d|str1p|strok3|stup1d|suck|sumofab1atch|t1nk13|t1t[sf]uck|tampon|tard|t3abag1ng|t3at|t3st1|t3st3|t3urd|thrust|tramp|trans|trashy|twat|ug1y|unw3d|ur1n3a|ut3rus|vag1na|vu1gar|vu1va|w1g3r|wang|wank3r|wank|w31n3r|w31rdo|w3dg13|w3n13|w3tback|w3w3|wh1t3y|wh1s|whor3).*");
|
||||||
|
|
||||||
private boolean containsSwearing(String message, String level) {
|
private boolean containsSwearing(String message, String level) {
|
||||||
|
|
||||||
if (level.equals("0")) {
|
if (level.equals("0")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
message = '.' + message + '.';
|
message = '.' + message + '.';
|
||||||
|
|
||||||
message = message.toLowerCase();
|
message = message.toLowerCase(Locale.ENGLISH);
|
||||||
message = message.replaceAll("[a@]([s5][s5]+)", "axyx");
|
message = message.replaceAll("[a@]([s5][s5]+)", "axyx");
|
||||||
message = message.replaceAll("b.([t\\+][t\\+]+)", "buxyx");
|
message = message.replaceAll("b.([t\\+][t\\+]+)", "buxyx");
|
||||||
message = message.replaceAll("(.)(\\1{1,})", "$1");
|
message = message.replaceAll("(.)(\\1{1,})", "$1");
|
||||||
|
@ -280,11 +281,11 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
if (messageType == MessageType.WHISPER_FROM) {
|
if (messageType == MessageType.WHISPER_FROM) {
|
||||||
if (username.equalsIgnoreCase(SessionHandler.getUserName())) {
|
if (username.equalsIgnoreCase(SessionHandler.getUserName())) {
|
||||||
if (message.toLowerCase().startsWith("profanity 0")) {
|
if (message.toLowerCase(Locale.ENGLISH).startsWith("profanity 0")) {
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "0");
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "0");
|
||||||
} else if (message.toLowerCase().startsWith("profanity 1")) {
|
} else if (message.toLowerCase(Locale.ENGLISH).startsWith("profanity 1")) {
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "1");
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "1");
|
||||||
} else if (message.toLowerCase().startsWith("profanity 2")) {
|
} else if (message.toLowerCase(Locale.ENGLISH).startsWith("profanity 2")) {
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "2");
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAME_USE_PROFANITY_FILTER, "2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,7 +436,7 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
||||||
this.txtMessage.repaint();
|
this.txtMessage.repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableHyperlinks() {
|
public void enableHyperlinks() {
|
||||||
txtConversation.enableHyperlinks();
|
txtConversation.enableHyperlinks();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package mage.client.components;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
import java.awt.FontMetrics;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
@ -40,6 +41,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
||||||
private String topText;
|
private String topText;
|
||||||
private Image topTextImage;
|
private Image topTextImage;
|
||||||
private Image topTextImageRight;
|
private Image topTextImageRight;
|
||||||
|
private String centerText;
|
||||||
|
|
||||||
private boolean isHovered = false;
|
private boolean isHovered = false;
|
||||||
private boolean isSelected = false;
|
private boolean isSelected = false;
|
||||||
|
@ -49,12 +51,15 @@ public class HoverButton extends JPanel implements MouseListener {
|
||||||
private Command observer = null;
|
private Command observer = null;
|
||||||
private Command onHover = null;
|
private Command onHover = null;
|
||||||
private Color textColor = Color.white;
|
private Color textColor = Color.white;
|
||||||
|
private final Rectangle centerTextArea = new Rectangle(5, 18, 75, 40);
|
||||||
|
private final Color centerTextColor = Color.YELLOW;
|
||||||
private final Color textBGColor = Color.black;
|
private final Color textBGColor = Color.black;
|
||||||
|
|
||||||
static final Font textFont = new Font("Arial", Font.PLAIN, 12);
|
static final Font textFont = new Font("Arial", Font.PLAIN, 12);
|
||||||
static final Font textFontMini = new Font("Arial", Font.PLAIN, 11);
|
static final Font textFontMini = new Font("Arial", Font.PLAIN, 11);
|
||||||
static final Font textSetFontBoldMini = new Font("Arial", Font.BOLD, 12);
|
static final Font textSetFontBoldMini = new Font("Arial", Font.BOLD, 12);
|
||||||
static final Font textSetFontBold = new Font("Arial", Font.BOLD, 14);
|
static final Font textSetFontBold = new Font("Arial", Font.BOLD, 14);
|
||||||
|
|
||||||
private boolean useMiniFont = false;
|
private boolean useMiniFont = false;
|
||||||
|
|
||||||
private boolean alignTextLeft = false;
|
private boolean alignTextLeft = false;
|
||||||
|
@ -134,6 +139,21 @@ public class HoverButton extends JPanel implements MouseListener {
|
||||||
if (topTextImageRight != null) {
|
if (topTextImageRight != null) {
|
||||||
g.drawImage(topTextImageRight, this.getWidth() - 20, 3, this);
|
g.drawImage(topTextImageRight, this.getWidth() - 20, 3, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (centerText != null) {
|
||||||
|
g2d.setColor(centerTextColor);
|
||||||
|
int fontSize = 40;
|
||||||
|
int val = Integer.parseInt(centerText);
|
||||||
|
if (val > 9999) {
|
||||||
|
fontSize = 24;
|
||||||
|
} else if (val > 999) {
|
||||||
|
fontSize = 28;
|
||||||
|
} else if (val > 99) {
|
||||||
|
fontSize = 34;
|
||||||
|
}
|
||||||
|
drawCenteredString(g2d, centerText, centerTextArea, new Font("Arial", Font.BOLD, fontSize));
|
||||||
|
}
|
||||||
|
g2d.setColor(textColor);
|
||||||
if (overlayImage != null) {
|
if (overlayImage != null) {
|
||||||
g.drawImage(overlayImage, (imageSize.width - overlayImageSize.width) / 2, 10, this);
|
g.drawImage(overlayImage, (imageSize.width - overlayImageSize.width) / 2, 10, this);
|
||||||
} else if (set != null) {
|
} else if (set != null) {
|
||||||
|
@ -298,13 +318,17 @@ public class HoverButton extends JPanel implements MouseListener {
|
||||||
|
|
||||||
public void setTopTextImage(Image topTextImage) {
|
public void setTopTextImage(Image topTextImage) {
|
||||||
this.topTextImage = topTextImage;
|
this.topTextImage = topTextImage;
|
||||||
this.textOffsetX = -1; // rest for new clculation
|
this.textOffsetX = -1; // rest for new calculation
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTopTextImageRight(Image topTextImage) {
|
public void setTopTextImageRight(Image topTextImage) {
|
||||||
this.topTextImageRight = topTextImage;
|
this.topTextImageRight = topTextImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCenterText(String centerText) {
|
||||||
|
this.centerText = centerText;
|
||||||
|
}
|
||||||
|
|
||||||
public void setTextAlwaysVisible(boolean textAlwaysVisible) {
|
public void setTextAlwaysVisible(boolean textAlwaysVisible) {
|
||||||
this.textAlwaysVisible = textAlwaysVisible;
|
this.textAlwaysVisible = textAlwaysVisible;
|
||||||
}
|
}
|
||||||
|
@ -313,4 +337,24 @@ public class HoverButton extends JPanel implements MouseListener {
|
||||||
this.alignTextLeft = alignTextLeft;
|
this.alignTextLeft = alignTextLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw a String centered in the middle of a Rectangle.
|
||||||
|
*
|
||||||
|
* @param g The Graphics instance.
|
||||||
|
* @param text The String to draw.
|
||||||
|
* @param rect The Rectangle to center the text in.
|
||||||
|
* @param font
|
||||||
|
*/
|
||||||
|
public void drawCenteredString(Graphics g, String text, Rectangle rect, Font font) {
|
||||||
|
// Get the FontMetrics
|
||||||
|
FontMetrics metrics = g.getFontMetrics(font);
|
||||||
|
// Determine the X coordinate for the text
|
||||||
|
int x = rect.x + (rect.width - metrics.stringWidth(text)) / 2;
|
||||||
|
// Determine the Y coordinate for the text (note we add the ascent, as in java 2d 0 is top of the screen)
|
||||||
|
int y = rect.y + ((rect.height - metrics.getHeight()) / 2) + metrics.getAscent();
|
||||||
|
// Set the font
|
||||||
|
g.setFont(font);
|
||||||
|
// Draw the String
|
||||||
|
g.drawString(text, x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -438,7 +438,7 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
choice = Jsoup.parse(choice).text(); // decode HTML entities and strip tags
|
choice = Jsoup.parse(choice).text(); // decode HTML entities and strip tags
|
||||||
return choice.substring(0, 1).toUpperCase() + choice.substring(1);
|
return choice.substring(0, 1).toUpperCase(Locale.ENGLISH) + choice.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,6 +30,7 @@ package mage.client.deck.generator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -86,7 +87,7 @@ public final class DeckGenerator {
|
||||||
|
|
||||||
String selectedColors = genDialog.getSelectedColors();
|
String selectedColors = genDialog.getSelectedColors();
|
||||||
List<ColoredManaSymbol> allowedColors = new ArrayList<>();
|
List<ColoredManaSymbol> allowedColors = new ArrayList<>();
|
||||||
selectedColors = selectedColors != null ? selectedColors.toUpperCase() : getRandomColors("X");
|
selectedColors = selectedColors != null ? selectedColors.toUpperCase(Locale.ENGLISH) : getRandomColors("X");
|
||||||
String format = genDialog.getSelectedFormat();
|
String format = genDialog.getSelectedFormat();
|
||||||
|
|
||||||
List<String> setsToUse = ConstructedFormats.getSetsByFormat(format);
|
List<String> setsToUse = ConstructedFormats.getSetsByFormat(format);
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
* 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.deck.generator;
|
package mage.client.deck.generator;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Simown
|
* @author Simown
|
||||||
|
@ -74,23 +74,24 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class AdjustingSliderGroup
|
private static class AdjustingSliderGroup {
|
||||||
{
|
|
||||||
private final ArrayList<JStorageSlider> storageSliders;
|
private final ArrayList<JStorageSlider> storageSliders;
|
||||||
private int sliderIndex = 0;
|
private int sliderIndex = 0;
|
||||||
|
|
||||||
AdjustingSliderGroup(JStorageSlider... sliders)
|
AdjustingSliderGroup(JStorageSlider... sliders) {
|
||||||
{
|
|
||||||
storageSliders = new ArrayList<>();
|
storageSliders = new ArrayList<>();
|
||||||
for(JStorageSlider slider: sliders) {
|
for (JStorageSlider slider : sliders) {
|
||||||
storageSliders.add(slider);
|
storageSliders.add(slider);
|
||||||
slider.addChangeListener(e -> fireSliderChangedEvent((JStorageSlider) e.getSource()));
|
slider.addChangeListener(e -> fireSliderChangedEvent((JStorageSlider) e.getSource()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fireSliderChangedEvent(JStorageSlider source) {
|
public void fireSliderChangedEvent(JStorageSlider source) {
|
||||||
// We don't want to do anything if the value isn't changing
|
// We don't want to do anything if the value isn't changing
|
||||||
if(!source.getValueIsAdjusting())
|
if (!source.getValueIsAdjusting()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
// Update the slider depending on how much it's changed relative to its previous position
|
// Update the slider depending on how much it's changed relative to its previous position
|
||||||
int change = (source.getValue() - source.getPreviousValue());
|
int change = (source.getValue() - source.getPreviousValue());
|
||||||
updateSliderPosition(change, source);
|
updateSliderPosition(change, source);
|
||||||
|
@ -98,11 +99,11 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
|
|
||||||
private void updateSliderPosition(int change, JStorageSlider source) {
|
private void updateSliderPosition(int change, JStorageSlider source) {
|
||||||
int remaining = change;
|
int remaining = change;
|
||||||
while (remaining != 0) {
|
while (remaining != 0) {
|
||||||
// Get the currently indexed slider
|
// Get the currently indexed slider
|
||||||
JStorageSlider slider = storageSliders.get(sliderIndex);
|
JStorageSlider slider = storageSliders.get(sliderIndex);
|
||||||
// If it's not the slider that fired the event
|
// If it's not the slider that fired the event
|
||||||
if (slider != source) {
|
if (slider != source) {
|
||||||
// Check we don't go over the upper and lower bounds
|
// Check we don't go over the upper and lower bounds
|
||||||
if (remaining < 0 || (remaining > 0 && slider.getValue() > 0)) {
|
if (remaining < 0 || (remaining > 0 && slider.getValue() > 0)) {
|
||||||
// Adjust the currently selected slider by +/- 1
|
// Adjust the currently selected slider by +/- 1
|
||||||
|
@ -114,7 +115,7 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
// Select the next slider in the list of sliders
|
// Select the next slider in the list of sliders
|
||||||
sliderIndex = (sliderIndex + 1) % storageSliders.size();
|
sliderIndex = (sliderIndex + 1) % storageSliders.size();
|
||||||
}
|
}
|
||||||
for (JStorageSlider slider : storageSliders) {
|
for (JStorageSlider slider : storageSliders) {
|
||||||
slider.setPreviousValue(slider.getValue());
|
slider.setPreviousValue(slider.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +157,7 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
textLabels.add(titleLabel);
|
textLabels.add(titleLabel);
|
||||||
sliderPanel.add(titleLabel, BorderLayout.WEST);
|
sliderPanel.add(titleLabel, BorderLayout.WEST);
|
||||||
// Slider
|
// Slider
|
||||||
slider.setToolTipText("Percentage of " + label.trim().toLowerCase() + " in the generated deck.");
|
slider.setToolTipText("Percentage of " + label.trim().toLowerCase(Locale.ENGLISH) + " in the generated deck.");
|
||||||
sliderPanel.add(slider, BorderLayout.CENTER);
|
sliderPanel.add(slider, BorderLayout.CENTER);
|
||||||
// Percentage
|
// Percentage
|
||||||
JLabel percentageLabel = createChangingPercentageLabel(slider);
|
JLabel percentageLabel = createChangingPercentageLabel(slider);
|
||||||
|
@ -166,7 +167,7 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
return sliderPanel;
|
return sliderPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static JLabel createChangingPercentageLabel(final JSlider slider) {
|
private static JLabel createChangingPercentageLabel(final JSlider slider) {
|
||||||
|
|
||||||
final JLabel label = new JLabel(" " + String.valueOf(slider.getValue()) + '%');
|
final JLabel label = new JLabel(" " + String.valueOf(slider.getValue()) + '%');
|
||||||
|
|
||||||
|
@ -174,7 +175,7 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
String value = String.valueOf(slider.getValue());
|
String value = String.valueOf(slider.getValue());
|
||||||
StringBuilder labelBuilder = new StringBuilder();
|
StringBuilder labelBuilder = new StringBuilder();
|
||||||
// Pad with spaces so all percentage labels are of equal size
|
// Pad with spaces so all percentage labels are of equal size
|
||||||
for(int i = 0; i < (5-value.length()); i++) {
|
for (int i = 0; i < (5 - value.length()); i++) {
|
||||||
labelBuilder.append(" ");
|
labelBuilder.append(" ");
|
||||||
}
|
}
|
||||||
labelBuilder.append(value);
|
labelBuilder.append(value);
|
||||||
|
@ -186,16 +187,16 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
for(JStorageSlider slider: sg.getSliders()) {
|
for (JStorageSlider slider : sg.getSliders()) {
|
||||||
slider.setEnabled(enabled);
|
slider.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
for(JLabel label: textLabels) {
|
for (JLabel label : textLabels) {
|
||||||
label.setEnabled(enabled);
|
label.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetValues() {
|
public void resetValues() {
|
||||||
for(JStorageSlider slider: sg.getSliders()) {
|
for (JStorageSlider slider : sg.getSliders()) {
|
||||||
slider.resetDefault();
|
slider.resetDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,7 +228,4 @@ public class RatioAdjustingSliderPanel extends JPanel {
|
||||||
landSlider.previousValue = percentage;
|
landSlider.previousValue = percentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -851,7 +851,7 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="chkUnique">
|
<Component class="javax.swing.JCheckBox" name="chkUnique">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="selected" type="boolean" value="true"/>
|
<Property name="selected" type="boolean" value="false"/>
|
||||||
<Property name="text" type="java.lang.String" value="Unique"/>
|
<Property name="text" type="java.lang.String" value="Unique"/>
|
||||||
<Property name="toolTipText" type="java.lang.String" value="Show only the first found card of every card name."/>
|
<Property name="toolTipText" type="java.lang.String" value="Show only the first found card of every card name."/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
chkNames.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_NAMES, "true")));
|
chkNames.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_NAMES, "true")));
|
||||||
chkTypes.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_TYPES, "true")));
|
chkTypes.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_TYPES, "true")));
|
||||||
chkRules.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_RULES, "true")));
|
chkRules.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_RULES, "true")));
|
||||||
chkUnique.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_UNIQUE, "true")));
|
chkUnique.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_UNIQUE, "false")));
|
||||||
|
|
||||||
mainTable.addMouseListener(new MouseAdapter() {
|
mainTable.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1074,7 +1074,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
chkUnique.setSelected(true);
|
chkUnique.setSelected(false);
|
||||||
chkUnique.setText("Unique");
|
chkUnique.setText("Unique");
|
||||||
chkUnique.setToolTipText("Show only the first found card of every card name.");
|
chkUnique.setToolTipText("Show only the first found card of every card name.");
|
||||||
chkUnique.setFocusable(false);
|
chkUnique.setFocusable(false);
|
||||||
|
|
|
@ -1125,7 +1125,7 @@ class DeckFilter extends FileFilter {
|
||||||
int i = s.lastIndexOf('.');
|
int i = s.lastIndexOf('.');
|
||||||
|
|
||||||
if (i > 0 && i < s.length() - 1) {
|
if (i > 0 && i < s.length() - 1) {
|
||||||
ext = s.substring(i + 1).toLowerCase();
|
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
return (ext == null) ? false : ext.equals("dck");
|
return (ext == null) ? false : ext.equals("dck");
|
||||||
}
|
}
|
||||||
|
@ -1149,10 +1149,10 @@ class ImportFilter extends FileFilter {
|
||||||
int i = s.lastIndexOf('.');
|
int i = s.lastIndexOf('.');
|
||||||
|
|
||||||
if (i > 0 && i < s.length() - 1) {
|
if (i > 0 && i < s.length() - 1) {
|
||||||
ext = s.substring(i + 1).toLowerCase();
|
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
if (ext != null) {
|
if (ext != null) {
|
||||||
if (ext.toLowerCase().equals("dec") || ext.toLowerCase().equals("mwdeck") || ext.toLowerCase().equals("txt") || ext.toLowerCase().equals("dek")) {
|
if (ext.toLowerCase(Locale.ENGLISH).equals("dec") || ext.toLowerCase(Locale.ENGLISH).equals("mwdeck") || ext.toLowerCase(Locale.ENGLISH).equals("txt") || ext.toLowerCase(Locale.ENGLISH).equals("dek")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
@ -500,10 +501,10 @@ public class MageBook extends JComponent {
|
||||||
className = className.replaceAll("[^a-zA-Z0-9]", "");
|
className = className.replaceAll("[^a-zA-Z0-9]", "");
|
||||||
className = "mage.game.permanent.token." + className + "Token";
|
className = "mage.game.permanent.token." + className + "Token";
|
||||||
if (token.getTokenClassName() != null && token.getTokenClassName().length() > 0) {
|
if (token.getTokenClassName() != null && token.getTokenClassName().length() > 0) {
|
||||||
if (token.getTokenClassName().toLowerCase().matches(".*token.*")) {
|
if (token.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*token.*")) {
|
||||||
className = token.getTokenClassName();
|
className = token.getTokenClassName();
|
||||||
className = "mage.game.permanent.token." + className;
|
className = "mage.game.permanent.token." + className;
|
||||||
} else if (token.getTokenClassName().toLowerCase().matches(".*emblem.*")) {
|
} else if (token.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*emblem.*")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -541,7 +542,7 @@ public class MageBook extends JComponent {
|
||||||
try {
|
try {
|
||||||
String className = emblem.getName();
|
String className = emblem.getName();
|
||||||
if (emblem.getTokenClassName() != null && emblem.getTokenClassName().length() > 0) {
|
if (emblem.getTokenClassName() != null && emblem.getTokenClassName().length() > 0) {
|
||||||
if (emblem.getTokenClassName().toLowerCase().matches(".*emblem.*")) {
|
if (emblem.getTokenClassName().toLowerCase(Locale.ENGLISH).matches(".*emblem.*")) {
|
||||||
className = emblem.getTokenClassName();
|
className = emblem.getTokenClassName();
|
||||||
className = "mage.game.command.emblems." + className;
|
className = "mage.game.command.emblems." + className;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,6 @@ import mage.view.CardsView;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.jdesktop.swingx.JXPanel;
|
import org.jdesktop.swingx.JXPanel;
|
||||||
import org.mage.card.arcane.ManaSymbols;
|
import org.mage.card.arcane.ManaSymbols;
|
||||||
import org.mage.card.arcane.UI;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.table.AbstractTableModel;
|
import javax.swing.table.AbstractTableModel;
|
||||||
|
|
|
@ -7,6 +7,11 @@
|
||||||
<Property name="text" type="java.lang.String" value="jButton2"/>
|
<Property name="text" type="java.lang.String" value="jButton2"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="jLabel1"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</NonVisualComponents>
|
</NonVisualComponents>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="title" type="java.lang.String" value="Add Land"/>
|
<Property name="title" type="java.lang.String" value="Add Land"/>
|
||||||
|
@ -29,40 +34,62 @@
|
||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
<Component id="lblMountain" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="lblForest" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="lblMountain" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="lblLandSet" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="lblForest" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="lblIsland" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="lblLandSet" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="lblPains" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="lblIsland" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="lblSwamp" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="lblPains" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="lblSwamp" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="lblDeckSize" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="ckbFullArtLands" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
<Component id="btnAdd" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="btnAutoAdd" alignment="0" pref="85" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="spnMountain" alignment="0" pref="85" max="32767" attributes="0"/>
|
</Group>
|
||||||
<Component id="spnIsland" alignment="0" pref="85" max="32767" attributes="0"/>
|
<Component id="ckbFullArtLands" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="spnForest" alignment="0" max="32767" attributes="0"/>
|
<Component id="panelSet" min="-2" pref="219" max="-2" attributes="0"/>
|
||||||
</Group>
|
<Group type="102" attributes="0">
|
||||||
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
|
<Component id="spnForest" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
<Component id="spnSwamp" alignment="0" pref="85" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="spnPlains" alignment="0" max="32767" attributes="0"/>
|
<Component id="lblForestIcon" min="-2" pref="20" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="spnIsland" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="lblIslandIcon" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="spnMountain" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="lblMountainIcon" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="spnSwamp" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="lblSwampIcon" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="spnDeckSize" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnAutoAdd" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="btnAdd" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="panelSet" max="32767" attributes="0"/>
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="spnPlains" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="lblPlainsIcon" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -79,35 +106,54 @@
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="lblForest" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblForest" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="spnForest" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="spnForest" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="lblForestIcon" alignment="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="lblIsland" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="spnIsland" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblIsland" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="spnIsland" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="lblIslandIcon" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="lblMountain" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="spnMountain" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblMountain" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="spnMountain" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="lblMountainIcon" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="lblPains" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="spnPlains" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblPains" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="spnPlains" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="lblPlainsIcon" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="lblSwamp" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="spnSwamp" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="lblSwamp" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="spnSwamp" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="lblSwampIcon" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="ckbFullArtLands" min="-2" max="-2" attributes="0"/>
|
<Component id="ckbFullArtLands" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="btnAutoAdd" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="btnAutoAdd" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="lblDeckSize" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="spnDeckSize" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="btnAdd" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="btnAdd" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -120,7 +166,7 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblForest">
|
<Component class="javax.swing.JLabel" name="lblForest">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Forest"/>
|
<Property name="text" type="java.lang.String" value="Forest:"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JSpinner" name="spnForest">
|
<Component class="javax.swing.JSpinner" name="spnForest">
|
||||||
|
@ -130,9 +176,23 @@
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="lblForestIcon">
|
||||||
|
<Properties>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblIsland">
|
<Component class="javax.swing.JLabel" name="lblIsland">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Island"/>
|
<Property name="text" type="java.lang.String" value="Island:"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JSpinner" name="spnIsland">
|
<Component class="javax.swing.JSpinner" name="spnIsland">
|
||||||
|
@ -142,9 +202,22 @@
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="lblIslandIcon">
|
||||||
|
<Properties>
|
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblMountain">
|
<Component class="javax.swing.JLabel" name="lblMountain">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Mountain"/>
|
<Property name="text" type="java.lang.String" value="Mountain:"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JSpinner" name="spnMountain">
|
<Component class="javax.swing.JSpinner" name="spnMountain">
|
||||||
|
@ -154,9 +227,22 @@
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="lblMountainIcon">
|
||||||
|
<Properties>
|
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblPains">
|
<Component class="javax.swing.JLabel" name="lblPains">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Plains"/>
|
<Property name="text" type="java.lang.String" value="Plains:"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JSpinner" name="spnPlains">
|
<Component class="javax.swing.JSpinner" name="spnPlains">
|
||||||
|
@ -166,9 +252,22 @@
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="lblPlainsIcon">
|
||||||
|
<Properties>
|
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblSwamp">
|
<Component class="javax.swing.JLabel" name="lblSwamp">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Swamp"/>
|
<Property name="text" type="java.lang.String" value="Swamp:"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JSpinner" name="spnSwamp">
|
<Component class="javax.swing.JSpinner" name="spnSwamp">
|
||||||
|
@ -178,9 +277,44 @@
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="lblSwampIcon">
|
||||||
|
<Properties>
|
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[22, 20]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="lblDeckSize">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Deck size:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JSpinner" name="spnDeckSize">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||||
|
<SpinnerModel initial="0" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnAutoAdd">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Suggest"/>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value="<HTML>Propose related to the mana costs of the cards in the deck<br>
the number of lands to add to get to the set deck size."/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAutoAddActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnAdd">
|
<Component class="javax.swing.JButton" name="btnAdd">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Add"/>
|
<Property name="text" type="java.lang.String" value="Add"/>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value="Add the selected number of basic lands to the deck."/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddActionPerformed"/>
|
||||||
|
@ -194,14 +328,6 @@
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnAutoAdd">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Suggest"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAutoAddActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JPanel" name="panelSet">
|
<Container class="javax.swing.JPanel" name="panelSet">
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
|
||||||
|
|
|
@ -27,12 +27,13 @@
|
||||||
*/
|
*/
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JLayeredPane;
|
import javax.swing.JLayeredPane;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -49,6 +50,7 @@ import mage.client.util.gui.FastSearchUtil;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
import org.mage.card.arcane.ManaSymbols;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -59,7 +61,6 @@ public class AddLandDialog extends MageDialog {
|
||||||
private static final Logger logger = Logger.getLogger(MageDialog.class);
|
private static final Logger logger = Logger.getLogger(MageDialog.class);
|
||||||
|
|
||||||
private Deck deck;
|
private Deck deck;
|
||||||
private final Set<String> landSetCodes = new HashSet<>();
|
|
||||||
|
|
||||||
private static final int DEFAULT_SEALED_DECK_CARD_NUMBER = 40;
|
private static final int DEFAULT_SEALED_DECK_CARD_NUMBER = 40;
|
||||||
|
|
||||||
|
@ -131,6 +132,27 @@ public class AddLandDialog extends MageDialog {
|
||||||
} else {
|
} else {
|
||||||
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
||||||
}
|
}
|
||||||
|
spnDeckSize.setValue(DEFAULT_SEALED_DECK_CARD_NUMBER);
|
||||||
|
BufferedImage image = ManaSymbols.getSizedManaSymbol("G", 15);
|
||||||
|
if (image != null) {
|
||||||
|
lblForestIcon.setIcon(new ImageIcon(image));
|
||||||
|
}
|
||||||
|
image = ManaSymbols.getSizedManaSymbol("U", 15);
|
||||||
|
if (image != null) {
|
||||||
|
lblIslandIcon.setIcon(new ImageIcon(image));
|
||||||
|
}
|
||||||
|
image = ManaSymbols.getSizedManaSymbol("W", 15);
|
||||||
|
if (image != null) {
|
||||||
|
lblPlainsIcon.setIcon(new ImageIcon(image));
|
||||||
|
}
|
||||||
|
image = ManaSymbols.getSizedManaSymbol("R", 15);
|
||||||
|
if (image != null) {
|
||||||
|
lblMountainIcon.setIcon(new ImageIcon(image));
|
||||||
|
}
|
||||||
|
image = ManaSymbols.getSizedManaSymbol("B", 15);
|
||||||
|
if (image != null) {
|
||||||
|
lblSwampIcon.setIcon(new ImageIcon(image));
|
||||||
|
}
|
||||||
|
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
@ -139,9 +161,7 @@ public class AddLandDialog extends MageDialog {
|
||||||
String landSetName = (String) cbLandSet.getSelectedItem();
|
String landSetName = (String) cbLandSet.getSelectedItem();
|
||||||
|
|
||||||
CardCriteria criteria = new CardCriteria();
|
CardCriteria criteria = new CardCriteria();
|
||||||
if (landSetName.equals("<Random lands>")) {
|
if (!landSetName.equals("<Random lands>")) {
|
||||||
criteria.setCodes(landSetCodes.toArray(new String[landSetCodes.size()]));
|
|
||||||
} else {
|
|
||||||
ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByName(landSetName);
|
ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByName(landSetName);
|
||||||
if (expansionInfo == null) {
|
if (expansionInfo == null) {
|
||||||
throw new IllegalArgumentException("Code of Set " + landSetName + " not found");
|
throw new IllegalArgumentException("Code of Set " + landSetName + " not found");
|
||||||
|
@ -166,6 +186,7 @@ public class AddLandDialog extends MageDialog {
|
||||||
if (useFullArt && (land.getFrameStyle() == FrameStyle.BFZ_FULL_ART_BASIC
|
if (useFullArt && (land.getFrameStyle() == FrameStyle.BFZ_FULL_ART_BASIC
|
||||||
|| land.getFrameStyle() == FrameStyle.UGL_FULL_ART_BASIC
|
|| land.getFrameStyle() == FrameStyle.UGL_FULL_ART_BASIC
|
||||||
|| land.getFrameStyle() == FrameStyle.UNH_FULL_ART_BASIC
|
|| land.getFrameStyle() == FrameStyle.UNH_FULL_ART_BASIC
|
||||||
|
|| land.getFrameStyle() == FrameStyle.UST_FULL_ART_BASIC
|
||||||
|| land.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC)) {
|
|| land.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC)) {
|
||||||
useLand = true;
|
useLand = true;
|
||||||
}
|
}
|
||||||
|
@ -193,20 +214,28 @@ public class AddLandDialog extends MageDialog {
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
jButton2 = new javax.swing.JButton();
|
jButton2 = new javax.swing.JButton();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
lblLandSet = new javax.swing.JLabel();
|
lblLandSet = new javax.swing.JLabel();
|
||||||
lblForest = new javax.swing.JLabel();
|
lblForest = new javax.swing.JLabel();
|
||||||
spnForest = new javax.swing.JSpinner();
|
spnForest = new javax.swing.JSpinner();
|
||||||
|
lblForestIcon = new javax.swing.JLabel();
|
||||||
lblIsland = new javax.swing.JLabel();
|
lblIsland = new javax.swing.JLabel();
|
||||||
spnIsland = new javax.swing.JSpinner();
|
spnIsland = new javax.swing.JSpinner();
|
||||||
|
lblIslandIcon = new javax.swing.JLabel();
|
||||||
lblMountain = new javax.swing.JLabel();
|
lblMountain = new javax.swing.JLabel();
|
||||||
spnMountain = new javax.swing.JSpinner();
|
spnMountain = new javax.swing.JSpinner();
|
||||||
|
lblMountainIcon = new javax.swing.JLabel();
|
||||||
lblPains = new javax.swing.JLabel();
|
lblPains = new javax.swing.JLabel();
|
||||||
spnPlains = new javax.swing.JSpinner();
|
spnPlains = new javax.swing.JSpinner();
|
||||||
|
lblPlainsIcon = new javax.swing.JLabel();
|
||||||
lblSwamp = new javax.swing.JLabel();
|
lblSwamp = new javax.swing.JLabel();
|
||||||
spnSwamp = new javax.swing.JSpinner();
|
spnSwamp = new javax.swing.JSpinner();
|
||||||
|
lblSwampIcon = new javax.swing.JLabel();
|
||||||
|
lblDeckSize = new javax.swing.JLabel();
|
||||||
|
spnDeckSize = new javax.swing.JSpinner();
|
||||||
|
btnAutoAdd = new javax.swing.JButton();
|
||||||
btnAdd = new javax.swing.JButton();
|
btnAdd = new javax.swing.JButton();
|
||||||
btnCancel = new javax.swing.JButton();
|
btnCancel = new javax.swing.JButton();
|
||||||
btnAutoAdd = new javax.swing.JButton();
|
|
||||||
panelSet = new javax.swing.JPanel();
|
panelSet = new javax.swing.JPanel();
|
||||||
cbLandSet = new javax.swing.JComboBox();
|
cbLandSet = new javax.swing.JComboBox();
|
||||||
btnSetFastSearch = new javax.swing.JButton();
|
btnSetFastSearch = new javax.swing.JButton();
|
||||||
|
@ -214,31 +243,67 @@ public class AddLandDialog extends MageDialog {
|
||||||
|
|
||||||
jButton2.setText("jButton2");
|
jButton2.setText("jButton2");
|
||||||
|
|
||||||
|
jLabel1.setText("jLabel1");
|
||||||
|
|
||||||
setTitle("Add Land");
|
setTitle("Add Land");
|
||||||
|
|
||||||
lblLandSet.setText("Set:");
|
lblLandSet.setText("Set:");
|
||||||
|
|
||||||
lblForest.setText("Forest");
|
lblForest.setText("Forest:");
|
||||||
|
|
||||||
spnForest.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
spnForest.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
|
||||||
lblIsland.setText("Island");
|
lblForestIcon.setToolTipText("");
|
||||||
|
lblForestIcon.setMaximumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblForestIcon.setMinimumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblForestIcon.setPreferredSize(new java.awt.Dimension(22, 20));
|
||||||
|
|
||||||
|
lblIsland.setText("Island:");
|
||||||
|
|
||||||
spnIsland.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
spnIsland.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
|
||||||
lblMountain.setText("Mountain");
|
lblIslandIcon.setMaximumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblIslandIcon.setMinimumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblIslandIcon.setPreferredSize(new java.awt.Dimension(22, 20));
|
||||||
|
|
||||||
|
lblMountain.setText("Mountain:");
|
||||||
|
|
||||||
spnMountain.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
spnMountain.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
|
||||||
lblPains.setText("Plains");
|
lblMountainIcon.setMaximumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblMountainIcon.setMinimumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblMountainIcon.setPreferredSize(new java.awt.Dimension(22, 20));
|
||||||
|
|
||||||
|
lblPains.setText("Plains:");
|
||||||
|
|
||||||
spnPlains.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
spnPlains.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
|
||||||
lblSwamp.setText("Swamp");
|
lblPlainsIcon.setMaximumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblPlainsIcon.setMinimumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblPlainsIcon.setPreferredSize(new java.awt.Dimension(22, 20));
|
||||||
|
|
||||||
|
lblSwamp.setText("Swamp:");
|
||||||
|
|
||||||
spnSwamp.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
spnSwamp.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
|
||||||
|
lblSwampIcon.setMaximumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblSwampIcon.setMinimumSize(new java.awt.Dimension(22, 20));
|
||||||
|
lblSwampIcon.setPreferredSize(new java.awt.Dimension(22, 20));
|
||||||
|
|
||||||
|
lblDeckSize.setText("Deck size:");
|
||||||
|
|
||||||
|
spnDeckSize.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
|
||||||
|
btnAutoAdd.setText("Suggest");
|
||||||
|
btnAutoAdd.setToolTipText("<HTML>Propose related to the mana costs of the cards in the deck<br>\nthe number of lands to add to get to the set deck size.");
|
||||||
|
btnAutoAdd.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnAutoAddActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
btnAdd.setText("Add");
|
btnAdd.setText("Add");
|
||||||
|
btnAdd.setToolTipText("Add the selected number of basic lands to the deck.");
|
||||||
btnAdd.addActionListener(new java.awt.event.ActionListener() {
|
btnAdd.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
btnAddActionPerformed(evt);
|
btnAddActionPerformed(evt);
|
||||||
|
@ -252,13 +317,6 @@ public class AddLandDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
btnAutoAdd.setText("Suggest");
|
|
||||||
btnAutoAdd.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
btnAutoAddActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
panelSet.setLayout(new javax.swing.BoxLayout(panelSet, javax.swing.BoxLayout.LINE_AXIS));
|
panelSet.setLayout(new javax.swing.BoxLayout(panelSet, javax.swing.BoxLayout.LINE_AXIS));
|
||||||
|
|
||||||
cbLandSet.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
cbLandSet.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||||
|
@ -285,32 +343,50 @@ public class AddLandDialog extends MageDialog {
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
.addComponent(lblMountain)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(lblForest, javax.swing.GroupLayout.Alignment.TRAILING)
|
.addComponent(lblMountain)
|
||||||
.addComponent(lblLandSet, javax.swing.GroupLayout.Alignment.TRAILING)
|
.addComponent(lblForest, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
.addComponent(lblIsland, javax.swing.GroupLayout.Alignment.TRAILING)
|
.addComponent(lblLandSet, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
.addComponent(lblPains, javax.swing.GroupLayout.Alignment.TRAILING)
|
.addComponent(lblIsland, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
.addComponent(lblSwamp, javax.swing.GroupLayout.Alignment.TRAILING))
|
.addComponent(lblPains, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(lblSwamp, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||||
|
.addComponent(lblDeckSize))
|
||||||
.addGap(18, 18, 18)
|
.addGap(18, 18, 18)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(ckbFullArtLands)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(btnAdd)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(btnCancel)
|
||||||
|
.addContainerGap())
|
||||||
|
.addComponent(ckbFullArtLands)
|
||||||
|
.addComponent(panelSet, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(spnForest, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(lblForestIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(spnIsland, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(lblIslandIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(spnMountain, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(lblMountainIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(spnSwamp, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(lblSwampIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(spnDeckSize, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(btnAutoAdd)))
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
.addComponent(spnPlains, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(btnAutoAdd, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
|
||||||
.addComponent(spnMountain, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
|
|
||||||
.addComponent(spnIsland, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
|
|
||||||
.addComponent(spnForest, javax.swing.GroupLayout.Alignment.LEADING))
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
|
||||||
.addComponent(spnSwamp, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)
|
|
||||||
.addComponent(spnPlains, javax.swing.GroupLayout.Alignment.LEADING))))
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(btnAdd)
|
.addComponent(lblPlainsIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addGap(36, 36, 36))))
|
||||||
.addComponent(btnCancel))
|
|
||||||
.addComponent(panelSet, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
@ -322,30 +398,44 @@ public class AddLandDialog extends MageDialog {
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(lblForest)
|
.addComponent(lblForest)
|
||||||
.addComponent(spnForest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(spnForest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(lblForestIcon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(lblIsland)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(spnIsland, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(lblIsland)
|
||||||
|
.addComponent(spnIsland, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(lblIslandIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(lblMountain)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(spnMountain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(lblMountain)
|
||||||
|
.addComponent(spnMountain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(lblMountainIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(lblPains)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(spnPlains, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(lblPains)
|
||||||
|
.addComponent(spnPlains, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(lblPlainsIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(lblSwamp)
|
||||||
|
.addComponent(spnSwamp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(lblSwampIcon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
||||||
.addComponent(lblSwamp)
|
|
||||||
.addComponent(spnSwamp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(ckbFullArtLands)
|
.addComponent(ckbFullArtLands)
|
||||||
.addGap(2, 2, 2)
|
.addGap(2, 2, 2)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(btnAutoAdd)
|
.addComponent(btnAutoAdd)
|
||||||
|
.addComponent(lblDeckSize)
|
||||||
|
.addComponent(spnDeckSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(btnAdd)
|
.addComponent(btnAdd)
|
||||||
.addComponent(btnCancel)))
|
.addComponent(btnCancel))
|
||||||
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
|
@ -386,7 +476,7 @@ public class AddLandDialog extends MageDialog {
|
||||||
int blue = 0;
|
int blue = 0;
|
||||||
int white = 0;
|
int white = 0;
|
||||||
Set<Card> cards = deck.getCards();
|
Set<Card> cards = deck.getCards();
|
||||||
int land_number = DEFAULT_SEALED_DECK_CARD_NUMBER - cards.size();
|
int land_number = ((Number) spnDeckSize.getValue()).intValue() - cards.size();
|
||||||
if (land_number < 0) {
|
if (land_number < 0) {
|
||||||
land_number = 0;
|
land_number = 0;
|
||||||
}
|
}
|
||||||
|
@ -427,13 +517,21 @@ public class AddLandDialog extends MageDialog {
|
||||||
private javax.swing.JComboBox cbLandSet;
|
private javax.swing.JComboBox cbLandSet;
|
||||||
private javax.swing.JCheckBox ckbFullArtLands;
|
private javax.swing.JCheckBox ckbFullArtLands;
|
||||||
private javax.swing.JButton jButton2;
|
private javax.swing.JButton jButton2;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel lblDeckSize;
|
||||||
private javax.swing.JLabel lblForest;
|
private javax.swing.JLabel lblForest;
|
||||||
|
private javax.swing.JLabel lblForestIcon;
|
||||||
private javax.swing.JLabel lblIsland;
|
private javax.swing.JLabel lblIsland;
|
||||||
|
private javax.swing.JLabel lblIslandIcon;
|
||||||
private javax.swing.JLabel lblLandSet;
|
private javax.swing.JLabel lblLandSet;
|
||||||
private javax.swing.JLabel lblMountain;
|
private javax.swing.JLabel lblMountain;
|
||||||
|
private javax.swing.JLabel lblMountainIcon;
|
||||||
private javax.swing.JLabel lblPains;
|
private javax.swing.JLabel lblPains;
|
||||||
|
private javax.swing.JLabel lblPlainsIcon;
|
||||||
private javax.swing.JLabel lblSwamp;
|
private javax.swing.JLabel lblSwamp;
|
||||||
|
private javax.swing.JLabel lblSwampIcon;
|
||||||
private javax.swing.JPanel panelSet;
|
private javax.swing.JPanel panelSet;
|
||||||
|
private javax.swing.JSpinner spnDeckSize;
|
||||||
private javax.swing.JSpinner spnForest;
|
private javax.swing.JSpinner spnForest;
|
||||||
private javax.swing.JSpinner spnIsland;
|
private javax.swing.JSpinner spnIsland;
|
||||||
private javax.swing.JSpinner spnMountain;
|
private javax.swing.JSpinner spnMountain;
|
||||||
|
|
|
@ -37,7 +37,6 @@ import java.awt.Dimension;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.beans.PropertyVetoException;
|
import java.beans.PropertyVetoException;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
|
|
|
@ -51,11 +51,9 @@ import java.net.URL;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
@ -723,14 +721,14 @@ public class ConnectDialog extends MageDialog {
|
||||||
|
|
||||||
}//GEN-LAST:event_btnFind2findPublicServerActionPerformed
|
}//GEN-LAST:event_btnFind2findPublicServerActionPerformed
|
||||||
|
|
||||||
private void connectXmageus(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_connecXmageusW
|
private void connectXmageus(java.awt.event.ActionEvent evt) {
|
||||||
String serverAddress = "xmage.us";
|
String serverAddress = "xmage.us";
|
||||||
this.txtServer.setText(serverAddress);
|
this.txtServer.setText(serverAddress);
|
||||||
this.txtPort.setText("17171");
|
this.txtPort.setText("17171");
|
||||||
// Update userName and password according to the chosen server.
|
// Update userName and password according to the chosen server.
|
||||||
this.txtUserName.setText(MagePreferences.getUserName(serverAddress));
|
this.txtUserName.setText(MagePreferences.getUserName(serverAddress));
|
||||||
this.txtPassword.setText(MagePreferences.getPassword(serverAddress));
|
this.txtPassword.setText(MagePreferences.getPassword(serverAddress));
|
||||||
}//GEN-LAST:event_connectXmageus
|
}
|
||||||
|
|
||||||
private void btnFlagSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFlagSearchActionPerformed
|
private void btnFlagSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFlagSearchActionPerformed
|
||||||
doFastFlagSearch();
|
doFastFlagSearch();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.1" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
</SyntheticProperties>
|
</SyntheticProperties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
|
|
@ -24,15 +24,14 @@
|
||||||
* 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.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import javax.swing.*;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Feedback dialog.
|
* Feedback dialog.
|
||||||
*
|
*
|
||||||
|
@ -47,17 +46,19 @@ public class FeedbackDialog extends javax.swing.JDialog {
|
||||||
"Thank you or \"Devs, you are so cool!\"",
|
"Thank you or \"Devs, you are so cool!\"",
|
||||||
"Question or \"I'm so curious about\""};
|
"Question or \"I'm so curious about\""};
|
||||||
|
|
||||||
/** Creates new form PreferencesDialog */
|
/**
|
||||||
|
* Creates new form PreferencesDialog
|
||||||
|
*/
|
||||||
public FeedbackDialog(java.awt.Frame parent, boolean modal) {
|
public FeedbackDialog(java.awt.Frame parent, boolean modal) {
|
||||||
super(parent, modal);
|
super(parent, modal);
|
||||||
initComponents();
|
initComponents();
|
||||||
cbFeedbackType.setModel(new DefaultComboBoxModel(feedbackTypes));
|
cbFeedbackType.setModel(new DefaultComboBoxModel(feedbackTypes));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/**
|
||||||
* initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
* always regenerated by the Form Editor.
|
* regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
@ -259,16 +260,16 @@ public class FeedbackDialog extends javax.swing.JDialog {
|
||||||
if (type == null || type.isEmpty()) {
|
if (type == null || type.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (type.toLowerCase().startsWith("bug")) {
|
if (type.toLowerCase(Locale.ENGLISH).startsWith("bug")) {
|
||||||
return "bug";
|
return "bug";
|
||||||
}
|
}
|
||||||
if (type.toLowerCase().startsWith("feature")) {
|
if (type.toLowerCase(Locale.ENGLISH).startsWith("feature")) {
|
||||||
return "feature";
|
return "feature";
|
||||||
}
|
}
|
||||||
if (type.toLowerCase().startsWith("thank")) {
|
if (type.toLowerCase(Locale.ENGLISH).startsWith("thank")) {
|
||||||
return "thank";
|
return "thank";
|
||||||
}
|
}
|
||||||
if (type.toLowerCase().startsWith("question")) {
|
if (type.toLowerCase(Locale.ENGLISH).startsWith("question")) {
|
||||||
return "question";
|
return "question";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -233,6 +233,7 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="txtDurationGame">
|
<Component class="javax.swing.JLabel" name="txtDurationGame">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Duration Game"/>
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||||
<EtchetBorder/>
|
<EtchetBorder/>
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
* permitted provided that the following conditions are met:
|
* permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
* conditions and the following disclaimer.
|
* conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
* 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
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
* provided with the distribution.
|
* provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* 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
|
* 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
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
@ -20,18 +20,17 @@
|
||||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
* 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
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GameEndDialog.java
|
* GameEndDialog.java
|
||||||
*
|
*
|
||||||
* Created on Jul 31, 2013, 9:41:00 AM
|
* Created on Jul 31, 2013, 9:41:00 AM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
@ -63,19 +62,21 @@ public class GameEndDialog extends MageDialog {
|
||||||
|
|
||||||
private final DateFormat df = DateFormat.getDateTimeInstance();
|
private final DateFormat df = DateFormat.getDateTimeInstance();
|
||||||
|
|
||||||
|
/**
|
||||||
/** Creates new form GameEndDialog
|
* Creates new form GameEndDialog
|
||||||
* @param gameEndView */
|
*
|
||||||
|
* @param gameEndView
|
||||||
|
*/
|
||||||
public GameEndDialog(GameEndView gameEndView) {
|
public GameEndDialog(GameEndView gameEndView) {
|
||||||
|
|
||||||
initComponents();
|
initComponents();
|
||||||
this.modal = true;
|
this.modal = true;
|
||||||
|
|
||||||
pnlText.setOpaque(true);
|
pnlText.setOpaque(true);
|
||||||
pnlText.setBackground(new Color(240,240,240,140));
|
pnlText.setBackground(new Color(240, 240, 240, 140));
|
||||||
|
|
||||||
Rectangle r = new Rectangle(610, 250);
|
Rectangle r = new Rectangle(610, 250);
|
||||||
Image image = ImageHelper.getImageFromResources(gameEndView.hasWon() ?"/game_won.jpg":"/game_lost.jpg");
|
Image image = ImageHelper.getImageFromResources(gameEndView.hasWon() ? "/game_won.jpg" : "/game_lost.jpg");
|
||||||
BufferedImage imageResult = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
BufferedImage imageResult = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||||
ImageIcon icon = new ImageIcon(imageResult);
|
ImageIcon icon = new ImageIcon(imageResult);
|
||||||
lblResultImage.setIcon(icon);
|
lblResultImage.setIcon(icon);
|
||||||
|
@ -90,15 +91,15 @@ public class GameEndDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
// game duration
|
// game duration
|
||||||
txtDurationGame.setText(Format.getDuration(gameEndView.getStartTime(), gameEndView.getEndTime()));
|
txtDurationGame.setText(" " + Format.getDuration(gameEndView.getStartTime(), gameEndView.getEndTime()));
|
||||||
txtDurationGame.setToolTipText(new StringBuilder(df.format(gameEndView.getStartTime())).append(" - ").append(df.format(gameEndView.getEndTime())).toString() );
|
txtDurationGame.setToolTipText(new StringBuilder(df.format(gameEndView.getStartTime())).append(" - ").append(df.format(gameEndView.getEndTime())).toString());
|
||||||
|
|
||||||
// match duration
|
// match duration
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
txtDurationMatch.setText(Format.getDuration(gameEndView.getMatchView().getStartTime(), cal.getTime()));
|
txtDurationMatch.setText(" " + Format.getDuration(gameEndView.getMatchView().getStartTime(), cal.getTime()));
|
||||||
txtDurationMatch.setToolTipText(new StringBuilder(df.format(gameEndView.getMatchView().getStartTime())).append(" - ").append(df.format(cal.getTime())).toString() );
|
txtDurationMatch.setToolTipText(new StringBuilder(df.format(gameEndView.getMatchView().getStartTime())).append(" - ").append(df.format(cal.getTime())).toString());
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder(" ");
|
||||||
for (PlayerView player : gameEndView.getPlayers()) {
|
for (PlayerView player : gameEndView.getPlayers()) {
|
||||||
sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(' ');
|
sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(' ');
|
||||||
}
|
}
|
||||||
|
@ -117,15 +118,15 @@ public class GameEndDialog extends MageDialog {
|
||||||
String dir = "gamelogs";
|
String dir = "gamelogs";
|
||||||
File saveDir = new File(dir);
|
File saveDir = new File(dir);
|
||||||
//Here comes the existence check
|
//Here comes the existence check
|
||||||
if(!saveDir.exists()) {
|
if (!saveDir.exists()) {
|
||||||
saveDir.mkdirs();
|
saveDir.mkdirs();
|
||||||
}
|
}
|
||||||
// get game log
|
// get game log
|
||||||
try {
|
try {
|
||||||
GamePanel gamePanel = MageFrame.getGame(gameEndView.getMatchView().getGames().get(gameEndView.getMatchView().getGames().size()-1));
|
GamePanel gamePanel = MageFrame.getGame(gameEndView.getMatchView().getGames().get(gameEndView.getMatchView().getGames().size() - 1));
|
||||||
if (gamePanel != null) {
|
if (gamePanel != null) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat();
|
SimpleDateFormat sdf = new SimpleDateFormat();
|
||||||
sdf.applyPattern( "yyyyMMdd_HHmmss" );
|
sdf.applyPattern("yyyyMMdd_HHmmss");
|
||||||
String fileName = new StringBuilder(dir).append(File.separator)
|
String fileName = new StringBuilder(dir).append(File.separator)
|
||||||
.append(sdf.format(gameEndView.getStartTime()))
|
.append(sdf.format(gameEndView.getStartTime()))
|
||||||
.append('_').append(gameEndView.getMatchView().getGameType())
|
.append('_').append(gameEndView.getMatchView().getGameType())
|
||||||
|
@ -146,10 +147,10 @@ public class GameEndDialog extends MageDialog {
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/**
|
||||||
* initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
* always regenerated by the Form Editor.
|
* regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
@ -223,6 +224,7 @@ public class GameEndDialog extends MageDialog {
|
||||||
|
|
||||||
lblDurationGame.setText("Duration game:");
|
lblDurationGame.setText("Duration game:");
|
||||||
|
|
||||||
|
txtDurationGame.setText("Duration Game");
|
||||||
txtDurationGame.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
txtDurationGame.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||||
|
|
||||||
lblLife.setText("Life at end:");
|
lblLife.setText("Life at end:");
|
||||||
|
@ -290,7 +292,11 @@ public class GameEndDialog extends MageDialog {
|
||||||
tabPane.addTab("Statistics", tabStatistics);
|
tabPane.addTab("Statistics", tabStatistics);
|
||||||
|
|
||||||
btnOk.setText("OK");
|
btnOk.setText("OK");
|
||||||
btnOk.addActionListener(evt -> btnOkActionPerformed(evt));
|
btnOk.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnOkActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
|
|
|
@ -27,6 +27,12 @@
|
||||||
*/
|
*/
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import javax.swing.*;
|
||||||
import mage.cards.decks.importer.DeckImporterUtil;
|
import mage.cards.decks.importer.DeckImporterUtil;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
|
@ -45,13 +51,6 @@ import mage.view.GameTypeView;
|
||||||
import mage.view.TableView;
|
import mage.view.TableView;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
@ -623,17 +622,22 @@ public class NewTableDialog extends MageDialog {
|
||||||
* set the table settings from java prefs
|
* set the table settings from java prefs
|
||||||
*/
|
*/
|
||||||
int currentSettingVersion = 0;
|
int currentSettingVersion = 0;
|
||||||
|
|
||||||
private void setGameSettingsFromPrefs(int version) {
|
private void setGameSettingsFromPrefs(int version) {
|
||||||
currentSettingVersion = version;
|
currentSettingVersion = version;
|
||||||
String versionStr = "";
|
String versionStr = "";
|
||||||
if (currentSettingVersion == 1) {
|
switch (currentSettingVersion) {
|
||||||
versionStr = "1";
|
case 1:
|
||||||
btnPreviousConfiguration1.requestFocus();
|
versionStr = "1";
|
||||||
} else if (currentSettingVersion == 2) {
|
btnPreviousConfiguration1.requestFocus();
|
||||||
versionStr = "2";
|
break;
|
||||||
btnPreviousConfiguration2.requestFocus();
|
case 2:
|
||||||
} else {
|
versionStr = "2";
|
||||||
btnPreviousConfiguration2.getParent().requestFocus();
|
btnPreviousConfiguration2.requestFocus();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
btnPreviousConfiguration2.getParent().requestFocus();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
txtName.setText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NAME + versionStr, "Game"));
|
txtName.setText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NAME + versionStr, "Game"));
|
||||||
txtPassword.setText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_PASSWORD + versionStr, ""));
|
txtPassword.setText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_PASSWORD + versionStr, ""));
|
||||||
|
@ -724,6 +728,7 @@ public class NewTableDialog extends MageDialog {
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_RANGE + versionStr, Integer.toString(options.getRange().getRange()));
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_RANGE + versionStr, Integer.toString(options.getRange().getRange()));
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ATTACK_OPTION + versionStr, options.getAttackOption().toString());
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ATTACK_OPTION + versionStr, options.getAttackOption().toString());
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL + versionStr, options.getSkillLevel().toString());
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL + versionStr, options.getSkillLevel().toString());
|
||||||
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_SPECTATORS_ALLOWED + versionStr, options.isSpectatorsAllowed() ? "Yes" : "No");
|
||||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_QUIT_RATIO + versionStr, Integer.toString(options.getQuitRatio()));
|
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_QUIT_RATIO + versionStr, Integer.toString(options.getQuitRatio()));
|
||||||
StringBuilder playerTypesString = new StringBuilder();
|
StringBuilder playerTypesString = new StringBuilder();
|
||||||
for (Object player : players) {
|
for (Object player : players) {
|
||||||
|
|
|
@ -35,11 +35,14 @@ package mage.client.dialog;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.UUID;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
|
||||||
import mage.cards.decks.Deck;
|
import mage.cards.decks.Deck;
|
||||||
import mage.cards.decks.importer.DeckImporterUtil;
|
import mage.cards.decks.importer.DeckImporterUtil;
|
||||||
import mage.cards.repository.ExpansionInfo;
|
import mage.cards.repository.ExpansionInfo;
|
||||||
|
@ -589,9 +592,9 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
} else {
|
} else {
|
||||||
for (JPanel panel : packPanels) {
|
for (JPanel panel : packPanels) {
|
||||||
JComboBox combo = findComboInComponent(panel);
|
JComboBox combo = findComboInComponent(panel);
|
||||||
if(combo != null) {
|
if (combo != null) {
|
||||||
tOptions.getLimitedOptions().getSetCodes().add(((ExpansionInfo) combo.getSelectedItem()).getCode());
|
tOptions.getLimitedOptions().getSetCodes().add(((ExpansionInfo) combo.getSelectedItem()).getCode());
|
||||||
}else{
|
} else {
|
||||||
logger.error("Can't find combo component in " + panel.toString());
|
logger.error("Can't find combo component in " + panel.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -764,7 +767,6 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
this.spnNumPlayers.setModel(new SpinnerNumberModel(numPlayers, tournamentType.getMinPlayers(), tournamentType.getMaxPlayers(), 1));
|
this.spnNumPlayers.setModel(new SpinnerNumberModel(numPlayers, tournamentType.getMinPlayers(), tournamentType.getMaxPlayers(), 1));
|
||||||
this.spnNumPlayers.setEnabled(tournamentType.getMinPlayers() != tournamentType.getMaxPlayers());
|
this.spnNumPlayers.setEnabled(tournamentType.getMinPlayers() != tournamentType.getMaxPlayers());
|
||||||
createPlayers((Integer) spnNumPlayers.getValue() - 1);
|
createPlayers((Integer) spnNumPlayers.getValue() - 1);
|
||||||
|
|
||||||
this.spnNumSeats.setModel(new SpinnerNumberModel(2, 2, tournamentType.getMaxPlayers(), 1));
|
this.spnNumSeats.setModel(new SpinnerNumberModel(2, 2, tournamentType.getMaxPlayers(), 1));
|
||||||
|
|
||||||
if (tournamentType.isLimited()) {
|
if (tournamentType.isLimited()) {
|
||||||
|
@ -926,7 +928,7 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
|
||||||
// search combo box near button (must be only one combo in panel)
|
// search combo box near button (must be only one combo in panel)
|
||||||
JButton button = (JButton)evt.getSource();
|
JButton button = (JButton) evt.getSource();
|
||||||
JComboBox combo = findComboInComponent(button.getParent());
|
JComboBox combo = findComboInComponent(button.getParent());
|
||||||
|
|
||||||
if (combo != null) {
|
if (combo != null) {
|
||||||
|
@ -941,12 +943,12 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
private JComboBox findComboInComponent(Container panel){
|
private JComboBox findComboInComponent(Container panel) {
|
||||||
// search combo box near button (must be only one combo in panel)
|
// search combo box near button (must be only one combo in panel)
|
||||||
JComboBox combo = null;
|
JComboBox combo = null;
|
||||||
for(Component comp: panel.getComponents()){
|
for (Component comp : panel.getComponents()) {
|
||||||
if (comp instanceof JComboBox){
|
if (comp instanceof JComboBox) {
|
||||||
combo = (JComboBox)comp;
|
combo = (JComboBox) comp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -955,21 +957,21 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
|
|
||||||
private void packActionPerformed(java.awt.event.ActionEvent evt) {
|
private void packActionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
// fill all bottom combobox with same value
|
// fill all bottom combobox with same value
|
||||||
JComboBox curentCombo = (JComboBox)evt.getSource();
|
JComboBox curentCombo = (JComboBox) evt.getSource();
|
||||||
int newValue = curentCombo.getSelectedIndex();
|
int newValue = curentCombo.getSelectedIndex();
|
||||||
|
|
||||||
// search start index
|
// search start index
|
||||||
int startIndex = 0;
|
int startIndex = 0;
|
||||||
for(int i = 0; i < packPanels.size(); i++){
|
for (int i = 0; i < packPanels.size(); i++) {
|
||||||
JComboBox pack = findComboInComponent(packPanels.get(i));
|
JComboBox pack = findComboInComponent(packPanels.get(i));
|
||||||
if (pack.equals(curentCombo)){
|
if (pack.equals(curentCombo)) {
|
||||||
startIndex = i + 1;
|
startIndex = i + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// change all from start index
|
// change all from start index
|
||||||
for(int i = startIndex; i < packPanels.size(); i++){
|
for (int i = startIndex; i < packPanels.size(); i++) {
|
||||||
JComboBox pack = findComboInComponent(packPanels.get(i));
|
JComboBox pack = findComboInComponent(packPanels.get(i));
|
||||||
pack.setSelectedIndex(newValue);
|
pack.setSelectedIndex(newValue);
|
||||||
}
|
}
|
||||||
|
@ -1128,7 +1130,7 @@ public class NewTournamentDialog extends MageDialog {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
logger.error("Can't find combo component in " + panel.toString());
|
logger.error("Can't find combo component in " + panel.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1263,7 +1265,7 @@ class DeckFilter extends FileFilter {
|
||||||
int i = s.lastIndexOf('.');
|
int i = s.lastIndexOf('.');
|
||||||
|
|
||||||
if (i > 0 && i < s.length() - 1) {
|
if (i > 0 && i < s.length() - 1) {
|
||||||
ext = s.substring(i + 1).toLowerCase();
|
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
return (ext == null) ? false : ext.equals("dck");
|
return (ext == null) ? false : ext.equals("dck");
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,11 +210,11 @@ public class PickChoiceDialog extends MageDialog {
|
||||||
// load data to datamodel after filter or on startup
|
// load data to datamodel after filter or on startup
|
||||||
String filter = choice.getSearchText();
|
String filter = choice.getSearchText();
|
||||||
if (filter == null){ filter = ""; }
|
if (filter == null){ filter = ""; }
|
||||||
filter = filter.toLowerCase();
|
filter = filter.toLowerCase(Locale.ENGLISH);
|
||||||
|
|
||||||
this.dataModel.clear();
|
this.dataModel.clear();
|
||||||
for(KeyValueItem item: this.allItems){
|
for(KeyValueItem item: this.allItems){
|
||||||
if(!choice.isSearchEnabled() || item.Value.toLowerCase().contains(filter)){
|
if(!choice.isSearchEnabled() || item.Value.toLowerCase(Locale.ENGLISH).contains(filter)){
|
||||||
this.dataModel.addElement(item);
|
this.dataModel.addElement(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,22 +22,14 @@
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Component id="jScrollPane1" pref="183" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Component id="panelCommands" alignment="1" max="32767" attributes="0"/>
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
<Component id="spnAmount" min="-2" pref="74" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Component id="jScrollPane1" alignment="0" pref="146" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<Component id="spnAmount" min="-2" pref="52" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="54" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -45,46 +37,21 @@
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jScrollPane1" pref="64" max="32767" attributes="0"/>
|
<Component id="jScrollPane1" pref="117" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="spnAmount" min="-2" max="-2" attributes="0"/>
|
<Component id="spnAmount" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Component id="panelCommands" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="btnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JSpinner" name="spnAmount">
|
|
||||||
<Properties>
|
|
||||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
|
||||||
<SpinnerModel initial="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="btnCancel">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="btnOk">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="OK"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOkActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
@ -94,10 +61,8 @@
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JTextPane" name="lblMessage">
|
<Component class="javax.swing.JTextPane" name="lblMessage">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
|
||||||
<Border info="null"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="editable" type="boolean" value="false"/>
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="long text long text long text long text long text long text long text long text"/>
|
||||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||||
<Connection code="null	" type="code"/>
|
<Connection code="null	" type="code"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
@ -107,5 +72,61 @@
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
|
<Component class="javax.swing.JSpinner" name="spnAmount">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||||
|
<SpinnerModel initial="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="panelCommands">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="btnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JButton" name="btnOk">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Choose"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOkActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="getRootPane().setDefaultButton(btnOk);"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnCancel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.awt.event.KeyListener;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
|
@ -57,6 +59,7 @@ public class PickNumberDialog extends MageDialog {
|
||||||
|
|
||||||
public void showDialog(int min, int max, String message) {
|
public void showDialog(int min, int max, String message) {
|
||||||
this.spnAmount.setModel(new SpinnerNumberModel(min, min, max, 1));
|
this.spnAmount.setModel(new SpinnerNumberModel(min, min, max, 1));
|
||||||
|
this.lblMessage.setContentType("text/html");
|
||||||
this.lblMessage.setText(message);
|
this.lblMessage.setText(message);
|
||||||
this.btnOk.setVisible(true);
|
this.btnOk.setVisible(true);
|
||||||
this.btnCancel.setVisible(false);
|
this.btnCancel.setVisible(false);
|
||||||
|
@ -68,11 +71,34 @@ public class PickNumberDialog extends MageDialog {
|
||||||
}else{
|
}else{
|
||||||
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
||||||
}
|
}
|
||||||
|
this.getRootPane().setDefaultButton(this.btnOk); // restore default button after root panel change (no need actually)
|
||||||
|
|
||||||
|
// enable spinner's enter key like text (one enter press instead two)
|
||||||
|
// https://stackoverflow.com/questions/3873870/java-keylistener-not-firing-on-jspinner
|
||||||
|
((JSpinner.DefaultEditor)this.spnAmount.getEditor()).getTextField().addKeyListener(new KeyListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyReleased(KeyEvent e) {
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||||
|
btnOk.doClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyTyped(KeyEvent e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
Point centered = SettingsManager.instance.getComponentPosition(getWidth(), getHeight());
|
Point centered = SettingsManager.instance.getComponentPosition(getWidth(), getHeight());
|
||||||
this.setLocation(centered.x, centered.y);
|
this.setLocation(centered.x, centered.y);
|
||||||
GuiDisplayUtil.keepComponentInsideScreen(centered.x, centered.y, this);
|
GuiDisplayUtil.keepComponentInsideScreen(centered.x, centered.y, this);
|
||||||
|
|
||||||
|
// TODO: need to fix focus restore on second popup (it's not focues, test on Manamorphose)
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,29 +119,62 @@ public class PickNumberDialog extends MageDialog {
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
spnAmount = new javax.swing.JSpinner();
|
|
||||||
btnCancel = new javax.swing.JButton();
|
|
||||||
btnOk = new javax.swing.JButton();
|
|
||||||
jScrollPane1 = new javax.swing.JScrollPane();
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
lblMessage = new javax.swing.JTextPane();
|
lblMessage = new javax.swing.JTextPane();
|
||||||
|
spnAmount = new javax.swing.JSpinner();
|
||||||
spnAmount.setModel(new javax.swing.SpinnerNumberModel(1, null, null, 1));
|
panelCommands = new javax.swing.JPanel();
|
||||||
|
btnOk = new javax.swing.JButton();
|
||||||
btnCancel.setText("Cancel");
|
btnCancel = new javax.swing.JButton();
|
||||||
btnCancel.addActionListener(evt -> btnCancelActionPerformed(evt));
|
|
||||||
|
|
||||||
btnOk.setText("OK");
|
|
||||||
btnOk.addActionListener(evt -> btnOkActionPerformed(evt));
|
|
||||||
|
|
||||||
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
jScrollPane1.setFocusable(false);
|
||||||
|
|
||||||
lblMessage.setBorder(null);
|
|
||||||
lblMessage.setEditable(false);
|
lblMessage.setEditable(false);
|
||||||
lblMessage.setCursor(null );
|
lblMessage.setText("long text long text long text long text long text long text long text long text");
|
||||||
|
lblMessage.setCursor(null );
|
||||||
lblMessage.setFocusable(false);
|
lblMessage.setFocusable(false);
|
||||||
lblMessage.setOpaque(false);
|
lblMessage.setOpaque(false);
|
||||||
jScrollPane1.setViewportView(lblMessage);
|
jScrollPane1.setViewportView(lblMessage);
|
||||||
|
|
||||||
|
spnAmount.setModel(new javax.swing.SpinnerNumberModel(1, null, null, 1));
|
||||||
|
|
||||||
|
btnOk.setText("Choose");
|
||||||
|
btnOk.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnOkActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnCancel.setText("Cancel");
|
||||||
|
btnCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnCancelActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
javax.swing.GroupLayout panelCommandsLayout = new javax.swing.GroupLayout(panelCommands);
|
||||||
|
panelCommands.setLayout(panelCommandsLayout);
|
||||||
|
panelCommandsLayout.setHorizontalGroup(
|
||||||
|
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(btnOk)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(btnCancel)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
panelCommandsLayout.setVerticalGroup(
|
||||||
|
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(btnOk)
|
||||||
|
.addComponent(btnCancel))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
getRootPane().setDefaultButton(btnOk);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
|
@ -123,29 +182,22 @@ public class PickNumberDialog extends MageDialog {
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
|
||||||
|
.addComponent(panelCommands, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addComponent(spnAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGap(0, 0, Short.MAX_VALUE)))
|
||||||
.addComponent(btnOk)
|
.addContainerGap())
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
||||||
.addComponent(btnCancel))
|
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE))
|
|
||||||
.addContainerGap())
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
|
||||||
.addComponent(spnAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(54, 54, 54))))
|
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE)
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(spnAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(spnAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(btnCancel)
|
|
||||||
.addComponent(btnOk))
|
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -167,6 +219,7 @@ public class PickNumberDialog extends MageDialog {
|
||||||
private javax.swing.JButton btnOk;
|
private javax.swing.JButton btnOk;
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JTextPane lblMessage;
|
private javax.swing.JTextPane lblMessage;
|
||||||
|
private javax.swing.JPanel panelCommands;
|
||||||
private javax.swing.JSpinner spnAmount;
|
private javax.swing.JSpinner spnAmount;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
|
|
@ -95,10 +95,10 @@
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="main_game" min="-2" max="-2" attributes="0"/>
|
<Component id="main_game" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="main_gamelog" min="-2" pref="107" max="-2" attributes="0"/>
|
<Component id="main_gamelog" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="main_battlefield" min="-2" max="-2" attributes="0"/>
|
<Component id="main_battlefield" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="121" max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
|
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
|
||||||
<Component id="tooltipDelayLabel" pref="308" max="32767" attributes="0"/>
|
<Component id="tooltipDelayLabel" max="32767" attributes="0"/>
|
||||||
<Component id="tooltipDelay" alignment="1" max="32767" attributes="0"/>
|
<Component id="tooltipDelay" alignment="1" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
@ -295,16 +295,22 @@
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="showPlayerNamesPermanently" alignment="0" max="32767" attributes="0"/>
|
<Group type="102" attributes="0">
|
||||||
<Component id="nonLandPermanentsInOnePile" alignment="0" max="32767" attributes="0"/>
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="cbConfirmEmptyManaPool" alignment="0" max="32767" attributes="0"/>
|
<Component id="showPlayerNamesPermanently" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="cbAllowRequestToShowHandCards" alignment="0" max="32767" attributes="0"/>
|
<Component id="nonLandPermanentsInOnePile" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="cbShowStormCounter" alignment="0" max="32767" attributes="0"/>
|
<Component id="cbConfirmEmptyManaPool" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="cbAskMoveToGraveOrder" alignment="0" max="32767" attributes="0"/>
|
<Component id="cbAllowRequestToShowHandCards" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="showAbilityPickerForced" alignment="0" max="32767" attributes="0"/>
|
<Component id="cbShowStormCounter" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="cbAskMoveToGraveOrder" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="showAbilityPickerForced" alignment="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="displayLifeOnAvatar" alignment="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="177" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -315,6 +321,8 @@
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="showPlayerNamesPermanently" min="-2" max="-2" attributes="0"/>
|
<Component id="showPlayerNamesPermanently" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="displayLifeOnAvatar" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="showAbilityPickerForced" min="-2" max="-2" attributes="0"/>
|
<Component id="showAbilityPickerForced" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="cbAllowRequestToShowHandCards" min="-2" max="-2" attributes="0"/>
|
<Component id="cbAllowRequestToShowHandCards" min="-2" max="-2" attributes="0"/>
|
||||||
|
@ -324,7 +332,6 @@
|
||||||
<Component id="cbConfirmEmptyManaPool" min="-2" max="-2" attributes="0"/>
|
<Component id="cbConfirmEmptyManaPool" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="cbAskMoveToGraveOrder" min="-2" max="-2" attributes="0"/>
|
<Component id="cbAskMoveToGraveOrder" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -354,6 +361,17 @@
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showPlayerNamesPermanentlyActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showPlayerNamesPermanentlyActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="displayLifeOnAvatar">
|
||||||
|
<Properties>
|
||||||
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="Display life on avatar image"/>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" value="Display the player's life over its avatar image."/>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="displayLifeOnAvatarActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="showAbilityPickerForced">
|
<Component class="javax.swing.JCheckBox" name="showAbilityPickerForced">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="selected" type="boolean" value="true"/>
|
<Property name="selected" type="boolean" value="true"/>
|
||||||
|
@ -4274,7 +4292,7 @@
|
||||||
<Component id="panelCardImages" min="-2" max="-2" attributes="0"/>
|
<Component id="panelCardImages" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="panelBackgroundImages" min="-2" max="-2" attributes="0"/>
|
<Component id="panelBackgroundImages" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="125" max="32767" attributes="0"/>
|
<EmptySpace pref="133" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -4847,7 +4865,7 @@
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="avatarPane" pref="584" max="32767" attributes="0"/>
|
<Component id="avatarPane" pref="620" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -45,6 +45,7 @@ import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.prefs.BackingStoreException;
|
import java.util.prefs.BackingStoreException;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
@ -96,6 +97,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
public static final String KEY_SHOW_FULL_IMAGE_PATH = "showFullImagePath";
|
public static final String KEY_SHOW_FULL_IMAGE_PATH = "showFullImagePath";
|
||||||
public static final String KEY_PERMANENTS_IN_ONE_PILE = "nonLandPermanentsInOnePile";
|
public static final String KEY_PERMANENTS_IN_ONE_PILE = "nonLandPermanentsInOnePile";
|
||||||
public static final String KEY_SHOW_PLAYER_NAMES_PERMANENTLY = "showPlayerNamesPermanently";
|
public static final String KEY_SHOW_PLAYER_NAMES_PERMANENTLY = "showPlayerNamesPermanently";
|
||||||
|
public static final String KEY_DISPLAY_LIVE_ON_AVATAR = "displayLiveOnAvatar";
|
||||||
public static final String KEY_SHOW_ABILITY_PICKER_FORCED = "showAbilityPicker";
|
public static final String KEY_SHOW_ABILITY_PICKER_FORCED = "showAbilityPicker";
|
||||||
public static final String KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS = "gameAllowRequestShowHandCards";
|
public static final String KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS = "gameAllowRequestShowHandCards";
|
||||||
public static final String KEY_GAME_SHOW_STORM_COUNTER = "gameShowStormCounter";
|
public static final String KEY_GAME_SHOW_STORM_COUNTER = "gameShowStormCounter";
|
||||||
|
@ -421,6 +423,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
main_game = new javax.swing.JPanel();
|
main_game = new javax.swing.JPanel();
|
||||||
nonLandPermanentsInOnePile = new javax.swing.JCheckBox();
|
nonLandPermanentsInOnePile = new javax.swing.JCheckBox();
|
||||||
showPlayerNamesPermanently = new javax.swing.JCheckBox();
|
showPlayerNamesPermanently = new javax.swing.JCheckBox();
|
||||||
|
displayLifeOnAvatar = new javax.swing.JCheckBox();
|
||||||
showAbilityPickerForced = new javax.swing.JCheckBox();
|
showAbilityPickerForced = new javax.swing.JCheckBox();
|
||||||
cbAllowRequestToShowHandCards = new javax.swing.JCheckBox();
|
cbAllowRequestToShowHandCards = new javax.swing.JCheckBox();
|
||||||
cbShowStormCounter = new javax.swing.JCheckBox();
|
cbShowStormCounter = new javax.swing.JCheckBox();
|
||||||
|
@ -700,7 +703,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.add(6, 6, 6)
|
.add(6, 6, 6)
|
||||||
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
||||||
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 308, Short.MAX_VALUE)
|
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
.add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
.add(main_cardLayout.createSequentialGroup()
|
.add(main_cardLayout.createSequentialGroup()
|
||||||
.add(showCardName)
|
.add(showCardName)
|
||||||
|
@ -741,6 +744,16 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
displayLifeOnAvatar.setSelected(true);
|
||||||
|
displayLifeOnAvatar.setText("Display life on avatar image");
|
||||||
|
displayLifeOnAvatar.setToolTipText("Display the player's life over its avatar image.");
|
||||||
|
displayLifeOnAvatar.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||||
|
displayLifeOnAvatar.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
displayLifeOnAvatarActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
showAbilityPickerForced.setSelected(true);
|
showAbilityPickerForced.setSelected(true);
|
||||||
showAbilityPickerForced.setText("Show ability picker for abilities or spells without costs");
|
showAbilityPickerForced.setText("Show ability picker for abilities or spells without costs");
|
||||||
showAbilityPickerForced.setToolTipText("This prevents you from accidently activating abilities without other costs than tapping or casting spells with 0 mana costs.");
|
showAbilityPickerForced.setToolTipText("This prevents you from accidently activating abilities without other costs than tapping or casting spells with 0 mana costs.");
|
||||||
|
@ -797,15 +810,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
.add(main_gameLayout.createSequentialGroup()
|
.add(main_gameLayout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.add(main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
|
.add(main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
.add(showPlayerNamesPermanently, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.add(main_gameLayout.createSequentialGroup()
|
||||||
.add(nonLandPermanentsInOnePile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.add(main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
|
||||||
.add(cbConfirmEmptyManaPool, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.add(showPlayerNamesPermanently, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.add(cbAllowRequestToShowHandCards, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.add(nonLandPermanentsInOnePile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.add(cbShowStormCounter, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.add(cbConfirmEmptyManaPool, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.add(cbAskMoveToGraveOrder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.add(cbAllowRequestToShowHandCards, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.add(showAbilityPickerForced, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
.add(cbShowStormCounter, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addContainerGap(177, Short.MAX_VALUE))
|
.add(cbAskMoveToGraveOrder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.add(showAbilityPickerForced, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.add(0, 0, Short.MAX_VALUE))
|
||||||
|
.add(displayLifeOnAvatar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
main_gameLayout.setVerticalGroup(
|
main_gameLayout.setVerticalGroup(
|
||||||
main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
main_gameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
|
@ -814,6 +831,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(showPlayerNamesPermanently)
|
.add(showPlayerNamesPermanently)
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
|
.add(displayLifeOnAvatar)
|
||||||
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(showAbilityPickerForced)
|
.add(showAbilityPickerForced)
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(cbAllowRequestToShowHandCards)
|
.add(cbAllowRequestToShowHandCards)
|
||||||
|
@ -822,8 +841,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(cbConfirmEmptyManaPool)
|
.add(cbConfirmEmptyManaPool)
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(cbAskMoveToGraveOrder)
|
.add(cbAskMoveToGraveOrder))
|
||||||
.addContainerGap())
|
|
||||||
);
|
);
|
||||||
|
|
||||||
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");
|
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");
|
||||||
|
@ -880,10 +898,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(main_game, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
.add(main_game, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(main_gamelog, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 107, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
.add(main_gamelog, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(main_battlefield, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
.add(main_battlefield, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||||
.addContainerGap(121, Short.MAX_VALUE))
|
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
|
|
||||||
main_card.getAccessibleContext().setAccessibleName("Game panel");
|
main_card.getAccessibleContext().setAccessibleName("Game panel");
|
||||||
|
@ -1797,7 +1815,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.add(panelCardImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
.add(panelCardImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(panelBackgroundImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
.add(panelBackgroundImages, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||||
.addContainerGap(125, Short.MAX_VALUE))
|
.addContainerGap(133, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
|
|
||||||
tabsPanel.addTab("Images", tabImages);
|
tabsPanel.addTab("Images", tabImages);
|
||||||
|
@ -2372,7 +2390,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
tabAvatarsLayout.setVerticalGroup(
|
tabAvatarsLayout.setVerticalGroup(
|
||||||
tabAvatarsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
tabAvatarsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
.add(tabAvatarsLayout.createSequentialGroup()
|
.add(tabAvatarsLayout.createSequentialGroup()
|
||||||
.add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 584, Short.MAX_VALUE)
|
.add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 620, Short.MAX_VALUE)
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2762,6 +2780,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
save(prefs, dialog.showFullImagePath, KEY_SHOW_FULL_IMAGE_PATH, "true", "false", UPDATE_CACHE_POLICY);
|
save(prefs, dialog.showFullImagePath, KEY_SHOW_FULL_IMAGE_PATH, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
save(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true", "false", UPDATE_CACHE_POLICY);
|
save(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
save(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true", "false", UPDATE_CACHE_POLICY);
|
save(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
|
save(prefs, dialog.displayLifeOnAvatar, KEY_DISPLAY_LIVE_ON_AVATAR, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
save(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true", "false", UPDATE_CACHE_POLICY);
|
save(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
save(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true", "false", UPDATE_CACHE_POLICY);
|
save(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
save(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true", "false", UPDATE_CACHE_POLICY);
|
save(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true", "false", UPDATE_CACHE_POLICY);
|
||||||
|
@ -3225,6 +3244,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_cbGameJsonLogAutoSaveActionPerformed
|
}//GEN-LAST:event_cbGameJsonLogAutoSaveActionPerformed
|
||||||
|
|
||||||
|
private void displayLifeOnAvatarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayLifeOnAvatarActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
}//GEN-LAST:event_displayLifeOnAvatarActionPerformed
|
||||||
|
|
||||||
private void showProxySettings() {
|
private void showProxySettings() {
|
||||||
Connection.ProxyType proxyType = (Connection.ProxyType) cbProxyType.getSelectedItem();
|
Connection.ProxyType proxyType = (Connection.ProxyType) cbProxyType.getSelectedItem();
|
||||||
switch (proxyType) {
|
switch (proxyType) {
|
||||||
|
@ -3331,6 +3354,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
load(prefs, dialog.showFullImagePath, KEY_SHOW_FULL_IMAGE_PATH, "true");
|
load(prefs, dialog.showFullImagePath, KEY_SHOW_FULL_IMAGE_PATH, "true");
|
||||||
load(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true");
|
load(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true");
|
||||||
load(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
|
load(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
|
||||||
|
load(prefs, dialog.displayLifeOnAvatar, KEY_DISPLAY_LIVE_ON_AVATAR, "true");
|
||||||
load(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true");
|
load(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true");
|
||||||
load(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true");
|
load(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true");
|
||||||
load(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true");
|
load(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true");
|
||||||
|
@ -3469,7 +3493,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadProxySettings(Preferences prefs) {
|
private static void loadProxySettings(Preferences prefs) {
|
||||||
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase()));
|
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase(Locale.ENGLISH)));
|
||||||
|
|
||||||
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, Config.serverName);
|
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, Config.serverName);
|
||||||
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(Config.port));
|
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(Config.port));
|
||||||
|
@ -3928,6 +3952,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
private javax.swing.JCheckBox checkBoxUpkeepYou;
|
private javax.swing.JCheckBox checkBoxUpkeepYou;
|
||||||
private javax.swing.JPanel connection_servers;
|
private javax.swing.JPanel connection_servers;
|
||||||
private javax.swing.JLabel controlsDescriptionLabel;
|
private javax.swing.JLabel controlsDescriptionLabel;
|
||||||
|
private javax.swing.JCheckBox displayLifeOnAvatar;
|
||||||
private javax.swing.JButton exitButton;
|
private javax.swing.JButton exitButton;
|
||||||
private javax.swing.JLabel fontSizeLabel;
|
private javax.swing.JLabel fontSizeLabel;
|
||||||
private javax.swing.JPanel guiSizeBasic;
|
private javax.swing.JPanel guiSizeBasic;
|
||||||
|
|
|
@ -52,7 +52,6 @@ import mage.client.util.gui.ArrowBuilder;
|
||||||
import mage.client.util.gui.MageDialogState;
|
import mage.client.util.gui.MageDialogState;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.events.PlayerQueryEvent;
|
import mage.game.events.PlayerQueryEvent;
|
||||||
import mage.game.turn.Phase;
|
|
||||||
import mage.view.*;
|
import mage.view.*;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.mage.card.arcane.CardPanel;
|
import org.mage.card.arcane.CardPanel;
|
||||||
|
|
|
@ -45,7 +45,6 @@ import javax.swing.SwingUtilities;
|
||||||
import javax.swing.ToolTipManager;
|
import javax.swing.ToolTipManager;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.border.LineBorder;
|
|
||||||
|
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import mage.client.components.MageTextArea;
|
import mage.client.components.MageTextArea;
|
||||||
|
|
|
@ -77,7 +77,6 @@ import mage.constants.ManaType;
|
||||||
import mage.counters.Counter;
|
import mage.counters.Counter;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.designations.DesignationType;
|
import mage.designations.DesignationType;
|
||||||
import mage.remote.Session;
|
|
||||||
import mage.utils.timer.PriorityTimer;
|
import mage.utils.timer.PriorityTimer;
|
||||||
import mage.view.CardView;
|
import mage.view.CardView;
|
||||||
import mage.view.ManaPoolView;
|
import mage.view.ManaPoolView;
|
||||||
|
@ -93,13 +92,10 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
|
|
||||||
private UUID playerId;
|
private UUID playerId;
|
||||||
private UUID gameId;
|
private UUID gameId;
|
||||||
private Session session;
|
|
||||||
private PlayerView player;
|
private PlayerView player;
|
||||||
|
|
||||||
private BigCard bigCard;
|
private BigCard bigCard;
|
||||||
|
|
||||||
private static final int AVATAR_COUNT = 77;
|
|
||||||
|
|
||||||
private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg";
|
private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg";
|
||||||
|
|
||||||
private static final int PANEL_WIDTH = 94;
|
private static final int PANEL_WIDTH = 94;
|
||||||
|
@ -179,8 +175,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
|
|
||||||
public void update(PlayerView player) {
|
public void update(PlayerView player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
updateAvatar();
|
|
||||||
int playerLife = player.getLife();
|
int playerLife = player.getLife();
|
||||||
|
avatar.setCenterText("true".equals(MageFrame.getPreferences().get(PreferencesDialog.KEY_DISPLAY_LIVE_ON_AVATAR, "true"))
|
||||||
|
? String.valueOf(playerLife) : null);
|
||||||
|
updateAvatar();
|
||||||
|
|
||||||
if (playerLife > 99) {
|
if (playerLife > 99) {
|
||||||
Font font = lifeLabel.getFont();
|
Font font = lifeLabel.getFont();
|
||||||
font = font.deriveFont(9f);
|
font = font.deriveFont(9f);
|
||||||
|
@ -701,8 +700,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
.addComponent(btnPlayer, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(btnPlayer, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(timerLabel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(timerLabel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(avatar, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
|
.addComponent(avatar, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
|
||||||
// .addGroup(gl_panelBackground.createSequentialGroup()
|
|
||||||
// .addComponent(avatarFlag, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addGap(8))
|
.addGap(8))
|
||||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||||
.addGap(6)
|
.addGap(6)
|
||||||
|
@ -824,16 +821,12 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
protected void sizePlayerPanel(boolean smallMode) {
|
protected void sizePlayerPanel(boolean smallMode) {
|
||||||
if (smallMode) {
|
if (smallMode) {
|
||||||
avatar.setVisible(false);
|
avatar.setVisible(false);
|
||||||
// avatarFlag.setVisible(false);
|
|
||||||
// monarchIcon.setVisible(false);
|
|
||||||
btnPlayer.setVisible(true);
|
btnPlayer.setVisible(true);
|
||||||
timerLabel.setVisible(true);
|
timerLabel.setVisible(true);
|
||||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL));
|
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL));
|
||||||
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL);
|
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL);
|
||||||
} else {
|
} else {
|
||||||
avatar.setVisible(true);
|
avatar.setVisible(true);
|
||||||
// avatarFlag.setVisible(true);
|
|
||||||
// monarchIcon.setVisible(true);
|
|
||||||
btnPlayer.setVisible(false);
|
btnPlayer.setVisible(false);
|
||||||
timerLabel.setVisible(false);
|
timerLabel.setVisible(false);
|
||||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
|
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
|
||||||
|
@ -887,8 +880,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private HoverButton avatar;
|
private HoverButton avatar;
|
||||||
// private JLabel avatarFlag;
|
|
||||||
// private JLabel monarchIcon;
|
|
||||||
private JButton btnPlayer;
|
private JButton btnPlayer;
|
||||||
private ImagePanel life;
|
private ImagePanel life;
|
||||||
private ImagePanel poison;
|
private ImagePanel poison;
|
||||||
|
@ -918,7 +909,6 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
||||||
private JPanel energyExperiencePanel;
|
private JPanel energyExperiencePanel;
|
||||||
private HoverButton exileZone;
|
private HoverButton exileZone;
|
||||||
private HoverButton commandZone;
|
private HoverButton commandZone;
|
||||||
private HoverButton enchantPlayerViewZone;
|
|
||||||
|
|
||||||
private final Map<String, JLabel> manaLabels = new HashMap<>();
|
private final Map<String, JLabel> manaLabels = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,12 @@ import mage.cards.MageCard;
|
||||||
import mage.cards.action.ActionCallback;
|
import mage.cards.action.ActionCallback;
|
||||||
import mage.cards.action.TransferData;
|
import mage.cards.action.TransferData;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
|
import mage.client.MagePane;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import mage.client.cards.BigCard;
|
import mage.client.cards.BigCard;
|
||||||
import mage.client.components.MageComponents;
|
import mage.client.components.MageComponents;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
|
import mage.client.game.GamePane;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.DefaultActionCallback;
|
import mage.client.util.DefaultActionCallback;
|
||||||
import mage.client.util.gui.ArrowBuilder;
|
import mage.client.util.gui.ArrowBuilder;
|
||||||
|
@ -367,6 +369,16 @@ public class MageActionCallback implements ActionCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleOverNewView(TransferData data) {
|
private void handleOverNewView(TransferData data) {
|
||||||
|
// Prevent to show tooltips from panes not in front
|
||||||
|
MagePane topPane = MageFrame.getTopMost(null);
|
||||||
|
if (topPane instanceof GamePane) {
|
||||||
|
if (!((GamePane) topPane).getGameId().equals(data.gameId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (data.gameId != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
hideTooltipPopup();
|
hideTooltipPopup();
|
||||||
cancelTimeout();
|
cancelTimeout();
|
||||||
Component parentComponent = SwingUtilities.getRoot(data.component);
|
Component parentComponent = SwingUtilities.getRoot(data.component);
|
||||||
|
|
|
@ -24,25 +24,24 @@
|
||||||
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NewPlayerPanel.java
|
* NewPlayerPanel.java
|
||||||
*
|
*
|
||||||
* Created on 15-Dec-2009, 10:09:46 PM
|
* Created on 15-Dec-2009, 10:09:46 PM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.client.table;
|
package mage.client.table;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Locale;
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.filechooser.FileFilter;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.deck.generator.DeckGenerator;
|
import mage.client.deck.generator.DeckGenerator;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.Config;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.filechooser.FileFilter;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
@ -51,7 +50,9 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
private final JFileChooser fcSelectDeck;
|
private final JFileChooser fcSelectDeck;
|
||||||
|
|
||||||
/** Creates new form NewPlayerPanel */
|
/**
|
||||||
|
* Creates new form NewPlayerPanel
|
||||||
|
*/
|
||||||
public NewPlayerPanel() {
|
public NewPlayerPanel() {
|
||||||
initComponents();
|
initComponents();
|
||||||
fcSelectDeck = new JFileChooser();
|
fcSelectDeck = new JFileChooser();
|
||||||
|
@ -86,7 +87,8 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
||||||
this.txtPlayerDeck.setText(file.getPath());
|
this.txtPlayerDeck.setText(file.getPath());
|
||||||
try {
|
try {
|
||||||
MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath());
|
MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath());
|
||||||
} catch (IOException ex) { }
|
} catch (IOException ex) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fcSelectDeck.setSelectedFile(null);
|
fcSelectDeck.setSelectedFile(null);
|
||||||
}
|
}
|
||||||
|
@ -111,9 +113,8 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
||||||
this.txtPlayerDeck.setText(deckFile);
|
this.txtPlayerDeck.setText(deckFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return (Integer)spnLevel.getValue();
|
return (Integer) spnLevel.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showLevel(boolean show) {
|
public void showLevel(boolean show) {
|
||||||
|
@ -128,10 +129,10 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
||||||
this.btnPlayerDeck.setVisible(show);
|
this.btnPlayerDeck.setVisible(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/**
|
||||||
* initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
* always regenerated by the Form Editor.
|
* regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
@ -211,7 +212,6 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
||||||
generateDeck();
|
generateDeck();
|
||||||
}//GEN-LAST:event_btnGenerateActionPerformed
|
}//GEN-LAST:event_btnGenerateActionPerformed
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton btnGenerate;
|
private javax.swing.JButton btnGenerate;
|
||||||
private javax.swing.JButton btnPlayerDeck;
|
private javax.swing.JButton btnPlayerDeck;
|
||||||
|
@ -237,10 +237,10 @@ class DeckFilter extends FileFilter {
|
||||||
String s = f.getName();
|
String s = f.getName();
|
||||||
int i = s.lastIndexOf('.');
|
int i = s.lastIndexOf('.');
|
||||||
|
|
||||||
if (i > 0 && i < s.length() - 1) {
|
if (i > 0 && i < s.length() - 1) {
|
||||||
ext = s.substring(i+1).toLowerCase();
|
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
return (ext==null)?false:ext.equals("dck");
|
return (ext == null) ? false : ext.equals("dck");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -248,4 +248,4 @@ class DeckFilter extends FileFilter {
|
||||||
return "Deck Files";
|
return "Deck Files";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
package mage.client.util;
|
package mage.client.util;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.Locale;
|
||||||
import mage.view.CardView;
|
import mage.view.CardView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +100,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
|
||||||
boolean whenYouCast = false;
|
boolean whenYouCast = false;
|
||||||
|
|
||||||
for (String str : card.getRules()) {
|
for (String str : card.getRules()) {
|
||||||
String s = str.toLowerCase();
|
String s = str.toLowerCase(Locale.ENGLISH);
|
||||||
annihilator |= s.contains("annihilator");
|
annihilator |= s.contains("annihilator");
|
||||||
anyNumberOfTarget |= s.contains("any number");
|
anyNumberOfTarget |= s.contains("any number");
|
||||||
buyback |= s.contains("buyback");
|
buyback |= s.contains("buyback");
|
||||||
|
@ -332,16 +333,16 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card.getCardTypes().contains("Plainswalker")) {
|
if (card.getCardTypes().contains("Plainswalker")) {
|
||||||
if (card.getName().toLowerCase().equals("jace, the mind sculptor")) {
|
if (card.getName().toLowerCase(Locale.ENGLISH).equals("jace, the mind sculptor")) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 6);
|
thisMaxPower = Math.max(thisMaxPower, 6);
|
||||||
}
|
}
|
||||||
if (card.getName().toLowerCase().equals("ugin, the spirit dragon")) {
|
if (card.getName().toLowerCase(Locale.ENGLISH).equals("ugin, the spirit dragon")) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 5);
|
thisMaxPower = Math.max(thisMaxPower, 5);
|
||||||
}
|
}
|
||||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
String cn = card.getName().toLowerCase();
|
String cn = card.getName().toLowerCase(Locale.ENGLISH);
|
||||||
if (cn.equals("ancient tomb")
|
if (cn.equals("ancient tomb")
|
||||||
|| cn.equals("anafenza, the foremost")
|
|| cn.equals("anafenza, the foremost")
|
||||||
|| cn.equals("arcum dagsson")
|
|| cn.equals("arcum dagsson")
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.client.util;
|
package mage.client.util;
|
||||||
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
package mage.client.util;
|
package mage.client.util;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Set;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.preference.MagePreferences;
|
import mage.client.preference.MagePreferences;
|
||||||
import mage.view.ChatMessage;
|
import mage.view.ChatMessage;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public final class IgnoreList {
|
public final class IgnoreList {
|
||||||
|
|
||||||
private static final String USAGE = "<br/><font color=yellow>\\ignore - shows current ignore list on this server."
|
private static final String USAGE = "<br/><font color=yellow>\\ignore - shows current ignore list on this server."
|
||||||
|
@ -15,8 +14,8 @@ public final class IgnoreList {
|
||||||
+ "<br/>\\unignore [username] - remove a username from your ignore list on this server.</font>";
|
+ "<br/>\\unignore [username] - remove a username from your ignore list on this server.</font>";
|
||||||
|
|
||||||
public static final int MAX_IGNORE_LIST_SIZE = 50;
|
public static final int MAX_IGNORE_LIST_SIZE = 50;
|
||||||
public static Set<ChatMessage.MessageType> IGNORED_MESSAGE_TYPES =
|
public static Set<ChatMessage.MessageType> IGNORED_MESSAGE_TYPES
|
||||||
ImmutableSet.of(ChatMessage.MessageType.TALK,
|
= ImmutableSet.of(ChatMessage.MessageType.TALK,
|
||||||
ChatMessage.MessageType.WHISPER_FROM);
|
ChatMessage.MessageType.WHISPER_FROM);
|
||||||
|
|
||||||
public static String usage() {
|
public static String usage() {
|
||||||
|
@ -45,22 +44,13 @@ public final class IgnoreList {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userIsIgnored(serverAddress, user)) {
|
if (userIsIgnored(serverAddress, user)) {
|
||||||
return new StringBuilder()
|
return user + " is already on your ignore list on " + serverAddress;
|
||||||
.append(user)
|
|
||||||
.append(" is already on your ignore list on ")
|
|
||||||
.append(serverAddress)
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MagePreferences.addIgnoredUser(serverAddress, user);
|
MagePreferences.addIgnoredUser(serverAddress, user);
|
||||||
updateTablesTable();
|
updateTablesTable();
|
||||||
|
|
||||||
return new StringBuilder()
|
return "Added " + user + " to your ignore list on " + serverAddress;
|
||||||
.append("Added ")
|
|
||||||
.append(user)
|
|
||||||
.append(" to your ignore list on ")
|
|
||||||
.append(serverAddress)
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void updateTablesTable() {
|
private static void updateTablesTable() {
|
||||||
|
@ -76,19 +66,9 @@ public final class IgnoreList {
|
||||||
}
|
}
|
||||||
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
if (MagePreferences.removeIgnoredUser(serverAddress, user)) {
|
||||||
updateTablesTable();
|
updateTablesTable();
|
||||||
return new StringBuilder()
|
return "Removed " + user + " from your ignore list on " + serverAddress;
|
||||||
.append("Removed ")
|
|
||||||
.append(user)
|
|
||||||
.append(" from your ignore list on ")
|
|
||||||
.append(serverAddress)
|
|
||||||
.toString();
|
|
||||||
} else {
|
} else {
|
||||||
return new StringBuilder()
|
return "No such user \"" + user + "\" on your ignore list on " + serverAddress;
|
||||||
.append("No such user \"")
|
|
||||||
.append(user)
|
|
||||||
.append("\" on your ignore list on ")
|
|
||||||
.append(serverAddress)
|
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package mage.client.util.audio;
|
||||||
|
|
||||||
import java.awt.List;
|
import java.awt.List;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import javax.sound.sampled.*;
|
import javax.sound.sampled.*;
|
||||||
import mage.client.constants.Constants;
|
import mage.client.constants.Constants;
|
||||||
|
@ -38,7 +39,7 @@ public class MusicPlayer {
|
||||||
}
|
}
|
||||||
String filename;
|
String filename;
|
||||||
for (File f : fileread) {
|
for (File f : fileread) {
|
||||||
filename = f.getName().toLowerCase();
|
filename = f.getName().toLowerCase(Locale.ENGLISH);
|
||||||
if (filename.endsWith(".mp3") || filename.endsWith(".wav")) {
|
if (filename.endsWith(".mp3") || filename.endsWith(".wav")) {
|
||||||
filelist.add(filename);
|
filelist.add(filename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.awt.FlowLayout;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
@ -77,7 +78,7 @@ public class ColorsChooser extends JComboBox implements ListCellRenderer {
|
||||||
|
|
||||||
private void drawOn(JPanel panel, String value) {
|
private void drawOn(JPanel panel, String value) {
|
||||||
List<Image> images = new ArrayList<>();
|
List<Image> images = new ArrayList<>();
|
||||||
value = value.toUpperCase();
|
value = value.toUpperCase(Locale.ENGLISH);
|
||||||
for (int i = 0; i < value.length(); i++) {
|
for (int i = 0; i < value.length(); i++) {
|
||||||
char symbol = value.charAt(i);
|
char symbol = value.charAt(i);
|
||||||
Image image = ManaSymbols.getSizedManaSymbol(String.valueOf(symbol));
|
Image image = ManaSymbols.getSizedManaSymbol(String.valueOf(symbol));
|
||||||
|
|
|
@ -2,6 +2,7 @@ package mage.client.util.gui;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Locale;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
|
@ -65,7 +66,7 @@ public final class GuiDisplayUtil {
|
||||||
out.append(c);
|
out.append(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out.toString().toLowerCase();
|
return out.toString().toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void keepComponentInsideScreen(int centerX, int centerY, Component component) {
|
public static void keepComponentInsideScreen(int centerX, int centerY, Component component) {
|
||||||
|
@ -256,7 +257,7 @@ public final class GuiDisplayUtil {
|
||||||
rarity = card.getRarity().getCode();
|
rarity = card.getRarity().getCode();
|
||||||
}
|
}
|
||||||
if (card.getExpansionSetCode() != null) {
|
if (card.getExpansionSetCode() != null) {
|
||||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity, GUISizeHelper.symbolTooltipSize));
|
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(Locale.ENGLISH), rarity, GUISizeHelper.symbolTooltipSize));
|
||||||
}
|
}
|
||||||
buffer.append("</td></tr></table>");
|
buffer.append("</td></tr></table>");
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -9,16 +9,13 @@ import mage.view.CardView;
|
||||||
import mage.view.CounterView;
|
import mage.view.CounterView;
|
||||||
import mage.view.PermanentView;
|
import mage.view.PermanentView;
|
||||||
import mage.view.StackAbilityView;
|
import mage.view.StackAbilityView;
|
||||||
import net.java.truevfs.access.TFile;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.jdesktop.swingx.graphics.GraphicsUtilities;
|
import org.jdesktop.swingx.graphics.GraphicsUtilities;
|
||||||
import org.mage.plugins.card.dl.sources.DirectLinksForDownload;
|
|
||||||
import org.mage.plugins.card.images.ImageCache;
|
import org.mage.plugins.card.images.ImageCache;
|
||||||
import mage.client.constants.Constants;
|
import mage.client.constants.Constants;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,7 @@ public abstract class CardRenderer {
|
||||||
/*
|
/*
|
||||||
// Just draw the as a code
|
// Just draw the as a code
|
||||||
String code = cardView.getExpansionSetCode();
|
String code = cardView.getExpansionSetCode();
|
||||||
code = (code != null) ? code.toUpperCase() : "";
|
code = (code != null) ? code.toUpperCase(Locale.ENGLISH) : "";
|
||||||
FontMetrics metrics = g.getFontMetrics();
|
FontMetrics metrics = g.getFontMetrics();
|
||||||
setSymbolWidth = metrics.stringWidth(code);
|
setSymbolWidth = metrics.stringWidth(code);
|
||||||
if (cardView.getRarity() == Rarity.COMMON) {
|
if (cardView.getRarity() == Rarity.COMMON) {
|
||||||
|
|
|
@ -554,8 +554,8 @@ public final class ManaSymbols {
|
||||||
public static void draw(Graphics g, String manaCost, int x, int y, int symbolWidth, Color symbolsTextColor, int symbolMarginX) {
|
public static void draw(Graphics g, String manaCost, int x, int y, int symbolWidth, Color symbolsTextColor, int symbolMarginX) {
|
||||||
if (!manaImages.containsKey(symbolWidth)) {
|
if (!manaImages.containsKey(symbolWidth)) {
|
||||||
loadSymbolImages(symbolWidth);
|
loadSymbolImages(symbolWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: replace with jlabel render (look at table rendere)?
|
// TODO: replace with jlabel render (look at table rendere)?
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -605,12 +605,16 @@ public final class ManaSymbols {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
manaCost = manaCost.replace("\\", "");
|
manaCost = manaCost.replace("\\", "");
|
||||||
manaCost = UI.getDisplayManaCost(manaCost);
|
manaCost = UI.getDisplayManaCost(manaCost);
|
||||||
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
||||||
while (tok.hasMoreTokens()) {
|
while (tok.hasMoreTokens()) {
|
||||||
String symbol = tok.nextToken();
|
String symbol = tok.nextToken();
|
||||||
Image image = sizedSymbols.get(symbol);
|
Image image = sizedSymbols.get(symbol);
|
||||||
|
if (image == null && symbol != null && symbol.length() == 2) {
|
||||||
|
String symbol2 = "" + symbol.charAt(1) + symbol.charAt(0);
|
||||||
|
image = sizedSymbols.get(symbol2);
|
||||||
|
}
|
||||||
|
|
||||||
if (image == null) {
|
if (image == null) {
|
||||||
// TEXT draw
|
// TEXT draw
|
||||||
|
|
|
@ -34,6 +34,7 @@ import mage.util.SubTypeList;
|
||||||
import mage.view.CardView;
|
import mage.view.CardView;
|
||||||
import mage.view.PermanentView;
|
import mage.view.PermanentView;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
import static org.mage.card.arcane.ManaSymbols.getSizedManaSymbol;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -72,13 +73,13 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
BufferedImage img = CardRendererUtils.toBufferedImage(icon.getImage());
|
BufferedImage img = CardRendererUtils.toBufferedImage(icon.getImage());
|
||||||
return new TexturePaint(img, new Rectangle(0, 0, img.getWidth(), img.getHeight()));
|
return new TexturePaint(img, new Rectangle(0, 0, img.getWidth(), img.getHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BufferedImage loadBackgroundImage(String name) {
|
private static BufferedImage loadBackgroundImage(String name) {
|
||||||
URL url = ModernCardRenderer.class.getResource("/cardrender/background_texture_" + name + ".png");
|
URL url = ModernCardRenderer.class.getResource("/cardrender/background_texture_" + name + ".png");
|
||||||
ImageIcon icon = new ImageIcon(url);
|
ImageIcon icon = new ImageIcon(url);
|
||||||
BufferedImage img = CardRendererUtils.toBufferedImage(icon.getImage());
|
BufferedImage img = CardRendererUtils.toBufferedImage(icon.getImage());
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BufferedImage loadFramePart(String name) {
|
private static BufferedImage loadFramePart(String name) {
|
||||||
URL url = ModernCardRenderer.class.getResource("/cardrender/" + name + ".png");
|
URL url = ModernCardRenderer.class.getResource("/cardrender/" + name + ".png");
|
||||||
|
@ -108,7 +109,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
public static final Paint BG_TEXTURE_ARTIFACT = loadBackgroundTexture("artifact");
|
public static final Paint BG_TEXTURE_ARTIFACT = loadBackgroundTexture("artifact");
|
||||||
public static final Paint BG_TEXTURE_LAND = loadBackgroundTexture("land");
|
public static final Paint BG_TEXTURE_LAND = loadBackgroundTexture("land");
|
||||||
public static final Paint BG_TEXTURE_VEHICLE = loadBackgroundTexture("vehicle");
|
public static final Paint BG_TEXTURE_VEHICLE = loadBackgroundTexture("vehicle");
|
||||||
|
|
||||||
public static final BufferedImage BG_IMG_WHITE = loadBackgroundImage("white");
|
public static final BufferedImage BG_IMG_WHITE = loadBackgroundImage("white");
|
||||||
public static final BufferedImage BG_IMG_BLUE = loadBackgroundImage("blue");
|
public static final BufferedImage BG_IMG_BLUE = loadBackgroundImage("blue");
|
||||||
public static final BufferedImage BG_IMG_BLACK = loadBackgroundImage("black");
|
public static final BufferedImage BG_IMG_BLACK = loadBackgroundImage("black");
|
||||||
|
@ -119,7 +120,8 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
public static final BufferedImage BG_IMG_LAND = loadBackgroundImage("land");
|
public static final BufferedImage BG_IMG_LAND = loadBackgroundImage("land");
|
||||||
public static final BufferedImage BG_IMG_VEHICLE = loadBackgroundImage("vehicle");
|
public static final BufferedImage BG_IMG_VEHICLE = loadBackgroundImage("vehicle");
|
||||||
public static final BufferedImage BG_IMG_COLORLESS = loadBackgroundImage("colorless");
|
public static final BufferedImage BG_IMG_COLORLESS = loadBackgroundImage("colorless");
|
||||||
|
public static final BufferedImage BG_IMG_EXPEDITION = loadBackgroundImage("expedition");
|
||||||
|
|
||||||
public static final BufferedImage FRAME_INVENTION = loadFramePart("invention_frame");
|
public static final BufferedImage FRAME_INVENTION = loadFramePart("invention_frame");
|
||||||
|
|
||||||
public static final Color BORDER_WHITE = new Color(216, 203, 188);
|
public static final Color BORDER_WHITE = new Color(216, 203, 188);
|
||||||
|
@ -142,6 +144,12 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
public static final Color BOX_INVENTION = new Color(209, 97, 33);
|
public static final Color BOX_INVENTION = new Color(209, 97, 33);
|
||||||
public static final Color BOX_VEHICLE = new Color(155, 105, 60);
|
public static final Color BOX_VEHICLE = new Color(155, 105, 60);
|
||||||
|
|
||||||
|
public static final Color BOX_UST_WHITE = new Color(240, 240, 220);
|
||||||
|
public static final Color BOX_UST_BLUE = new Color(10, 100, 180);
|
||||||
|
public static final Color BOX_UST_BLACK = new Color(28, 30, 28);
|
||||||
|
public static final Color BOX_UST_RED = new Color(229, 74, 32);
|
||||||
|
public static final Color BOX_UST_GREEN = new Color(7, 130, 53);
|
||||||
|
|
||||||
public static final Color BOX_WHITE_NIGHT = new Color(169, 160, 145);
|
public static final Color BOX_WHITE_NIGHT = new Color(169, 160, 145);
|
||||||
public static final Color BOX_BLUE_NIGHT = new Color(46, 133, 176);
|
public static final Color BOX_BLUE_NIGHT = new Color(46, 133, 176);
|
||||||
public static final Color BOX_BLACK_NIGHT = new Color(95, 90, 89);
|
public static final Color BOX_BLACK_NIGHT = new Color(95, 90, 89);
|
||||||
|
@ -301,7 +309,15 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
// Just draw a brown rectangle
|
// Just draw a brown rectangle
|
||||||
drawCardBack(g);
|
drawCardBack(g);
|
||||||
} else {
|
} else {
|
||||||
BufferedImage bg = getBackgroundImage(cardView.getColor(), cardView.getCardTypes(), cardView.getSubTypes());
|
if (cardView.getFrameStyle() == FrameStyle.UST_FULL_ART_BASIC) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isExped = false;
|
||||||
|
if (cardView.getExpansionSetCode().equals("EXP")) {
|
||||||
|
isExped = true;
|
||||||
|
}
|
||||||
|
BufferedImage bg = getBackgroundImage(cardView.getColor(), cardView.getCardTypes(), cardView.getSubTypes(), isExped);
|
||||||
if (bg == null) {
|
if (bg == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -318,12 +334,12 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
cardWidth - borderWidth * 2, cornerRadius * 4,
|
cardWidth - borderWidth * 2, cornerRadius * 4,
|
||||||
cornerRadius * 2, cornerRadius * 2);
|
cornerRadius * 2, cornerRadius * 2);
|
||||||
a.add(new Area(rr2));
|
a.add(new Area(rr2));
|
||||||
|
|
||||||
// Draw the M15 rounded "swoosh" at the bottom
|
// Draw the M15 rounded "swoosh" at the bottom
|
||||||
Rectangle r = new Rectangle(borderWidth + contentInset, cardHeight - borderWidth * 5, cardWidth - borderWidth * 2 - contentInset * 2, borderWidth * 2);
|
Rectangle r = new Rectangle(borderWidth + contentInset, cardHeight - borderWidth * 5, cardWidth - borderWidth * 2 - contentInset * 2, borderWidth * 2);
|
||||||
a.add(new Area(r));
|
a.add(new Area(r));
|
||||||
g.setClip(a);
|
g.setClip(a);
|
||||||
g.drawImage(bg, 0, 0, cardWidth, cardHeight, 0, 0, bgw, bgh, BOX_BLUE, null);
|
g.drawImage(bg, 0, 0, cardWidth, cardHeight, 0, 0, bgw, bgh, BOX_BLUE, null);
|
||||||
g.setClip(null);
|
g.setClip(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -339,6 +355,8 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
rect = new Rectangle2D.Float(0, 0, 1, 1);
|
rect = new Rectangle2D.Float(0, 0, 1, 1);
|
||||||
} else if (isZendikarFullArtLand()) {
|
} else if (isZendikarFullArtLand()) {
|
||||||
rect = new Rectangle2D.Float(.079f, .11f, .84f, .84f);
|
rect = new Rectangle2D.Float(.079f, .11f, .84f, .84f);
|
||||||
|
} else if (isUnstableFullArtLand()) {
|
||||||
|
rect = new Rectangle2D.Float(.0f, .0f, 1.0f, 1.0f);
|
||||||
} else if (cardView.getFrameStyle().isFullArt() || (cardView.isToken())) {
|
} else if (cardView.getFrameStyle().isFullArt() || (cardView.isToken())) {
|
||||||
rect = new Rectangle2D.Float(.079f, .11f, .84f, .63f);
|
rect = new Rectangle2D.Float(.079f, .11f, .84f, .63f);
|
||||||
} else {
|
} else {
|
||||||
|
@ -361,6 +379,10 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
return cardView.getFrameStyle() == FrameStyle.BFZ_FULL_ART_BASIC || cardView.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC;
|
return cardView.getFrameStyle() == FrameStyle.BFZ_FULL_ART_BASIC || cardView.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isUnstableFullArtLand() {
|
||||||
|
return cardView.getFrameStyle() == FrameStyle.UST_FULL_ART_BASIC;
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean isSourceArtFullArt() {
|
protected boolean isSourceArtFullArt() {
|
||||||
int color = artImage.getRGB(0, artImage.getHeight() / 2);
|
int color = artImage.getRGB(0, artImage.getHeight() / 2);
|
||||||
return (((color & 0x00FF0000) > 0x00200000)
|
return (((color & 0x00FF0000) > 0x00200000)
|
||||||
|
@ -442,6 +464,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
|
|
||||||
// Get the border paint
|
// Get the border paint
|
||||||
Color boxColor = getBoxColor(frameColors, cardView.getCardTypes(), isTransformed);
|
Color boxColor = getBoxColor(frameColors, cardView.getCardTypes(), isTransformed);
|
||||||
|
Color additionalBoxColor = getAdditionalBoxColor(frameColors, cardView.getCardTypes(), isTransformed);
|
||||||
Paint textboxPaint = getTextboxPaint(frameColors, cardView.getCardTypes(), cardWidth);
|
Paint textboxPaint = getTextboxPaint(frameColors, cardView.getCardTypes(), cardWidth);
|
||||||
Paint borderPaint = getBorderPaint(frameColors, cardView.getCardTypes(), cardWidth);
|
Paint borderPaint = getBorderPaint(frameColors, cardView.getCardTypes(), cardWidth);
|
||||||
|
|
||||||
|
@ -450,6 +473,9 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
boxColor = BOX_INVENTION;
|
boxColor = BOX_INVENTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Is this a Zendikar or Unstable land
|
||||||
|
boolean isZenUst = isZendikarFullArtLand() || isUnstableFullArtLand();
|
||||||
|
|
||||||
// Draw the main card content border
|
// Draw the main card content border
|
||||||
g.setPaint(borderPaint);
|
g.setPaint(borderPaint);
|
||||||
|
|
||||||
|
@ -458,7 +484,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
g.drawRect(
|
g.drawRect(
|
||||||
totalContentInset, typeLineY,
|
totalContentInset, typeLineY,
|
||||||
contentWidth - 1, cardHeight - borderWidth * 3 - typeLineY - 1);
|
contentWidth - 1, cardHeight - borderWidth * 3 - typeLineY - 1);
|
||||||
} else if (!isZendikarFullArtLand()) {
|
} else if (!isZenUst) {
|
||||||
g.drawRect(
|
g.drawRect(
|
||||||
totalContentInset, totalContentInset,
|
totalContentInset, totalContentInset,
|
||||||
contentWidth - 1, cardHeight - borderWidth * 3 - totalContentInset - 1);
|
contentWidth - 1, cardHeight - borderWidth * 3 - totalContentInset - 1);
|
||||||
|
@ -471,7 +497,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
g.setPaint(textboxPaint);
|
g.setPaint(textboxPaint);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isZendikarFullArtLand()) {
|
if (!isZenUst) {
|
||||||
g.fillRect(
|
g.fillRect(
|
||||||
totalContentInset + 1, typeLineY,
|
totalContentInset + 1, typeLineY,
|
||||||
contentWidth - 2, cardHeight - borderWidth * 3 - typeLineY - 1);
|
contentWidth - 2, cardHeight - borderWidth * 3 - typeLineY - 1);
|
||||||
|
@ -485,7 +511,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
cardWidth / 16, cardHeight - typeLineY - boxHeight - borderWidth * 3);
|
cardWidth / 16, cardHeight - typeLineY - boxHeight - borderWidth * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cardView.getFrameStyle() != FrameStyle.KLD_INVENTION && !isZendikarFullArtLand()) {
|
if (cardView.getFrameStyle() != FrameStyle.KLD_INVENTION && !isZenUst) {
|
||||||
// Draw a shadow highlight at the right edge of the content frame
|
// Draw a shadow highlight at the right edge of the content frame
|
||||||
g.setColor(new Color(0, 0, 0, 100));
|
g.setColor(new Color(0, 0, 0, 100));
|
||||||
g.fillRect(
|
g.fillRect(
|
||||||
|
@ -505,7 +531,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
contentInset,
|
contentInset,
|
||||||
borderPaint, boxColor);
|
borderPaint, boxColor);
|
||||||
// Draw the type line box
|
// Draw the type line box
|
||||||
if (!isZendikarFullArtLand()) {
|
if (!isZenUst) {
|
||||||
CardRendererUtils.drawRoundedBox(g,
|
CardRendererUtils.drawRoundedBox(g,
|
||||||
borderWidth, typeLineY,
|
borderWidth, typeLineY,
|
||||||
cardWidth - 2 * borderWidth, boxHeight,
|
cardWidth - 2 * borderWidth, boxHeight,
|
||||||
|
@ -542,27 +568,12 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
contentWidth - nameOffset, boxHeight);
|
contentWidth - nameOffset, boxHeight);
|
||||||
|
|
||||||
// Draw the textbox rules
|
// Draw the textbox rules
|
||||||
if (!isZendikarFullArtLand()) {
|
if (isZendikarFullArtLand()) {
|
||||||
drawRulesText(g, textboxKeywords, textboxRules,
|
|
||||||
totalContentInset + 2, typeLineY + boxHeight + 2,
|
|
||||||
contentWidth - 4, cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3);
|
|
||||||
} else {
|
|
||||||
int x = totalContentInset;
|
int x = totalContentInset;
|
||||||
int y = typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset;
|
int y = typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset;
|
||||||
int w = contentWidth;
|
int w = contentWidth;
|
||||||
int h = boxHeight - 4;
|
int h = boxHeight - 4;
|
||||||
|
|
||||||
CardRendererUtils.drawZendikarLandBox(g,
|
|
||||||
x, y, w, h,
|
|
||||||
contentInset,
|
|
||||||
borderPaint, boxColor);
|
|
||||||
drawTypeLine(g, getCardSuperTypeLine(),
|
|
||||||
totalContentInset + contentInset, typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset,
|
|
||||||
contentWidth / 2 - boxHeight, boxHeight - 4, false);
|
|
||||||
drawTypeLine(g, getCardSubTypeLine(),
|
|
||||||
totalContentInset + 4 * contentWidth / 7 + boxHeight, typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset,
|
|
||||||
3 * contentWidth / 7 - boxHeight - contentInset, boxHeight - 4, true);
|
|
||||||
|
|
||||||
if (cardView.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC) {
|
if (cardView.getFrameStyle() == FrameStyle.ZEN_FULL_ART_BASIC) {
|
||||||
// Draw curved lines (old Zendikar land style) - bigger (around 6%) inset on curve on bottom than inset (around 4.5%) on top...
|
// Draw curved lines (old Zendikar land style) - bigger (around 6%) inset on curve on bottom than inset (around 4.5%) on top...
|
||||||
int x2 = x + contentWidth;
|
int x2 = x + contentWidth;
|
||||||
|
@ -584,9 +595,63 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
boxColor, borderPaint);
|
boxColor, borderPaint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If an expedition, needs the rules box to be visible.
|
||||||
|
if (cardView.getExpansionSetCode().equals("EXP")) {
|
||||||
|
// Draw a small separator between the type line and box, and shadow
|
||||||
|
// at the left of the texbox, and above the name line
|
||||||
|
g.setPaint(textboxPaint);
|
||||||
|
float alpha = 0.55f;
|
||||||
|
AlphaComposite comp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha);
|
||||||
|
Composite origc = g.getComposite();
|
||||||
|
g.setComposite(comp);
|
||||||
|
g.setBackground(new Color(155, 0, 0, 150));
|
||||||
|
|
||||||
|
g.fillRect(
|
||||||
|
totalContentInset + 1, typeLineY - boxHeight,
|
||||||
|
contentWidth - 2, cardHeight - borderWidth * 3 - typeLineY - 1);
|
||||||
|
|
||||||
|
g.setComposite(origc);
|
||||||
|
|
||||||
|
g.fillRect(
|
||||||
|
totalContentInset - 1, totalContentInset - 1,
|
||||||
|
contentWidth + 1, 1);
|
||||||
|
|
||||||
|
g.fillRect(
|
||||||
|
totalContentInset + 1, typeLineY - boxHeight,
|
||||||
|
contentWidth - 2, 1);
|
||||||
|
|
||||||
|
drawRulesText(g, textboxKeywords, textboxRules,
|
||||||
|
totalContentInset + 2, typeLineY - boxHeight,
|
||||||
|
contentWidth - 4, cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
CardRendererUtils.drawZendikarLandBox(g,
|
||||||
|
x, y, w, h,
|
||||||
|
contentInset,
|
||||||
|
borderPaint, boxColor);
|
||||||
|
drawTypeLine(g, getCardSuperTypeLine(),
|
||||||
|
totalContentInset + contentInset, typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset,
|
||||||
|
contentWidth / 2 - boxHeight, boxHeight - 4, false);
|
||||||
|
drawTypeLine(g, getCardSubTypeLine(),
|
||||||
|
totalContentInset + 4 * contentWidth / 7 + boxHeight, typeLineY + boxHeight + (cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3) / 2 - contentInset,
|
||||||
|
3 * contentWidth / 7 - boxHeight - contentInset, boxHeight - 4, true);
|
||||||
drawRulesText(g, textboxKeywords, textboxRules,
|
drawRulesText(g, textboxKeywords, textboxRules,
|
||||||
x, y,
|
x, y,
|
||||||
w, h);
|
w, h, false);
|
||||||
|
} else if (isUnstableFullArtLand()) {
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
int w = cardWidth;
|
||||||
|
int h = cardHeight;
|
||||||
|
|
||||||
|
// Curve ends at 60 out of 265
|
||||||
|
drawUSTCurves(g, image, x, y, w, h,
|
||||||
|
0, 0,
|
||||||
|
additionalBoxColor, borderPaint);
|
||||||
|
} else if (!isZenUst) {
|
||||||
|
drawRulesText(g, textboxKeywords, textboxRules,
|
||||||
|
totalContentInset + 2, typeLineY + boxHeight + 2,
|
||||||
|
contentWidth - 4, cardHeight - typeLineY - boxHeight - 4 - borderWidth * 3, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the bottom right stuff
|
// Draw the bottom right stuff
|
||||||
|
@ -698,6 +763,82 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
g2.draw(innercurve);
|
g2.draw(innercurve);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void drawUSTCurves(Graphics2D g2, BufferedImage image, int x, int y, int x2, int y2,
|
||||||
|
int topxdelta, int endydelta,
|
||||||
|
Color boxColor, Paint paint) {
|
||||||
|
BufferedImage artToUse = artImage;
|
||||||
|
|
||||||
|
int srcW = x2;
|
||||||
|
int srcH = y2;
|
||||||
|
if (artToUse != null) {
|
||||||
|
srcW = artToUse.getWidth();
|
||||||
|
srcH = artToUse.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
g2.setPaint(paint);
|
||||||
|
|
||||||
|
// Dimensions: 534 height, 384 width, 34 offset at top, 41 offset at bottom. Curve at bottom right is from an ellipse: 245 high, 196 wide, with center offset from
|
||||||
|
// right side by 36 (so top left is at: (width - 159, height - 41 -196) center at: 41+127 = width - 36, height - 168)
|
||||||
|
int scan_width = 384;
|
||||||
|
int scan_height = 534;
|
||||||
|
int scan_ew = 196;
|
||||||
|
int scan_eh = 254;
|
||||||
|
int offset_ew = 159;
|
||||||
|
int offset_eh = 41;
|
||||||
|
int middle_ew = 52;
|
||||||
|
int middle_eh = 26;
|
||||||
|
|
||||||
|
// Bottom left side arc
|
||||||
|
int ex = (offset_ew - scan_ew) * x2 / scan_width;
|
||||||
|
int ey = y2 - (offset_eh + scan_eh) * y2 / scan_height;
|
||||||
|
int bot_ey = y2 - offset_eh * y2 / scan_height;
|
||||||
|
int ew = scan_ew * x2 / scan_width;
|
||||||
|
int eh = scan_eh * y2 / scan_height;
|
||||||
|
int end_curve_ex = ex + ew / 2;
|
||||||
|
|
||||||
|
Arc2D arc = new Arc2D.Double(ex, ey, ew, eh, 180, 90, Arc2D.OPEN);
|
||||||
|
|
||||||
|
// Bottom right side arc
|
||||||
|
ex = x2 - offset_ew * x2 / scan_width;
|
||||||
|
ey = y2 - (offset_eh + scan_eh) * y2 / scan_height;
|
||||||
|
bot_ey = y2 - offset_eh * y2 / scan_height;
|
||||||
|
Arc2D arc2 = new Arc2D.Double(ex, ey, ew, eh, 270, 90, Arc2D.OPEN);
|
||||||
|
|
||||||
|
// Middle bump.. 52x26
|
||||||
|
int mid_ex = x2 / 2 - middle_ew * x2 / (scan_width * 2);
|
||||||
|
int mid_ey = bot_ey - middle_eh * y2 / (scan_height * 2);
|
||||||
|
int end_mid_ex = x2 / 2 + middle_ew * x2 / (scan_width * 2);
|
||||||
|
|
||||||
|
Arc2D arc3 = new Arc2D.Double(mid_ex, mid_ey, middle_ew * x2 / scan_width, middle_eh * y2 / scan_height, 180, -180, Arc2D.OPEN);
|
||||||
|
|
||||||
|
Path2D.Double curve = new Path2D.Double();
|
||||||
|
curve.moveTo(0, 0);
|
||||||
|
curve.lineTo(0, bot_ey);
|
||||||
|
curve.append(arc, true);
|
||||||
|
curve.lineTo(mid_ex, bot_ey);
|
||||||
|
curve.append(arc3, true);
|
||||||
|
curve.lineTo(x2 - ew / 2, bot_ey);
|
||||||
|
curve.append(arc2, true);
|
||||||
|
curve.lineTo(x2, 0);
|
||||||
|
curve.lineTo(0, 0);
|
||||||
|
|
||||||
|
g2.setClip(curve);
|
||||||
|
if (artToUse != null) {
|
||||||
|
artToUse = artImage.getSubimage(0, 0, srcW, srcH);
|
||||||
|
g2.drawImage(artToUse, 0, 0, x2, y2, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
g2.setClip(null);
|
||||||
|
g2.setStroke(new BasicStroke(3));
|
||||||
|
g2.draw(arc);
|
||||||
|
g2.draw(new Rectangle(end_curve_ex, bot_ey, mid_ex - end_curve_ex, 0));
|
||||||
|
g2.draw(arc3);
|
||||||
|
g2.draw(new Rectangle(end_mid_ex, bot_ey, mid_ex - end_curve_ex, 0));
|
||||||
|
g2.draw(arc2);
|
||||||
|
g2.setStroke(new BasicStroke(1));
|
||||||
|
g2.setColor(boxColor);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw the name line
|
// Draw the name line
|
||||||
protected void drawNameLine(Graphics2D g, String baseName, String manaCost, int x, int y, int w, int h) {
|
protected void drawNameLine(Graphics2D g, String baseName, String manaCost, int x, int y, int w, int h) {
|
||||||
// Width of the mana symbols
|
// Width of the mana symbols
|
||||||
|
@ -962,7 +1103,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawRulesText(Graphics2D g, ArrayList<TextboxRule> keywords, ArrayList<TextboxRule> rules, int x, int y, int w, int h) {
|
protected void drawRulesText(Graphics2D g, ArrayList<TextboxRule> keywords, ArrayList<TextboxRule> rules, int x, int y, int w, int h, boolean forceRules) {
|
||||||
// Gather all rules to render
|
// Gather all rules to render
|
||||||
List<TextboxRule> allRules = new ArrayList<>(rules);
|
List<TextboxRule> allRules = new ArrayList<>(rules);
|
||||||
|
|
||||||
|
@ -973,15 +1114,23 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
allRules.add(0, keywordsRule);
|
allRules.add(0, keywordsRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isUnstableFullArtLand()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Basic mana draw mana symbol in textbox (for basic lands)
|
// Basic mana draw mana symbol in textbox (for basic lands)
|
||||||
if (allRules.size() == 1 && (allRules.get(0) instanceof TextboxBasicManaRule) && cardView.isLand() || isZendikarFullArtLand()) {
|
if (!forceRules && (allRules.size() == 1 && (allRules.get(0) instanceof TextboxBasicManaRule) && cardView.isLand() || isZendikarFullArtLand())) {
|
||||||
if (!isZendikarFullArtLand()) {
|
if (!isZendikarFullArtLand()) {
|
||||||
drawBasicManaTextbox(g, x, y, w, h, ((TextboxBasicManaRule) allRules.get(0)).getBasicManaSymbol());
|
drawBasicManaTextbox(g, x, y, w, h, ((TextboxBasicManaRule) allRules.get(0)).getBasicManaSymbol());
|
||||||
return;
|
return;
|
||||||
} else // Big circle in the middle for Zendikar lands
|
} else // Big circle in the middle for Zendikar lands
|
||||||
if (allRules.size() == 1) {
|
if (allRules.size() == 1) {
|
||||||
// Size of mana symbol = 9/4 * h, 3/4h above line
|
// Size of mana symbol = 9/4 * h, 3/4h above line
|
||||||
drawBasicManaSymbol(g, x + w / 2 - 9 * h / 8 + 1, y - 3 * h / 4, 9 * h / 4, 9 * h / 4, ((TextboxBasicManaRule) allRules.get(0)).getBasicManaSymbol());
|
if (allRules.get(0) instanceof TextboxBasicManaRule) {
|
||||||
|
drawBasicManaSymbol(g, x + w / 2 - 9 * h / 8 + 1, y - 3 * h / 4, 9 * h / 4, 9 * h / 4, ((TextboxBasicManaRule) allRules.get(0)).getBasicManaSymbol());
|
||||||
|
} else {
|
||||||
|
drawBasicManaSymbol(g, x + w / 2 - h - h / 8, y - 3 * h / 4, 9 * h / 4, 9 * h / 4, cardView.getFrameColor().toString());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (allRules.size() > 1) {
|
if (allRules.size() > 1) {
|
||||||
|
@ -1043,7 +1192,15 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
|
|
||||||
private void drawBasicManaSymbol(Graphics2D g, int x, int y, int w, int h, String symbol) {
|
private void drawBasicManaSymbol(Graphics2D g, int x, int y, int w, int h, String symbol) {
|
||||||
String symbs = symbol;
|
String symbs = symbol;
|
||||||
ManaSymbols.draw(g, symbs, x, y, w, Color.black, 2);
|
if (getSizedManaSymbol(symbol) != null) {
|
||||||
|
ManaSymbols.draw(g, symbs, x, y, w, Color.black, 2);
|
||||||
|
}
|
||||||
|
if (symbol.length() == 2) {
|
||||||
|
String symbs2 = "" + symbol.charAt(1) + symbol.charAt(0);
|
||||||
|
if (getSizedManaSymbol(symbs2) != null) {
|
||||||
|
ManaSymbols.draw(g, symbs2, x, y, w, Color.black, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the first line of the textbox, the keyword string
|
// Get the first line of the textbox, the keyword string
|
||||||
|
@ -1272,13 +1429,16 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
return new Color(71, 86, 101);
|
return new Color(71, 86, 101);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine which background image to use from a set of colors
|
// Determine which background image to use from a set of colors
|
||||||
// and the current card.
|
// and the current card.
|
||||||
protected static BufferedImage getBackgroundImage(ObjectColor colors, Collection<CardType> types, SubTypeList subTypes) {
|
protected static BufferedImage getBackgroundImage(ObjectColor colors, Collection<CardType> types, SubTypeList subTypes, boolean isExped) {
|
||||||
if (subTypes.contains(SubType.VEHICLE)) {
|
if (subTypes.contains(SubType.VEHICLE)) {
|
||||||
return BG_IMG_VEHICLE;
|
return BG_IMG_VEHICLE;
|
||||||
} else if (types.contains(CardType.LAND)) {
|
} else if (types.contains(CardType.LAND)) {
|
||||||
|
if (isExped) {
|
||||||
|
return BG_IMG_EXPEDITION;
|
||||||
|
}
|
||||||
return BG_IMG_LAND;
|
return BG_IMG_LAND;
|
||||||
} else if (types.contains(CardType.ARTIFACT)) {
|
} else if (types.contains(CardType.ARTIFACT)) {
|
||||||
return BG_IMG_ARTIFACT;
|
return BG_IMG_ARTIFACT;
|
||||||
|
@ -1299,7 +1459,7 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
return BG_IMG_COLORLESS;
|
return BG_IMG_COLORLESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the box color for the given colors
|
// Get the box color for the given colors
|
||||||
protected Color getBoxColor(ObjectColor colors, Collection<CardType> types, boolean isNightCard) {
|
protected Color getBoxColor(ObjectColor colors, Collection<CardType> types, boolean isNightCard) {
|
||||||
if (cardView.isAbility()) {
|
if (cardView.isAbility()) {
|
||||||
|
@ -1332,6 +1492,23 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Color getAdditionalBoxColor(ObjectColor colors, Collection<CardType> types, boolean isNightCard) {
|
||||||
|
if (isUnstableFullArtLand()) {
|
||||||
|
if (colors.isWhite()) {
|
||||||
|
return BOX_UST_WHITE;
|
||||||
|
} else if (colors.isBlue()) {
|
||||||
|
return BOX_UST_BLUE;
|
||||||
|
} else if (colors.isBlack()) {
|
||||||
|
return BOX_UST_BLACK;
|
||||||
|
} else if (colors.isRed()) {
|
||||||
|
return BOX_UST_RED;
|
||||||
|
} else if (colors.isGreen()) {
|
||||||
|
return BOX_UST_GREEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getBoxColor(colors, types, isNightCard);
|
||||||
|
}
|
||||||
|
|
||||||
// Get the border color for a single color
|
// Get the border color for a single color
|
||||||
protected static Color getBorderColor(ObjectColor color) {
|
protected static Color getBorderColor(ObjectColor color) {
|
||||||
if (color.isWhite()) {
|
if (color.isWhite()) {
|
||||||
|
|
|
@ -272,7 +272,7 @@ public class ModernSplitCardRenderer extends ModernCardRenderer {
|
||||||
// Draw the textbox rules
|
// Draw the textbox rules
|
||||||
drawRulesText(g, half.keywords, half.rules,
|
drawRulesText(g, half.keywords, half.rules,
|
||||||
2, typeLineY + boxHeight + 2 - 4,
|
2, typeLineY + boxHeight + 2 - 4,
|
||||||
half.cw - 4, half.ch - typeLineY - boxHeight);
|
half.cw - 4, half.ch - typeLineY - boxHeight, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Graphics2D getUnmodifiedHalfContext(Graphics2D g) {
|
private Graphics2D getUnmodifiedHalfContext(Graphics2D g) {
|
||||||
|
|
|
@ -13,7 +13,6 @@ import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import mage.view.CardView;
|
import mage.view.CardView;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.log4j.jmx.LoggerDynamicMBean;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.net.InetAddress;
|
||||||
import java.net.NetworkInterface;
|
import java.net.NetworkInterface;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadFactory;
|
import java.util.concurrent.ThreadFactory;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
@ -16,8 +17,8 @@ import javax.swing.SwingUtilities;
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public final class Util {
|
public final class Util {
|
||||||
|
|
||||||
public static final boolean isMac = System.getProperty("os.name").toLowerCase().contains("mac");
|
public static final boolean isMac = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac");
|
||||||
public static final boolean isWindows = !System.getProperty("os.name").toLowerCase().contains("windows");
|
public static final boolean isWindows = !System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows");
|
||||||
|
|
||||||
public static final ThreadPoolExecutor threadPool;
|
public static final ThreadPoolExecutor threadPool;
|
||||||
static private int threadCount;
|
static private int threadCount;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.mage.plugins.card.dl.sources;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
|
@ -368,7 +369,7 @@ public enum MagicCardsImageSource implements CardImageSource {
|
||||||
String preferedLanguage = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PREF_LANGUAGE, "en");
|
String preferedLanguage = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PREF_LANGUAGE, "en");
|
||||||
|
|
||||||
StringBuilder url = new StringBuilder("http://magiccards.info/scans/").append(preferedLanguage).append('/');
|
StringBuilder url = new StringBuilder("http://magiccards.info/scans/").append(preferedLanguage).append('/');
|
||||||
url.append(set.toLowerCase()).append('/').append(collectorId);
|
url.append(set.toLowerCase(Locale.ENGLISH)).append('/').append(collectorId);
|
||||||
|
|
||||||
if (card.isTwoFacedCard()) {
|
if (card.isTwoFacedCard()) {
|
||||||
url.append(card.isSecondSide() ? "b" : "a");
|
url.append(card.isSecondSide() ? "b" : "a");
|
||||||
|
@ -395,7 +396,7 @@ public enum MagicCardsImageSource implements CardImageSource {
|
||||||
if (card.getType() > 0) {
|
if (card.getType() > 0) {
|
||||||
name = name + ' ' + card.getType();
|
name = name + ' ' + card.getType();
|
||||||
}
|
}
|
||||||
name = name.replaceAll(" ", "-").replace(",", "").toLowerCase();
|
name = name.replaceAll(" ", "-").replace(",", "").toLowerCase(Locale.ENGLISH);
|
||||||
String set = "not-supported-set";
|
String set = "not-supported-set";
|
||||||
if (setNameTokenReplacement.containsKey(card.getSet())) {
|
if (setNameTokenReplacement.containsKey(card.getSet())) {
|
||||||
set = setNameTokenReplacement.get(card.getSet());
|
set = setNameTokenReplacement.get(card.getSet());
|
||||||
|
|
|
@ -31,6 +31,7 @@ import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.mage.plugins.card.images.CardDownloadData;
|
import org.mage.plugins.card.images.CardDownloadData;
|
||||||
|
@ -257,7 +258,7 @@ public enum MagidexImageSource implements CardImageSource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String generateURL(CardDownloadData card) throws Exception {
|
public String generateURL(CardDownloadData card) throws Exception {
|
||||||
String cardDownloadName = card.getDownloadName().toLowerCase();
|
String cardDownloadName = card.getDownloadName().toLowerCase(Locale.ENGLISH);
|
||||||
String cardSet = card.getSet();
|
String cardSet = card.getSet();
|
||||||
|
|
||||||
if (cardDownloadName == null || cardSet == null) {
|
if (cardDownloadName == null || cardSet == null) {
|
||||||
|
|
|
@ -24,35 +24,34 @@
|
||||||
* 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 org.mage.plugins.card.dl.sources;
|
package org.mage.plugins.card.dl.sources;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
import org.mage.plugins.card.images.CardDownloadData;
|
import org.mage.plugins.card.images.CardDownloadData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Site was shutdown by wizards Feb. 2015
|
* Site was shutdown by wizards Feb. 2015
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
|
public enum MtgImageSource implements CardImageSource {
|
||||||
|
|
||||||
public enum MtgImageSource implements CardImageSource {
|
instance;
|
||||||
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSourceName() {
|
public String getSourceName() {
|
||||||
return "mtgimage.com";
|
return "mtgimage.com";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getNextHttpImageUrl() {
|
public String getNextHttpImageUrl() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFileForHttpImage(String httpImageUrl) {
|
public String getFileForHttpImage(String httpImageUrl) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -66,9 +65,9 @@ public enum MtgImageSource implements CardImageSource {
|
||||||
throw new Exception("Wrong parameters for image: collector id: " + collectorId + ",card set: " + cardSet);
|
throw new Exception("Wrong parameters for image: collector id: " + collectorId + ",card set: " + cardSet);
|
||||||
}
|
}
|
||||||
StringBuilder url = new StringBuilder("http://mtgimage.com/set/");
|
StringBuilder url = new StringBuilder("http://mtgimage.com/set/");
|
||||||
url.append(cardSet.toUpperCase()).append('/');
|
url.append(cardSet.toUpperCase(Locale.ENGLISH)).append('/');
|
||||||
|
|
||||||
if (card.isSplitCard()) {
|
if (card.isSplitCard()) {
|
||||||
url.append(card.getDownloadName().replaceAll(" // ", ""));
|
url.append(card.getDownloadName().replaceAll(" // ", ""));
|
||||||
} else {
|
} else {
|
||||||
url.append(card.getDownloadName().replaceAll(" ", "%20"));
|
url.append(card.getDownloadName().replaceAll(" ", "%20"));
|
||||||
|
@ -98,12 +97,12 @@ public enum MtgImageSource implements CardImageSource {
|
||||||
public float getAverageSize() {
|
public float getAverageSize() {
|
||||||
return 70.0f;
|
return 70.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTotalImages() {
|
public int getTotalImages() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTokenSource() {
|
public boolean isTokenSource() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -112,4 +111,4 @@ public enum MtgImageSource implements CardImageSource {
|
||||||
@Override
|
@Override
|
||||||
public void doPause(String httpImageUrl) {
|
public void doPause(String httpImageUrl) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
@ -317,13 +318,13 @@ public enum MythicspoilerComSource implements CardImageSource {
|
||||||
private Map<String, String> getSetLinks(String cardSet) {
|
private Map<String, String> getSetLinks(String cardSet) {
|
||||||
Map<String, String> setLinks = new HashMap<>();
|
Map<String, String> setLinks = new HashMap<>();
|
||||||
try {
|
try {
|
||||||
String setNames = setsAliases.get(cardSet.toLowerCase());
|
String setNames = setsAliases.get(cardSet.toLowerCase(Locale.ENGLISH));
|
||||||
Set<String> aliasesStart = new HashSet<>();
|
Set<String> aliasesStart = new HashSet<>();
|
||||||
if (cardNameAliasesStart.containsKey(cardSet)) {
|
if (cardNameAliasesStart.containsKey(cardSet)) {
|
||||||
aliasesStart.addAll(cardNameAliasesStart.get(cardSet));
|
aliasesStart.addAll(cardNameAliasesStart.get(cardSet));
|
||||||
}
|
}
|
||||||
if (setNames == null) {
|
if (setNames == null) {
|
||||||
setNames = cardSet.toLowerCase();
|
setNames = cardSet.toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
Preferences prefs = MageFrame.getPreferences();
|
Preferences prefs = MageFrame.getPreferences();
|
||||||
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
||||||
|
@ -423,7 +424,7 @@ public enum MythicspoilerComSource implements CardImageSource {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Map<String, String> setLinks = sets.computeIfAbsent(cardSet, k -> getSetLinks(cardSet));
|
Map<String, String> setLinks = sets.computeIfAbsent(cardSet, k -> getSetLinks(cardSet));
|
||||||
String searchName = card.getDownloadName().toLowerCase()
|
String searchName = card.getDownloadName().toLowerCase(Locale.ENGLISH)
|
||||||
.replaceAll(" ", "")
|
.replaceAll(" ", "")
|
||||||
.replaceAll("\\.", "")
|
.replaceAll("\\.", "")
|
||||||
.replaceAll("&", "and")
|
.replaceAll("&", "and")
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.mage.plugins.card.dl.sources;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.mage.plugins.card.images.CardDownloadData;
|
import org.mage.plugins.card.images.CardDownloadData;
|
||||||
|
@ -280,7 +281,7 @@ public enum ScryfallImageSource implements CardImageSource {
|
||||||
if (setNameReplacement.containsKey(setName)) {
|
if (setNameReplacement.containsKey(setName)) {
|
||||||
setName = setNameReplacement.get(setName);
|
setName = setNameReplacement.get(setName);
|
||||||
}
|
}
|
||||||
return setName.toLowerCase();
|
return setName.toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<String, String> setNameReplacement = new HashMap<String, String>() {
|
private static final Map<String, String> setNameReplacement = new HashMap<String, String>() {
|
||||||
|
|
|
@ -38,6 +38,7 @@ import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -97,7 +98,7 @@ public enum TokensMtgImageSource implements CardImageSource {
|
||||||
private String getEmblemName(String originalName) {
|
private String getEmblemName(String originalName) {
|
||||||
|
|
||||||
for (SubType subType : SubType.getPlaneswalkerTypes(true)) {
|
for (SubType subType : SubType.getPlaneswalkerTypes(true)) {
|
||||||
if (originalName.toLowerCase().contains(subType.toString().toLowerCase())) {
|
if (originalName.toLowerCase(Locale.ENGLISH).contains(subType.toString().toLowerCase(Locale.ENGLISH))) {
|
||||||
return subType.getDescription() + " Emblem";
|
return subType.getDescription() + " Emblem";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,13 +112,13 @@ public enum TokensMtgImageSource implements CardImageSource {
|
||||||
int type = card.getType();
|
int type = card.getType();
|
||||||
|
|
||||||
// handle emblems
|
// handle emblems
|
||||||
if (name.toLowerCase().contains("emblem")) {
|
if (name.toLowerCase(Locale.ENGLISH).contains("emblem")) {
|
||||||
name = getEmblemName(name);
|
name = getEmblemName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we should replace some set names
|
// we should replace some set names
|
||||||
if (SET_NAMES_REPLACEMENT.containsKey(set.toLowerCase())) {
|
if (SET_NAMES_REPLACEMENT.containsKey(set.toLowerCase(Locale.ENGLISH))) {
|
||||||
set = SET_NAMES_REPLACEMENT.get(set.toLowerCase());
|
set = SET_NAMES_REPLACEMENT.get(set.toLowerCase(Locale.ENGLISH));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image URL contains token number
|
// Image URL contains token number
|
||||||
|
@ -187,7 +188,7 @@ public enum TokensMtgImageSource implements CardImageSource {
|
||||||
@Override
|
@Override
|
||||||
public boolean isImageProvided(String setCode, String cardName) {
|
public boolean isImageProvided(String setCode, String cardName) {
|
||||||
String searchName = cardName;
|
String searchName = cardName;
|
||||||
if (cardName.toLowerCase().contains("emblem")) {
|
if (cardName.toLowerCase(Locale.ENGLISH).contains("emblem")) {
|
||||||
searchName = getEmblemName(cardName);
|
searchName = getEmblemName(cardName);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -39,6 +39,7 @@ import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -460,12 +461,16 @@ public enum WizardCardsImageSource implements CardImageSource {
|
||||||
setsAliases.put("ZEN", "Zendikar");
|
setsAliases.put("ZEN", "Zendikar");
|
||||||
|
|
||||||
languageAliases = new HashMap<>();
|
languageAliases = new HashMap<>();
|
||||||
|
languageAliases.put("en", "English");
|
||||||
languageAliases.put("es", "Spanish");
|
languageAliases.put("es", "Spanish");
|
||||||
languageAliases.put("jp", "Japanese");
|
languageAliases.put("jp", "Japanese");
|
||||||
languageAliases.put("it", "Italian");
|
languageAliases.put("it", "Italian");
|
||||||
languageAliases.put("fr", "French");
|
languageAliases.put("fr", "French");
|
||||||
languageAliases.put("cn", "Chinese Simplified");
|
languageAliases.put("cn", "Chinese Simplified");
|
||||||
languageAliases.put("de", "German");
|
languageAliases.put("de", "German");
|
||||||
|
languageAliases.put("ko", "Korean");
|
||||||
|
languageAliases.put("pt", "Portuguese (Brazil)");
|
||||||
|
languageAliases.put("ru", "Russian");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -493,7 +498,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
||||||
if (setLinks == null || setLinks.isEmpty()) {
|
if (setLinks == null || setLinks.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String searchKey = card.getDownloadName().toLowerCase().replace(" ", "").replace("&", "//");
|
String searchKey = card.getDownloadName().toLowerCase(Locale.ENGLISH).replace(" ", "").replace("&", "//");
|
||||||
String link = setLinks.get(searchKey);
|
String link = setLinks.get(searchKey);
|
||||||
if (link == null) {
|
if (link == null) {
|
||||||
int length = collectorId.length();
|
int length = collectorId.length();
|
||||||
|
@ -576,7 +581,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Integer preferedMultiverseId = getLocalizedMultiverseId(preferedLanguage, multiverseId);
|
Integer preferedMultiverseId = getLocalizedMultiverseId(preferedLanguage, multiverseId);
|
||||||
setLinks.put(cardName.toLowerCase() + numberChar, generateLink(preferedMultiverseId));
|
setLinks.put(cardName.toLowerCase(Locale.ENGLISH) + numberChar, generateLink(preferedMultiverseId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -652,11 +657,11 @@ public enum WizardCardsImageSource implements CardImageSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Integer landMultiverseId = Integer.parseInt(variation.attr("href").replaceAll("[^\\d]", ""));
|
Integer landMultiverseId = Integer.parseInt(variation.attr("href").replaceAll("[^\\d]", ""));
|
||||||
setLinks.put((cardName).toLowerCase() + colNumb, generateLink(landMultiverseId));
|
setLinks.put((cardName).toLowerCase(Locale.ENGLISH) + colNumb, generateLink(landMultiverseId));
|
||||||
iteration++;
|
iteration++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setLinks.put(cardName.toLowerCase(), generateLink(multiverseId));
|
setLinks.put(cardName.toLowerCase(Locale.ENGLISH), generateLink(multiverseId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,7 +702,9 @@ public enum WizardCardsImageSource implements CardImageSource {
|
||||||
private String normalizeName(String name) {
|
private String normalizeName(String name) {
|
||||||
//Split card
|
//Split card
|
||||||
if (name.contains("//")) {
|
if (name.contains("//")) {
|
||||||
name = name.substring(0, name.indexOf('(') - 1);
|
if (name.indexOf('(') > 0) {
|
||||||
|
name = name.substring(0, name.indexOf('(') - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//Special timeshifted name
|
//Special timeshifted name
|
||||||
if (name.startsWith("XX")) {
|
if (name.startsWith("XX")) {
|
||||||
|
@ -756,7 +763,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
||||||
// setLinks.putAll(getLandVariations(multiverseId, cardName));
|
// setLinks.putAll(getLandVariations(multiverseId, cardName));
|
||||||
// } else {
|
// } else {
|
||||||
// Integer preferedMultiverseId = getLocalizedMultiverseId(preferedLanguage, multiverseId);
|
// Integer preferedMultiverseId = getLocalizedMultiverseId(preferedLanguage, multiverseId);
|
||||||
// setLinks.put(cardName.toLowerCase(), generateLink(preferedMultiverseId));
|
// setLinks.put(cardName.toLowerCase(Locale.ENGLISH), generateLink(preferedMultiverseId));
|
||||||
// }
|
// }
|
||||||
// } catch (IOException | NumberFormatException ex) {
|
// } catch (IOException | NumberFormatException ex) {
|
||||||
// logger.error("Exception when parsing the wizards page: " + ex.getMessage());
|
// logger.error("Exception when parsing the wizards page: " + ex.getMessage());
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package org.mage.plugins.card.images;
|
package org.mage.plugins.card.images;
|
||||||
|
|
||||||
import mage.util.CardUtil;
|
import java.util.Locale;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -134,7 +134,7 @@ public class CardDownloadData {
|
||||||
return CardUtil.parseCardNumberAsInt(collectorId);
|
return CardUtil.parseCardNumberAsInt(collectorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCollectorIdWithStr(){
|
public boolean isCollectorIdWithStr() {
|
||||||
// card have special numbers like "103a", "180b" (scryfall style)
|
// card have special numbers like "103a", "180b" (scryfall style)
|
||||||
return !getCollectorId().equals(getCollectorIdAsInt().toString());
|
return !getCollectorId().equals(getCollectorIdAsInt().toString());
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ public class CardDownloadData {
|
||||||
private String lastDitchTokenDescriptor() {
|
private String lastDitchTokenDescriptor() {
|
||||||
String tmpName = this.name.replaceAll("[^a-zA-Z0-9]", "");
|
String tmpName = this.name.replaceAll("[^a-zA-Z0-9]", "");
|
||||||
String descriptor = tmpName + "....";
|
String descriptor = tmpName + "....";
|
||||||
descriptor = descriptor.toUpperCase();
|
descriptor = descriptor.toUpperCase(Locale.ENGLISH);
|
||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
@ -504,23 +505,23 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
||||||
tokenClassName = params[6].trim();
|
tokenClassName = params[6].trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params[1].toLowerCase().equals("generate") && params[2].startsWith("TOK:")) {
|
if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("TOK:")) {
|
||||||
String set = params[2].substring(4);
|
String set = params[2].substring(4);
|
||||||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true);
|
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true);
|
||||||
card.setTokenClassName(tokenClassName);
|
card.setTokenClassName(tokenClassName);
|
||||||
list.add(card);
|
list.add(card);
|
||||||
// logger.debug("Token: " + set + "/" + card.getName() + " type: " + type);
|
// logger.debug("Token: " + set + "/" + card.getName() + " type: " + type);
|
||||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM:")) {
|
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM:")) {
|
||||||
String set = params[2].substring(7);
|
String set = params[2].substring(7);
|
||||||
CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, "0", false, type, "", "", true, fileName);
|
CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, "0", false, type, "", "", true, fileName);
|
||||||
card.setTokenClassName(tokenClassName);
|
card.setTokenClassName(tokenClassName);
|
||||||
list.add(card);
|
list.add(card);
|
||||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM-:")) {
|
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM-:")) {
|
||||||
String set = params[2].substring(8);
|
String set = params[2].substring(8);
|
||||||
CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, "0", false, type, "", "", true, fileName);
|
CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, "0", false, type, "", "", true, fileName);
|
||||||
card.setTokenClassName(tokenClassName);
|
card.setTokenClassName(tokenClassName);
|
||||||
list.add(card);
|
list.add(card);
|
||||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM!:")) {
|
} else if (params[1].toLowerCase(Locale.ENGLISH).equals("generate") && params[2].startsWith("EMBLEM!:")) {
|
||||||
String set = params[2].substring(8);
|
String set = params[2].substring(8);
|
||||||
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true, fileName);
|
CardDownloadData card = new CardDownloadData(params[3], set, "0", false, type, "", "", true, fileName);
|
||||||
card.setTokenClassName(tokenClassName);
|
card.setTokenClassName(tokenClassName);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.io.File;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Proxy;
|
import java.net.Proxy;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.constants.Constants;
|
import mage.client.constants.Constants;
|
||||||
|
@ -116,7 +117,7 @@ public final class CardImageUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String updateSet(String cardSet, boolean forUrl) {
|
public static String updateSet(String cardSet, boolean forUrl) {
|
||||||
String set = cardSet.toLowerCase();
|
String set = cardSet.toLowerCase(Locale.ENGLISH);
|
||||||
if (set.equals("con")) {
|
if (set.equals("con")) {
|
||||||
set = "cfx";
|
set = "cfx";
|
||||||
}
|
}
|
||||||
|
@ -172,7 +173,7 @@ public final class CardImageUtils {
|
||||||
throw new IllegalArgumentException("Card " + card.getName() + " have empty set.");
|
throw new IllegalArgumentException("Card " + card.getName() + " have empty set.");
|
||||||
}
|
}
|
||||||
|
|
||||||
String set = updateSet(card.getSet(), false).toUpperCase(); // TODO: research auto-replace... old code?
|
String set = updateSet(card.getSet(), false).toUpperCase(Locale.ENGLISH); // TODO: research auto-replace... old code?
|
||||||
|
|
||||||
if (card.isToken()) {
|
if (card.isToken()) {
|
||||||
return buildImagePathToSetAsToken(set);
|
return buildImagePathToSetAsToken(set);
|
||||||
|
@ -236,7 +237,7 @@ public final class CardImageUtils {
|
||||||
if (dirFile.exists() && !imageFile.exists()) {
|
if (dirFile.exists() && !imageFile.exists()) {
|
||||||
// search like names
|
// search like names
|
||||||
for (String fileName : dirFile.list()) {
|
for (String fileName : dirFile.list()) {
|
||||||
if (fileName.toLowerCase().equals(finalFileName.toLowerCase())) {
|
if (fileName.toLowerCase(Locale.ENGLISH).equals(finalFileName.toLowerCase(Locale.ENGLISH))) {
|
||||||
finalFileName = fileName;
|
finalFileName = fileName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import java.awt.image.FilteredImageSource;
|
||||||
import java.awt.image.WritableRaster;
|
import java.awt.image.WritableRaster;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import mage.client.util.gui.BufferedImageBuilder;
|
import mage.client.util.gui.BufferedImageBuilder;
|
||||||
|
@ -20,18 +21,17 @@ import org.mage.plugins.card.utils.Transparency;
|
||||||
public enum ImageManagerImpl implements ImageManager {
|
public enum ImageManagerImpl implements ImageManager {
|
||||||
instance;
|
instance;
|
||||||
|
|
||||||
|
|
||||||
ImageManagerImpl() {
|
ImageManagerImpl() {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
String[] phases = {"Untap", "Upkeep", "Draw", "Main1",
|
String[] phases = {"Untap", "Upkeep", "Draw", "Main1",
|
||||||
"Combat_Start", "Combat_Attack", "Combat_Block", "Combat_Damage", "Combat_End",
|
"Combat_Start", "Combat_Attack", "Combat_Block", "Combat_Damage", "Combat_End",
|
||||||
"Main2", "Cleanup", "Next_Turn"};
|
"Main2", "Cleanup", "Next_Turn"};
|
||||||
phasesImages = new HashMap<>();
|
phasesImages = new HashMap<>();
|
||||||
for (String name : phases) {
|
for (String name : phases) {
|
||||||
Image image = getImageFromResource("/phases/phase_" + name.toLowerCase() + ".png", new Rectangle(36, 36));
|
Image image = getImageFromResource("/phases/phase_" + name.toLowerCase(Locale.ENGLISH) + ".png", new Rectangle(36, 36));
|
||||||
phasesImages.put(name, image);
|
phasesImages.put(name, image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -339,10 +339,10 @@ public enum ImageManagerImpl implements ImageManager {
|
||||||
}
|
}
|
||||||
return imageSkipYourNextTurnButton;
|
return imageSkipYourNextTurnButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image getToggleRecordMacroButtonImage() {
|
public Image getToggleRecordMacroButtonImage() {
|
||||||
if(imageToggleRecordMacroButton == null) {
|
if (imageToggleRecordMacroButton == null) {
|
||||||
imageToggleRecordMacroButton = getBufferedImageFromResource("/buttons/toggle_macro.png");
|
imageToggleRecordMacroButton = getBufferedImageFromResource("/buttons/toggle_macro.png");
|
||||||
}
|
}
|
||||||
return imageToggleRecordMacroButton;
|
return imageToggleRecordMacroButton;
|
||||||
|
@ -414,7 +414,7 @@ public enum ImageManagerImpl implements ImageManager {
|
||||||
private static BufferedImage triggeredAbilityIcon;
|
private static BufferedImage triggeredAbilityIcon;
|
||||||
private static BufferedImage activatedAbilityIcon;
|
private static BufferedImage activatedAbilityIcon;
|
||||||
private static BufferedImage lookedAtIcon;
|
private static BufferedImage lookedAtIcon;
|
||||||
private static BufferedImage revealedIcon;
|
private static BufferedImage revealedIcon;
|
||||||
private static BufferedImage exileIcon;
|
private static BufferedImage exileIcon;
|
||||||
private static BufferedImage imageCopyIcon;
|
private static BufferedImage imageCopyIcon;
|
||||||
private static BufferedImage imageCounterGreen;
|
private static BufferedImage imageCounterGreen;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.mage.plugins.theme;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
@ -49,7 +50,7 @@ public class ThemePluginImpl implements ThemePlugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (File f : filelist) {
|
for (File f : filelist) {
|
||||||
String filename = f.getName().toLowerCase();
|
String filename = f.getName().toLowerCase(Locale.ENGLISH);
|
||||||
if (filename != null && (filename.endsWith(".png") || filename.endsWith(".jpg")
|
if (filename != null && (filename.endsWith(".png") || filename.endsWith(".jpg")
|
||||||
|| filename.endsWith(".bmp"))) {
|
|| filename.endsWith(".bmp"))) {
|
||||||
flist.add(filename);
|
flist.add(filename);
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
|
@ -41,7 +41,7 @@ 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 = 28;
|
public final static int MAGE_VERSION_PATCH = 28;
|
||||||
public final static String MAGE_VERSION_MINOR_PATCH = "V0";
|
public final static String MAGE_VERSION_MINOR_PATCH = "V1";
|
||||||
public final static String MAGE_VERSION_INFO = "";
|
public final static String MAGE_VERSION_INFO = "";
|
||||||
|
|
||||||
private final int major;
|
private final int major;
|
||||||
|
|
|
@ -988,7 +988,7 @@ public class CardView extends SimpleCardView {
|
||||||
public String getColorText() {
|
public String getColorText() {
|
||||||
|
|
||||||
String color = getColor().getDescription();
|
String color = getColor().getDescription();
|
||||||
return color.substring(0, 1).toUpperCase() + color.substring(1);
|
return color.substring(0, 1).toUpperCase(Locale.ENGLISH) + color.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTypeText() {
|
public String getTypeText() {
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.view;
|
package mage.view;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -65,8 +64,8 @@ public class GameEndView implements Serializable {
|
||||||
// set result message
|
// set result message
|
||||||
int winner = 0;
|
int winner = 0;
|
||||||
Player you = null;
|
Player you = null;
|
||||||
for (Player player: state.getPlayers().values()) {
|
for (Player player : state.getPlayers().values()) {
|
||||||
PlayerView playerView = new PlayerView(player, state, game, playerId, null);
|
PlayerView playerView = new PlayerView(player, state, game, playerId, null);
|
||||||
if (playerView.getPlayerId().equals(playerId)) {
|
if (playerView.getPlayerId().equals(playerId)) {
|
||||||
clientPlayer = playerView;
|
clientPlayer = playerView;
|
||||||
you = player;
|
you = player;
|
||||||
|
@ -79,11 +78,11 @@ public class GameEndView implements Serializable {
|
||||||
}
|
}
|
||||||
if (you != null) {
|
if (you != null) {
|
||||||
if (you.hasWon()) {
|
if (you.hasWon()) {
|
||||||
gameInfo = new StringBuilder("You won the game on turn ").append(game.getTurnNum()).append('.').toString();
|
gameInfo = "You won the game on turn " + game.getTurnNum() + ".";
|
||||||
} else if (winner > 0) {
|
} else if (winner > 0) {
|
||||||
gameInfo = new StringBuilder("You lost the game on turn ").append(game.getTurnNum()).append('.').toString();
|
gameInfo = "You lost the game on turn " + game.getTurnNum() + ".";
|
||||||
} else {
|
} else {
|
||||||
gameInfo = new StringBuilder("Game is a draw on Turn ").append(game.getTurnNum()).append('.').toString();
|
gameInfo = "Game is a draw on Turn " + game.getTurnNum() + ".";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
matchView = new MatchView(table);
|
matchView = new MatchView(table);
|
||||||
|
@ -92,7 +91,7 @@ public class GameEndView implements Serializable {
|
||||||
MatchPlayer matchWinner = null;
|
MatchPlayer matchWinner = null;
|
||||||
winsNeeded = match.getOptions().getWinsNeeded();
|
winsNeeded = match.getOptions().getWinsNeeded();
|
||||||
StringBuilder additonalText = new StringBuilder();
|
StringBuilder additonalText = new StringBuilder();
|
||||||
for (MatchPlayer matchPlayer: match.getPlayers()) {
|
for (MatchPlayer matchPlayer : match.getPlayers()) {
|
||||||
if (matchPlayer.getPlayer().equals(you)) {
|
if (matchPlayer.getPlayer().equals(you)) {
|
||||||
wins = matchPlayer.getWins();
|
wins = matchPlayer.getWins();
|
||||||
}
|
}
|
||||||
|
@ -127,7 +126,7 @@ public class GameEndView implements Serializable {
|
||||||
matchInfo = new StringBuilder(matchWinner.getName()).append(" won the match!").toString();
|
matchInfo = new StringBuilder(matchWinner.getName()).append(" won the match!").toString();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
matchInfo = new StringBuilder("You need ").append(winsNeeded - wins == 1 ? "one more win ":winsNeeded - wins + " more wins ").append("to win the match.").toString();
|
matchInfo = new StringBuilder("You need ").append(winsNeeded - wins == 1 ? "one more win " : winsNeeded - wins + " more wins ").append("to win the match.").toString();
|
||||||
}
|
}
|
||||||
additionalInfo = additonalText.toString();
|
additionalInfo = additonalText.toString();
|
||||||
|
|
||||||
|
|
|
@ -27,18 +27,14 @@
|
||||||
*/
|
*/
|
||||||
package mage.view;
|
package mage.view;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -60,8 +56,6 @@ import mage.game.stack.StackObject;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.watchers.common.CastSpellLastTurnWatcher;
|
import mage.watchers.common.CastSpellLastTurnWatcher;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.GsonBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -105,7 +99,12 @@ public class GameView implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (StackObject stackObject : state.getStack()) {
|
for (StackObject stackObject : state.getStack()) {
|
||||||
if (stackObject instanceof StackAbility) {
|
if (stackObject instanceof Spell) {
|
||||||
|
// Spell
|
||||||
|
CardView spellView = new CardView((Spell) stackObject, game, stackObject.getControllerId().equals(createdForPlayerId));
|
||||||
|
spellView.paid = ((Spell) stackObject).getSpellAbility().getManaCostsToPay().isPaid();
|
||||||
|
stack.put(stackObject.getId(), spellView);
|
||||||
|
} else if (stackObject instanceof StackAbility) {
|
||||||
// Stack Ability
|
// Stack Ability
|
||||||
MageObject object = game.getObject(stackObject.getSourceId());
|
MageObject object = game.getObject(stackObject.getSourceId());
|
||||||
Card card = game.getCard(stackObject.getSourceId());
|
Card card = game.getCard(stackObject.getSourceId());
|
||||||
|
@ -161,9 +160,7 @@ public class GameView implements Serializable {
|
||||||
LOGGER.debug("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule());
|
LOGGER.debug("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Spell
|
LOGGER.fatal("Unknown type of StackObject: " + stackObject.getName() + ' ' + stackObject.toString() + ' ' + stackObject.getClass().toString());
|
||||||
stack.put(stackObject.getId(), new CardView((Spell) stackObject, game, stackObject.getControllerId().equals(createdForPlayerId)));
|
|
||||||
checkPaid(stackObject.getId(), (Spell) stackObject);
|
|
||||||
}
|
}
|
||||||
//stackOrder.add(stackObject.getId());
|
//stackOrder.add(stackObject.getId());
|
||||||
}
|
}
|
||||||
|
@ -223,21 +220,6 @@ public class GameView implements Serializable {
|
||||||
cardView.paid = true;
|
cardView.paid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkPaid(UUID uuid, Spell spell) {
|
|
||||||
for (Cost cost : spell.getSpellAbility().getManaCostsToPay()) {
|
|
||||||
if (!cost.isPaid()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CardView cardView = stack.get(uuid);
|
|
||||||
cardView.paid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setPaid(UUID uuid) {
|
|
||||||
CardView cardView = stack.get(uuid);
|
|
||||||
cardView.paid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateLatestCardView(Game game, Card card, UUID stackId) {
|
private void updateLatestCardView(Game game, Card card, UUID stackId) {
|
||||||
if (!card.isTransformable()) {
|
if (!card.isTransformable()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -24,21 +24,15 @@
|
||||||
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ConnectDialog.java
|
* ConnectDialog.java
|
||||||
*
|
*
|
||||||
* Created on 20-Jan-2010, 9:37:07 PM
|
* Created on 20-Jan-2010, 9:37:07 PM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.server.console;
|
package mage.server.console;
|
||||||
|
|
||||||
import mage.remote.Connection;
|
|
||||||
import mage.remote.Connection.ProxyType;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
@ -46,8 +40,13 @@ import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import javax.swing.*;
|
||||||
|
import mage.remote.Connection;
|
||||||
|
import mage.remote.Connection.ProxyType;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -60,9 +59,11 @@ public class ConnectDialog extends JDialog {
|
||||||
private Connection connection;
|
private Connection connection;
|
||||||
private ConnectTask task;
|
private ConnectTask task;
|
||||||
|
|
||||||
/** Creates new form ConnectDialog */
|
/**
|
||||||
|
* Creates new form ConnectDialog
|
||||||
|
*/
|
||||||
public ConnectDialog() {
|
public ConnectDialog() {
|
||||||
initComponents();
|
initComponents();
|
||||||
cbProxyType.setModel(new DefaultComboBoxModel(Connection.ProxyType.values()));
|
cbProxyType.setModel(new DefaultComboBoxModel(Connection.ProxyType.values()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ public class ConnectDialog extends JDialog {
|
||||||
this.chkAutoConnect.setSelected(Boolean.parseBoolean(ConsoleFrame.getPreferences().get("autoConnect", "false")));
|
this.chkAutoConnect.setSelected(Boolean.parseBoolean(ConsoleFrame.getPreferences().get("autoConnect", "false")));
|
||||||
this.txtProxyServer.setText(ConsoleFrame.getPreferences().get("proxyAddress", "localhost"));
|
this.txtProxyServer.setText(ConsoleFrame.getPreferences().get("proxyAddress", "localhost"));
|
||||||
this.txtProxyPort.setText(ConsoleFrame.getPreferences().get("proxyPort", Integer.toString(17171)));
|
this.txtProxyPort.setText(ConsoleFrame.getPreferences().get("proxyPort", Integer.toString(17171)));
|
||||||
this.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase()));
|
this.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase(Locale.ENGLISH)));
|
||||||
this.txtProxyUserName.setText(ConsoleFrame.getPreferences().get("proxyUsername", ""));
|
this.txtProxyUserName.setText(ConsoleFrame.getPreferences().get("proxyUsername", ""));
|
||||||
this.txtPasswordField.setText(ConsoleFrame.getPreferences().get("proxyPassword", ""));
|
this.txtPasswordField.setText(ConsoleFrame.getPreferences().get("proxyPassword", ""));
|
||||||
this.showProxySettings();
|
this.showProxySettings();
|
||||||
|
@ -87,13 +88,11 @@ public class ConnectDialog extends JDialog {
|
||||||
this.pnlProxy.setVisible(true);
|
this.pnlProxy.setVisible(true);
|
||||||
this.pnlProxyAuth.setVisible(false);
|
this.pnlProxyAuth.setVisible(false);
|
||||||
this.pnlProxySettings.setVisible(true);
|
this.pnlProxySettings.setVisible(true);
|
||||||
}
|
} else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
||||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
|
||||||
this.pnlProxy.setVisible(true);
|
this.pnlProxy.setVisible(true);
|
||||||
this.pnlProxyAuth.setVisible(true);
|
this.pnlProxyAuth.setVisible(true);
|
||||||
this.pnlProxySettings.setVisible(true);
|
this.pnlProxySettings.setVisible(true);
|
||||||
}
|
} else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
||||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
|
||||||
this.pnlProxy.setVisible(false);
|
this.pnlProxy.setVisible(false);
|
||||||
this.pnlProxyAuth.setVisible(false);
|
this.pnlProxyAuth.setVisible(false);
|
||||||
this.pnlProxySettings.setVisible(false);
|
this.pnlProxySettings.setVisible(false);
|
||||||
|
@ -115,10 +114,10 @@ public class ConnectDialog extends JDialog {
|
||||||
Arrays.fill(input, '0');
|
Arrays.fill(input, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/**
|
||||||
* initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
* always regenerated by the Form Editor.
|
* regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
@ -377,7 +376,7 @@ public class ConnectDialog extends JDialog {
|
||||||
JOptionPane.showMessageDialog(rootPane, "Please provide a port number");
|
JOptionPane.showMessageDialog(rootPane, "Please provide a port number");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Integer.valueOf(txtPort.getText()) < 1 || Integer.valueOf(txtPort.getText()) > 65535 ) {
|
if (Integer.valueOf(txtPort.getText()) < 1 || Integer.valueOf(txtPort.getText()) > 65535) {
|
||||||
JOptionPane.showMessageDialog(rootPane, "Invalid port number");
|
JOptionPane.showMessageDialog(rootPane, "Invalid port number");
|
||||||
txtPort.setText(ConsoleFrame.getPreferences().get("serverPort", Integer.toString(17171)));
|
txtPort.setText(ConsoleFrame.getPreferences().get("serverPort", Integer.toString(17171)));
|
||||||
return;
|
return;
|
||||||
|
@ -424,15 +423,15 @@ public class ConnectDialog extends JDialog {
|
||||||
if (result) {
|
if (result) {
|
||||||
lblStatus.setText("");
|
lblStatus.setText("");
|
||||||
connected();
|
connected();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lblStatus.setText("Could not connect");
|
lblStatus.setText("Could not connect");
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
logger.fatal("Update Players Task error", ex);
|
logger.fatal("Update Players Task error", ex);
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
logger.fatal("Update Players Task error", ex);
|
logger.fatal("Update Players Task error", ex);
|
||||||
} catch (CancellationException ex) {}
|
} catch (CancellationException ex) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +440,6 @@ public class ConnectDialog extends JDialog {
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped
|
private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped
|
||||||
char c = evt.getKeyChar();
|
char c = evt.getKeyChar();
|
||||||
if (!Character.isDigit(c)) {
|
if (!Character.isDigit(c)) {
|
||||||
|
@ -467,7 +465,7 @@ public class ConnectDialog extends JDialog {
|
||||||
List<String> servers = new ArrayList<>();
|
List<String> servers = new ArrayList<>();
|
||||||
String inputLine;
|
String inputLine;
|
||||||
while ((inputLine = in.readLine()) != null) {
|
while ((inputLine = in.readLine()) != null) {
|
||||||
System.out.println("Found server: "+inputLine);
|
System.out.println("Found server: " + inputLine);
|
||||||
servers.add(inputLine);
|
servers.add(inputLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,11 +489,14 @@ public class ConnectDialog extends JDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
in.close();
|
in.close();
|
||||||
} catch(Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.error(ex,ex);
|
logger.error(ex, ex);
|
||||||
} finally {
|
} finally {
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
try { in.close(); } catch (Exception e) {}
|
try {
|
||||||
|
in.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_jButton1ActionPerformed
|
}//GEN-LAST:event_jButton1ActionPerformed
|
||||||
|
@ -505,10 +506,9 @@ public class ConnectDialog extends JDialog {
|
||||||
}//GEN-LAST:event_cbProxyTypeActionPerformed
|
}//GEN-LAST:event_cbProxyTypeActionPerformed
|
||||||
|
|
||||||
private void txtPasswordFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPasswordFieldActionPerformed
|
private void txtPasswordFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPasswordFieldActionPerformed
|
||||||
// TODO add your handling code here:
|
// TODO add your handling code here:
|
||||||
}//GEN-LAST:event_txtPasswordFieldActionPerformed
|
}//GEN-LAST:event_txtPasswordFieldActionPerformed
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton btnCancel;
|
private javax.swing.JButton btnCancel;
|
||||||
private javax.swing.JButton btnConnect;
|
private javax.swing.JButton btnConnect;
|
||||||
|
|
|
@ -308,7 +308,6 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JTextField" name="jUserName">
|
<Component class="javax.swing.JTextField" name="jUserName">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value=""/>
|
|
||||||
<Property name="name" type="java.lang.String" value="Username" noResource="true"/>
|
<Property name="name" type="java.lang.String" value="Username" noResource="true"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
|
|
@ -107,6 +107,10 @@ public class ConsolePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JTextField getjUserName() {
|
||||||
|
return jUserName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is always
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
@ -280,7 +284,6 @@ public class ConsolePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jUserName.setText("");
|
|
||||||
jUserName.setName("Username"); // NOI18N
|
jUserName.setName("Username"); // NOI18N
|
||||||
|
|
||||||
jLabel1.setText("Username:");
|
jLabel1.setText("Username:");
|
||||||
|
@ -346,27 +349,32 @@ public class ConsolePanel extends javax.swing.JPanel {
|
||||||
private void btnEndSessionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEndSessionActionPerformed
|
private void btnEndSessionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEndSessionActionPerformed
|
||||||
int row = this.tblUsers.convertRowIndexToModel(tblUsers.getSelectedRow());
|
int row = this.tblUsers.convertRowIndexToModel(tblUsers.getSelectedRow());
|
||||||
String userSessionId = (String) tableUserModel.getValueAt(row, TableUserModel.POS_GAME_INFO);
|
String userSessionId = (String) tableUserModel.getValueAt(row, TableUserModel.POS_GAME_INFO);
|
||||||
|
|
||||||
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to end userSessionId " + userSessionId + '?', "WARNING",
|
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to end userSessionId " + userSessionId + '?', "WARNING",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
ConsoleFrame.getSession().endUserSession(userSessionId);
|
ConsoleFrame.getSession().endUserSession(userSessionId);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_btnEndSessionActionPerformed
|
}//GEN-LAST:event_btnEndSessionActionPerformed
|
||||||
|
|
||||||
private void btnMuteUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMuteUserActionPerformed
|
private void btnMuteUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMuteUserActionPerformed
|
||||||
int row = this.tblUsers.convertRowIndexToModel(tblUsers.getSelectedRow());
|
int row = this.tblUsers.convertRowIndexToModel(tblUsers.getSelectedRow());
|
||||||
String userName = (String) tableUserModel.getValueAt(row, TableUserModel.POS_USER_NAME);
|
String userName = (String) tableUserModel.getValueAt(row, TableUserModel.POS_USER_NAME);
|
||||||
long durationMinute = ((Number) spinnerMuteDurationMinutes.getValue()).longValue();
|
long durationMinute = ((Number) spinnerMuteDurationMinutes.getValue()).longValue();
|
||||||
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to mute user: " + userName + " for " + durationMinute + " minutes?", "WARNING",
|
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to mute user: " + userName + " for " + durationMinute + " minutes?", "WARNING",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
ConsoleFrame.getSession().muteUserChat(userName, durationMinute);
|
ConsoleFrame.getSession().muteUserChat(userName, durationMinute);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_btnMuteUserActionPerformed
|
}//GEN-LAST:event_btnMuteUserActionPerformed
|
||||||
|
|
||||||
private void btnDeActivateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeActivateActionPerformed
|
private void btnDeActivateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeActivateActionPerformed
|
||||||
int row = this.tblUsers.convertRowIndexToModel(tblUsers.getSelectedRow());
|
String userName;
|
||||||
String userName = (String) tableUserModel.getValueAt(row, TableUserModel.POS_USER_NAME);
|
if (!getjUserName().getText().isEmpty()) {
|
||||||
|
userName = getjUserName().getText();
|
||||||
|
} else {
|
||||||
|
int row = this.tblUsers.convertRowIndexToModel(tblUsers.getSelectedRow());
|
||||||
|
userName = (String) tableUserModel.getValueAt(row, TableUserModel.POS_USER_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
if (JOptionPane.showConfirmDialog(null, "Did you want to set user: " + userName + " to active?", "WARNING",
|
if (JOptionPane.showConfirmDialog(null, "Did you want to set user: " + userName + " to active?", "WARNING",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
ConsoleFrame.getSession().setActivation(userName, true);
|
ConsoleFrame.getSession().setActivation(userName, true);
|
||||||
|
@ -374,13 +382,13 @@ public class ConsolePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
if (JOptionPane.showConfirmDialog(null, "Did you want to set user: " + userName + " to inactive?", "WARNING",
|
if (JOptionPane.showConfirmDialog(null, "Did you want to set user: " + userName + " to inactive?", "WARNING",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
ConsoleFrame.getSession().setActivation(userName, false);
|
ConsoleFrame.getSession().setActivation(userName, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to toggle activation for user: " + userName + '?', "WARNING",
|
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to toggle activation for user: " + userName + '?', "WARNING",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
ConsoleFrame.getSession().toggleActivation(userName);
|
ConsoleFrame.getSession().toggleActivation(userName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_btnDeActivateActionPerformed
|
}//GEN-LAST:event_btnDeActivateActionPerformed
|
||||||
|
|
||||||
|
@ -389,7 +397,7 @@ public class ConsolePanel extends javax.swing.JPanel {
|
||||||
String userName = (String) tableUserModel.getValueAt(row, TableUserModel.POS_USER_NAME);
|
String userName = (String) tableUserModel.getValueAt(row, TableUserModel.POS_USER_NAME);
|
||||||
long durationMinute = ((Number) spinnerMuteDurationMinutes.getValue()).longValue();
|
long durationMinute = ((Number) spinnerMuteDurationMinutes.getValue()).longValue();
|
||||||
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to lock user: " + userName + " for " + durationMinute + " minutes?", "WARNING",
|
if (JOptionPane.showConfirmDialog(null, "Are you sure you mean to lock user: " + userName + " for " + durationMinute + " minutes?", "WARNING",
|
||||||
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||||
ConsoleFrame.getSession().lockUser(userName, durationMinute);
|
ConsoleFrame.getSession().lockUser(userName, durationMinute);
|
||||||
}
|
}
|
||||||
}//GEN-LAST:event_btnLockUserActionPerformed
|
}//GEN-LAST:event_btnLockUserActionPerformed
|
||||||
|
@ -416,7 +424,7 @@ public class ConsolePanel extends javax.swing.JPanel {
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JScrollPane jScrollPane2;
|
private javax.swing.JScrollPane jScrollPane2;
|
||||||
private javax.swing.JSplitPane jSplitPane1;
|
private javax.swing.JSplitPane jSplitPane1;
|
||||||
public javax.swing.JTextField jUserName;
|
private javax.swing.JTextField jUserName;
|
||||||
private javax.swing.JLabel lblMinutes;
|
private javax.swing.JLabel lblMinutes;
|
||||||
private javax.swing.JSpinner spinnerMuteDurationMinutes;
|
private javax.swing.JSpinner spinnerMuteDurationMinutes;
|
||||||
private javax.swing.JTable tblTables;
|
private javax.swing.JTable tblTables;
|
||||||
|
@ -597,10 +605,10 @@ class UpdateUsersTask extends SwingWorker<Void, List<UserView>> {
|
||||||
protected Void doInBackground() throws Exception {
|
protected Void doInBackground() throws Exception {
|
||||||
while (!isCancelled()) {
|
while (!isCancelled()) {
|
||||||
List<UserView> users = session.getUsers();
|
List<UserView> users = session.getUsers();
|
||||||
if (!panel.jUserName.getText().equals("")) {
|
if (!panel.getjUserName().getText().equals("")) {
|
||||||
List<UserView> users2 = new ArrayList<>();
|
List<UserView> users2 = new ArrayList<>();
|
||||||
for (UserView user : users) {
|
for (UserView user : users) {
|
||||||
if (user.getUserName().toUpperCase().matches(".*" + panel.jUserName.getText().toUpperCase() + ".*")) {
|
if (user.getUserName().toUpperCase(Locale.ENGLISH).matches(".*" + panel.getjUserName().getText().toUpperCase(Locale.ENGLISH) + ".*")) {
|
||||||
users2.add(user);
|
users2.add(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -651,6 +659,10 @@ class UpdateUsersTask extends SwingWorker<Void, List<UserView>> {
|
||||||
panel.update(view.get(0));
|
panel.update(view.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConsolePanel getPanel() {
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void done() {
|
protected void done() {
|
||||||
try {
|
try {
|
||||||
|
@ -682,16 +694,16 @@ class UpdateTablesTask extends SwingWorker<Void, Collection<TableView>> {
|
||||||
protected Void doInBackground() throws Exception {
|
protected Void doInBackground() throws Exception {
|
||||||
while (!isCancelled()) {
|
while (!isCancelled()) {
|
||||||
Collection<TableView> tableViews = session.getTables(roomId);
|
Collection<TableView> tableViews = session.getTables(roomId);
|
||||||
if (!panel.jUserName.getText().equals("")) {
|
if (!panel.getjUserName().getText().equals("")) {
|
||||||
Collection<TableView> tableViews2 = new ArrayList<>();
|
Collection<TableView> tableViews2 = new ArrayList<>();
|
||||||
for (TableView table : tableViews) {
|
for (TableView table : tableViews) {
|
||||||
if (table.getControllerName().toUpperCase().matches(".*" + panel.jUserName.getText().toUpperCase() + ".*")) {
|
if (table.getControllerName().toUpperCase(Locale.ENGLISH).matches(".*" + panel.getjUserName().getText().toUpperCase(Locale.ENGLISH) + ".*")) {
|
||||||
tableViews2.add(table);
|
tableViews2.add(table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tableViews = tableViews2;
|
tableViews = tableViews2;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.publish(tableViews);
|
this.publish(tableViews);
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,7 @@ public class Commander extends Constructed {
|
||||||
boolean whenYouCast = false;
|
boolean whenYouCast = false;
|
||||||
|
|
||||||
for (String str : card.getRules()) {
|
for (String str : card.getRules()) {
|
||||||
String s = str.toLowerCase();
|
String s = str.toLowerCase(Locale.ENGLISH);
|
||||||
annihilator |= s.contains("annihilator");
|
annihilator |= s.contains("annihilator");
|
||||||
anyNumberOfTarget |= s.contains("any number");
|
anyNumberOfTarget |= s.contains("any number");
|
||||||
buyback |= s.contains("buyback");
|
buyback |= s.contains("buyback");
|
||||||
|
@ -521,16 +521,16 @@ public class Commander extends Constructed {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card.isPlaneswalker()) {
|
if (card.isPlaneswalker()) {
|
||||||
if (card.getName().toLowerCase().equals("jace, the mind sculptor")) {
|
if (card.getName().toLowerCase(Locale.ENGLISH).equals("jace, the mind sculptor")) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 6);
|
thisMaxPower = Math.max(thisMaxPower, 6);
|
||||||
}
|
}
|
||||||
if (card.getName().toLowerCase().equals("ugin, the spirit dragon")) {
|
if (card.getName().toLowerCase(Locale.ENGLISH).equals("ugin, the spirit dragon")) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 5);
|
thisMaxPower = Math.max(thisMaxPower, 5);
|
||||||
}
|
}
|
||||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
String cn = card.getName().toLowerCase();
|
String cn = card.getName().toLowerCase(Locale.ENGLISH);
|
||||||
if (cn.equals("ancient tomb")
|
if (cn.equals("ancient tomb")
|
||||||
|| cn.equals("anafenza, the foremost")
|
|| cn.equals("anafenza, the foremost")
|
||||||
|| cn.equals("arcum dagsson")
|
|| cn.equals("arcum dagsson")
|
||||||
|
@ -678,7 +678,7 @@ public class Commander extends Constructed {
|
||||||
ObjectColor color = null;
|
ObjectColor color = null;
|
||||||
for (Card commander : deck.getSideboard()) {
|
for (Card commander : deck.getSideboard()) {
|
||||||
int thisMaxPower = 0;
|
int thisMaxPower = 0;
|
||||||
String cn = commander.getName().toLowerCase();
|
String cn = commander.getName().toLowerCase(Locale.ENGLISH);
|
||||||
if (color == null) {
|
if (color == null) {
|
||||||
color = commander.getColor(null);
|
color = commander.getColor(null);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -617,7 +617,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
||||||
} // end of for (allActions)
|
} // end of for (allActions)
|
||||||
|
|
||||||
if (depth == maxDepth) {
|
if (depth == maxDepth) {
|
||||||
logger.info(new StringBuilder("Sim Prio [").append(depth).append("] -- End for Max Depth -- Nodes calculated: ").append(SimulationNode2.nodeCount));
|
logger.info("Sim Prio [" + depth + "] -- End for Max Depth -- Nodes calculated: " + SimulationNode2.nodeCount);
|
||||||
}
|
}
|
||||||
if (bestNode != null) {
|
if (bestNode != null) {
|
||||||
node.children.clear();
|
node.children.clear();
|
||||||
|
|
|
@ -96,18 +96,13 @@ public class ComputerPlayer7 extends ComputerPlayer6 {
|
||||||
pass(game);
|
pass(game);
|
||||||
return false;
|
return false;
|
||||||
case DECLARE_ATTACKERS:
|
case DECLARE_ATTACKERS:
|
||||||
if (!game.getActivePlayerId().equals(playerId)) {
|
printOutState(game);
|
||||||
printOutState(game);
|
if (actions.isEmpty()) {
|
||||||
if (actions.isEmpty()) {
|
logger.info("Sim Calculate declare attackers actions ----------------------------------------------------- ");
|
||||||
logger.info("Sim Calculate declare attackers actions ----------------------------------------------------- ");
|
calculateActions(game);
|
||||||
calculateActions(game);
|
|
||||||
}
|
|
||||||
act(game);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
pass(game);
|
|
||||||
}
|
}
|
||||||
return false;
|
act(game);
|
||||||
|
return true;
|
||||||
case DECLARE_BLOCKERS:
|
case DECLARE_BLOCKERS:
|
||||||
printOutState(game);
|
printOutState(game);
|
||||||
if (actions.isEmpty()) {
|
if (actions.isEmpty()) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
private static final Logger log = Logger.getLogger(ComputerPlayer.class);
|
private static final Logger log = Logger.getLogger(ComputerPlayer.class);
|
||||||
|
|
||||||
protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are availble
|
protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are availble
|
||||||
protected boolean ALLOW_INTERRUPT = true; // change this for test / debugging purposes to false to switch off interrupts while debugging
|
protected boolean ALLOW_INTERRUPT = true; // change this for test to false / debugging purposes to false to switch off interrupts while debugging
|
||||||
|
|
||||||
private transient Map<Mana, Card> unplayable = new TreeMap<>();
|
private transient Map<Mana, Card> unplayable = new TreeMap<>();
|
||||||
private transient List<Card> playableNonInstant = new ArrayList<>();
|
private transient List<Card> playableNonInstant = new ArrayList<>();
|
||||||
|
|
|
@ -245,7 +245,7 @@ public enum ChatManager {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (command.startsWith("CARD ")) {
|
if (command.startsWith("CARD ")) {
|
||||||
Matcher matchPattern = getCardTextPattern.matcher(message.toLowerCase());
|
Matcher matchPattern = getCardTextPattern.matcher(message.toLowerCase(Locale.ENGLISH));
|
||||||
if (matchPattern.find()) {
|
if (matchPattern.find()) {
|
||||||
String cardName = matchPattern.group(1);
|
String cardName = matchPattern.group(1);
|
||||||
CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardName, true);
|
CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardName, true);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.server;
|
package mage.server;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -297,7 +298,7 @@ public class TableController {
|
||||||
|
|
||||||
// Check power level for table (currently only used for EDH/Commander table)
|
// Check power level for table (currently only used for EDH/Commander table)
|
||||||
int edhPowerLevel = table.getMatch().getOptions().getEdhPowerLevel();
|
int edhPowerLevel = table.getMatch().getOptions().getEdhPowerLevel();
|
||||||
if (edhPowerLevel > 0 && table.getValidator().getName().toLowerCase().equals("commander")) {
|
if (edhPowerLevel > 0 && table.getValidator().getName().toLowerCase(Locale.ENGLISH).equals("commander")) {
|
||||||
int deckEdhPowerLevel = table.getValidator().getEdhPowerLevel(deck);
|
int deckEdhPowerLevel = table.getValidator().getEdhPowerLevel(deck);
|
||||||
if (deckEdhPowerLevel % 100 > edhPowerLevel) {
|
if (deckEdhPowerLevel % 100 > edhPowerLevel) {
|
||||||
String message = new StringBuilder("Your deck appears to be too powerful for this table.\n\nReduce the number of extra turn cards, infect, counters, fogs, reconsider your commander. ")
|
String message = new StringBuilder("Your deck appears to be too powerful for this table.\n\nReduce the number of extra turn cards, infect, counters, fogs, reconsider your commander. ")
|
||||||
|
|
|
@ -1157,8 +1157,6 @@ public class GameController implements GameCallback {
|
||||||
sb.append(state.getStack());
|
sb.append(state.getStack());
|
||||||
sb.append("<br>getStepNum: ");
|
sb.append("<br>getStepNum: ");
|
||||||
sb.append(state.getStepNum());
|
sb.append(state.getStepNum());
|
||||||
sb.append("<br>getTriggers: ");
|
|
||||||
sb.append(state.getTriggers());
|
|
||||||
sb.append("<br>getTurn: ");
|
sb.append("<br>getTurn: ");
|
||||||
sb.append(state.getTurn());
|
sb.append(state.getTurn());
|
||||||
sb.append("<br>getTurnId: ");
|
sb.append("<br>getTurnId: ");
|
||||||
|
|
|
@ -44,12 +44,11 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class AcrobaticManeuver extends CardImpl {
|
public class AcrobaticManeuver extends CardImpl {
|
||||||
|
|
||||||
public AcrobaticManeuver(UUID ownerId, CardSetInfo setInfo) {
|
public AcrobaticManeuver(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||||
|
|
||||||
// Exile target creature you control, then return that card to the battlefield under its owner's control.
|
// Exile target creature you control, then return that card to the battlefield under its owner's control.
|
||||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||||
Effect effect = new ExileTargetForSourceEffect();
|
Effect effect = new ExileTargetForSourceEffect();
|
||||||
effect.setApplyEffectsAfter();
|
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect());
|
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect());
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
* permitted provided that the following conditions are met:
|
* permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
* conditions and the following disclaimer.
|
* conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
* 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
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
* provided with the distribution.
|
* provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* 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
|
* 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
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
* 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
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.CreateTokenEffect;
|
import mage.abilities.effects.common.CreateTokenEffect;
|
||||||
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
||||||
|
@ -50,9 +49,7 @@ public class AdverseConditions extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}");
|
||||||
|
|
||||||
// Devoid
|
// Devoid
|
||||||
Ability ability = new DevoidAbility(this.color);
|
this.addAbility(new DevoidAbility(this.color));
|
||||||
ability.setRuleAtTheTop(true);
|
|
||||||
this.addAbility(ability);
|
|
||||||
|
|
||||||
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
|
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
|
||||||
this.getSpellAbility().addEffect(new TapTargetEffect());
|
this.getSpellAbility().addEffect(new TapTargetEffect());
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
|
@ -56,7 +55,7 @@ import mage.util.GameLog;
|
||||||
public class AlhammarretHighArbiter extends CardImpl {
|
public class AlhammarretHighArbiter extends CardImpl {
|
||||||
|
|
||||||
public AlhammarretHighArbiter(UUID ownerId, CardSetInfo setInfo) {
|
public AlhammarretHighArbiter(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||||
addSuperType(SuperType.LEGENDARY);
|
addSuperType(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.SPHINX);
|
this.subtype.add(SubType.SPHINX);
|
||||||
this.power = new MageInt(5);
|
this.power = new MageInt(5);
|
||||||
|
@ -101,14 +100,12 @@ class AlhammarretHighArbiterEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Cards revealedCards = new CardsImpl();
|
Cards revealedCards = new CardsImpl();
|
||||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
for (UUID playerId : game.getOpponents(controller.getId())) {
|
||||||
if (!Objects.equals(playerId, controller.getId())) {
|
Player opponent = game.getPlayer(playerId);
|
||||||
Player opponent = game.getPlayer(playerId);
|
if (opponent != null) {
|
||||||
if (opponent != null) {
|
Cards cards = new CardsImpl(opponent.getHand());
|
||||||
Cards cards = new CardsImpl(opponent.getHand());
|
opponent.revealCards(opponent.getName() + "'s hand", cards, game);
|
||||||
opponent.revealCards(opponent.getName() + "'s hand", cards, game);
|
revealedCards.addAll(cards);
|
||||||
revealedCards.addAll(cards);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TargetCard target = new TargetCard(Zone.HAND, new FilterNonlandCard("nonland card from an opponents hand"));
|
TargetCard target = new TargetCard(Zone.HAND, new FilterNonlandCard("nonland card from an opponents hand"));
|
||||||
|
@ -116,7 +113,10 @@ class AlhammarretHighArbiterEffect extends OneShotEffect {
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + ']');
|
game.informPlayers("The choosen card name is [" + GameLog.getColoredObjectName(card) + ']');
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanentEntering(source.getSourceId());
|
||||||
|
if (sourcePermanent == null) {
|
||||||
|
sourcePermanent = game.getPermanentEntering(source.getSourceId());
|
||||||
|
}
|
||||||
if (sourcePermanent != null) {
|
if (sourcePermanent != null) {
|
||||||
sourcePermanent.addInfo("chosen card name", CardUtil.addToolTipMarkTags("Chosen card name: " + card.getName()), game);
|
sourcePermanent.addInfo("chosen card name", CardUtil.addToolTipMarkTags("Chosen card name: " + card.getName()), game);
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,7 @@ class AlhammarretHighArbiterEffect extends OneShotEffect {
|
||||||
class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
|
|
||||||
String cardName;
|
String cardName;
|
||||||
|
int zoneChangeCounter;
|
||||||
|
|
||||||
public AlhammarretHighArbiterCantCastEffect(String cardName) {
|
public AlhammarretHighArbiterCantCastEffect(String cardName) {
|
||||||
super(Duration.Custom, Outcome.Benefit);
|
super(Duration.Custom, Outcome.Benefit);
|
||||||
|
@ -142,6 +143,13 @@ class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffect
|
||||||
public AlhammarretHighArbiterCantCastEffect(final AlhammarretHighArbiterCantCastEffect effect) {
|
public AlhammarretHighArbiterCantCastEffect(final AlhammarretHighArbiterCantCastEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.cardName = effect.cardName;
|
this.cardName = effect.cardName;
|
||||||
|
this.zoneChangeCounter = effect.zoneChangeCounter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Ability source, Game game) {
|
||||||
|
super.init(source, game);
|
||||||
|
zoneChangeCounter = game.getState().getZoneChangeCounter(source.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -151,8 +159,7 @@ class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffect
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInactive(Ability source, Game game) {
|
public boolean isInactive(Ability source, Game game) {
|
||||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
return game.getState().getZoneChangeCounter(source.getId()) != zoneChangeCounter;
|
||||||
return sourceObject == null || sourceObject.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,6 +33,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
@ -44,11 +45,10 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class AltarOfBone extends CardImpl {
|
public class AltarOfBone extends CardImpl {
|
||||||
|
|
||||||
public AltarOfBone(UUID ownerId, CardSetInfo setInfo) {
|
public AltarOfBone(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{W}");
|
||||||
|
|
||||||
|
|
||||||
// As an additional cost to cast Altar of Bone, sacrifice a creature.
|
// As an additional cost to cast Altar of Bone, sacrifice a creature.
|
||||||
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
// Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library.
|
// Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library.
|
||||||
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true));
|
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,7 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPlayer;
|
import mage.target.TargetPlayer;
|
||||||
|
@ -50,21 +49,15 @@ import mage.target.common.TargetControlledPermanent;
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public class AltarOfDementia extends CardImpl {
|
public class AltarOfDementia extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature");
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
|
||||||
}
|
|
||||||
|
|
||||||
public AltarOfDementia(UUID ownerId, CardSetInfo setInfo) {
|
public AltarOfDementia(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
|
||||||
// Sacrifice a creature: Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard.
|
// Sacrifice a creature: Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AltarOfDementiaEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AltarOfDementiaEffect(), new SacrificeTargetCost(new TargetControlledPermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetPlayer());
|
ability.addTarget(new TargetPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AltarOfDementia(final AltarOfDementia card) {
|
public AltarOfDementia(final AltarOfDementia card) {
|
||||||
|
@ -78,7 +71,7 @@ public class AltarOfDementia extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class AltarOfDementiaEffect extends OneShotEffect {
|
class AltarOfDementiaEffect extends OneShotEffect {
|
||||||
|
|
||||||
public AltarOfDementiaEffect() {
|
public AltarOfDementiaEffect() {
|
||||||
super(Outcome.Damage);
|
super(Outcome.Damage);
|
||||||
staticText = "Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard";
|
staticText = "Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard";
|
||||||
|
@ -93,16 +86,16 @@ class AltarOfDementiaEffect extends OneShotEffect {
|
||||||
Player player = game.getPlayer(source.getFirstTarget());
|
Player player = game.getPlayer(source.getFirstTarget());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
for (Cost cost: source.getCosts()) {
|
for (Cost cost : source.getCosts()) {
|
||||||
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
|
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
|
||||||
amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue();
|
amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (amount > 0) {
|
if (amount > 0) {
|
||||||
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
player.moveCards(player.getLibrary().getTopCards(game, amount), Zone.GRAVEYARD, source, game);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -111,4 +104,4 @@ class AltarOfDementiaEffect extends OneShotEffect {
|
||||||
public AltarOfDementiaEffect copy() {
|
public AltarOfDementiaEffect copy() {
|
||||||
return new AltarOfDementiaEffect(this);
|
return new AltarOfDementiaEffect(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,14 +52,12 @@ public class Ambuscade extends CardImpl {
|
||||||
static {
|
static {
|
||||||
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
|
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ambuscade(UUID ownerId, CardSetInfo setInfo) {
|
public Ambuscade(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
|
||||||
|
|
||||||
|
|
||||||
// Target creature you control gets +1/+0 until end of turn.
|
// Target creature you control gets +1/+0 until end of turn.
|
||||||
Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn);
|
Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn);
|
||||||
effect.setApplyEffectsAfter(); // needed to count the boost for the second effect
|
|
||||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
@ -121,7 +122,7 @@ class AngelicSkirmisherEffect extends OneShotEffect {
|
||||||
if (ability != null) {
|
if (ability != null) {
|
||||||
GainAbilityControlledEffect effect = new GainAbilityControlledEffect(ability, Duration.EndOfTurn, new FilterControlledCreaturePermanent());
|
GainAbilityControlledEffect effect = new GainAbilityControlledEffect(ability, Duration.EndOfTurn, new FilterControlledCreaturePermanent());
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " has chosen " + abilityChoice.getChoice().toLowerCase());
|
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " has chosen " + abilityChoice.getChoice().toLowerCase(Locale.ENGLISH));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ import mage.abilities.keyword.EnchantAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
@ -55,7 +56,7 @@ import mage.target.common.TargetLandPermanent;
|
||||||
public class AnimalBoneyard extends CardImpl {
|
public class AnimalBoneyard extends CardImpl {
|
||||||
|
|
||||||
public AnimalBoneyard(UUID ownerId, CardSetInfo setInfo) {
|
public AnimalBoneyard(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||||
this.subtype.add(SubType.AURA);
|
this.subtype.add(SubType.AURA);
|
||||||
|
|
||||||
// Enchant land
|
// Enchant land
|
||||||
|
@ -66,7 +67,7 @@ public class AnimalBoneyard extends CardImpl {
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
// Enchanted land has "{T}, Sacrifice a creature: You gain life equal to that creature's toughness."
|
// Enchanted land has "{T}, Sacrifice a creature: You gain life equal to that creature's toughness."
|
||||||
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AnimalBoneyardEffect(), new TapSourceCost());
|
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AnimalBoneyardEffect(), new TapSourceCost());
|
||||||
gainedAbility.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
gainedAbility.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield,
|
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield,
|
||||||
"Enchanted land has \"{T}, Sacrifice a creature: You gain life equal to that creature's toughness.\"");
|
"Enchanted land has \"{T}, Sacrifice a creature: You gain life equal to that creature's toughness.\"");
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||||
|
|
|
@ -35,7 +35,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,10 +45,10 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class AshnodsAltar extends CardImpl {
|
public class AshnodsAltar extends CardImpl {
|
||||||
|
|
||||||
public AshnodsAltar(UUID ownerId, CardSetInfo setInfo) {
|
public AshnodsAltar(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
|
|
||||||
// Sacrifice a creature: Add {C}{C} to your mana pool.
|
// Sacrifice a creature: Add {C}{C} to your mana pool.
|
||||||
SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), true));
|
SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT));
|
||||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), cost));
|
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), cost));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||||
|
@ -56,12 +57,11 @@ public class Attrition extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Attrition(UUID ownerId, CardSetInfo setInfo) {
|
public Attrition(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}");
|
||||||
|
|
||||||
|
|
||||||
//{B}, Sacrifice a creature: Destroy target nonblack creature.
|
//{B}, Sacrifice a creature: Destroy target nonblack creature.
|
||||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}"));
|
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{B}"));
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
147
Mage.Sets/src/mage/cards/a/AvenShrine.java
Normal file
147
Mage.Sets/src/mage/cards/a/AvenShrine.java
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
/*
|
||||||
|
* 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.cards.a;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.events.GameEvent.EventType;
|
||||||
|
import mage.game.stack.Spell;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author jeffwadsworth
|
||||||
|
*/
|
||||||
|
public class AvenShrine extends CardImpl {
|
||||||
|
|
||||||
|
public AvenShrine(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}");
|
||||||
|
|
||||||
|
// Whenever a player casts a spell, that player gains X life, where X is the number of cards in all graveyards with the same name as that spell.
|
||||||
|
this.addAbility(new AvenShrineTriggeredAbility());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvenShrine(final AvenShrine card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AvenShrine copy() {
|
||||||
|
return new AvenShrine(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AvenShrineTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
|
public AvenShrineTriggeredAbility() {
|
||||||
|
super(Zone.BATTLEFIELD, new AvenShrineEffect(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvenShrineTriggeredAbility(final AvenShrineTriggeredAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AvenShrineTriggeredAbility copy() {
|
||||||
|
return new AvenShrineTriggeredAbility(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
|
return event.getType() == EventType.SPELL_CAST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
|
MageObject mageObject = game.getObject(sourceId);
|
||||||
|
if (spell != null
|
||||||
|
&& !spell.isCopy()
|
||||||
|
&& spell.getCard() != null
|
||||||
|
&& !spell.getCard().isCopy()) {
|
||||||
|
game.getState().setValue("avenShrine" + mageObject, spell);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class AvenShrineEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public AvenShrineEffect() {
|
||||||
|
super(Outcome.GainLife);
|
||||||
|
staticText = "Whenever a player casts a spell, that player gains X life, where X is the number of cards in all graveyards with the same name as that spell";
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvenShrineEffect(final AvenShrineEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
int count = 0;
|
||||||
|
MageObject mageObject = game.getObject(source.getSourceId());
|
||||||
|
Spell spell = (Spell) game.getState().getValue("avenShrine" + mageObject);
|
||||||
|
if (spell != null) {
|
||||||
|
Player controller = game.getPlayer(spell.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
String name = spell.getName();
|
||||||
|
FilterCard filterCardName = new FilterCard();
|
||||||
|
filterCardName.add(new NamePredicate(name));
|
||||||
|
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||||
|
Player player = game.getPlayer(playerId);
|
||||||
|
if (player != null) {
|
||||||
|
count += player.getGraveyard().count(filterCardName, game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
controller.gainLife(count, game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AvenShrineEffect copy() {
|
||||||
|
return new AvenShrineEffect(this);
|
||||||
|
}
|
||||||
|
}
|
76
Mage.Sets/src/mage/cards/b/BalothGorger.java
Normal file
76
Mage.Sets/src/mage/cards/b/BalothGorger.java
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
/*
|
||||||
|
* 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.cards.b;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
|
import mage.abilities.keyword.KickerAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.counters.CounterType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author CountAndromalius
|
||||||
|
*/
|
||||||
|
public class BalothGorger extends CardImpl {
|
||||||
|
|
||||||
|
public BalothGorger(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");
|
||||||
|
this.subtype.add(SubType.BEAST);
|
||||||
|
|
||||||
|
this.power = new MageInt(4);
|
||||||
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
|
// Kicker {4}
|
||||||
|
this.addAbility(new KickerAbility("{4}"));
|
||||||
|
|
||||||
|
// If Baloth Gorger was kicked, it enters the battlefield with three +1/+1 counters on it
|
||||||
|
Ability ability = new EntersBattlefieldAbility(
|
||||||
|
new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)),
|
||||||
|
KickedCondition.instance,
|
||||||
|
"If {this} was kicked, it enters the battlefield with three +1/+1 counters on it",
|
||||||
|
"");
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BalothGorger(final BalothGorger card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BalothGorger copy() {
|
||||||
|
return new BalothGorger(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
117
Mage.Sets/src/mage/cards/b/Bamboozle.java
Normal file
117
Mage.Sets/src/mage/cards/b/Bamboozle.java
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
/*
|
||||||
|
* 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.cards.b;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.Cards;
|
||||||
|
import mage.cards.CardsImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.TargetCard;
|
||||||
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author jeffwadsworth
|
||||||
|
*/
|
||||||
|
public class Bamboozle extends CardImpl {
|
||||||
|
|
||||||
|
public Bamboozle(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
|
||||||
|
|
||||||
|
// Target player reveals the top four cards of his or her library. You choose two of those cards and put them into his or her graveyard. Put the rest on top of his or her library in any order.
|
||||||
|
this.getSpellAbility().addEffect(new BamboozleEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bamboozle(final Bamboozle card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Bamboozle copy() {
|
||||||
|
return new Bamboozle(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BamboozleEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
BamboozleEffect() {
|
||||||
|
super(Outcome.Discard);
|
||||||
|
staticText = "Target player reveals the top four cards of his or her library. You choose two of those cards and put them into his or her graveyard. Put the rest on top of his or her library in any order";
|
||||||
|
}
|
||||||
|
|
||||||
|
BamboozleEffect(final BamboozleEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
Cards putOnTopLibrary = new CardsImpl();
|
||||||
|
Cards putInGraveyard = new CardsImpl();
|
||||||
|
if (targetPlayer != null
|
||||||
|
&& controller != null) {
|
||||||
|
Set<Card> top4Cards = targetPlayer.getLibrary().getTopCards(game, 4);
|
||||||
|
for (Card card : top4Cards) {
|
||||||
|
putOnTopLibrary.add(card);
|
||||||
|
}
|
||||||
|
targetPlayer.revealCards("Bamboozle Reveal", putOnTopLibrary, game);
|
||||||
|
TargetCard target = new TargetCard(2, Zone.LIBRARY, new FilterCard("2 cards out of this stack to put into his or her graveyard"));
|
||||||
|
if (controller.choose(Outcome.Discard, putOnTopLibrary, target, game)) {
|
||||||
|
for (UUID cardId : target.getTargets()) {
|
||||||
|
putInGraveyard.add(game.getCard(cardId));
|
||||||
|
putOnTopLibrary.remove(game.getCard(cardId));
|
||||||
|
}
|
||||||
|
targetPlayer.moveCards(putInGraveyard, Zone.GRAVEYARD, source, game);
|
||||||
|
targetPlayer.putCardsOnTopOfLibrary(putOnTopLibrary, game, source, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BamboozleEffect copy() {
|
||||||
|
return new BamboozleEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -37,6 +37,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
|
|
||||||
|
@ -47,15 +48,14 @@ import mage.target.common.TargetCreatureOrPlayer;
|
||||||
public class BarrageOfExpendables extends CardImpl {
|
public class BarrageOfExpendables extends CardImpl {
|
||||||
|
|
||||||
public BarrageOfExpendables(UUID ownerId, CardSetInfo setInfo) {
|
public BarrageOfExpendables(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}");
|
||||||
|
|
||||||
|
|
||||||
// {R}, Sacrifice a creature: Barrage of Expendables deals 1 damage to target creature or player.
|
// {R}, Sacrifice a creature: Barrage of Expendables deals 1 damage to target creature or player.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}"));
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetCreatureOrPlayer());
|
ability.addTarget(new TargetCreatureOrPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BarrageOfExpendables(final BarrageOfExpendables card) {
|
public BarrageOfExpendables(final BarrageOfExpendables card) {
|
||||||
|
|
|
@ -46,13 +46,12 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class BarrelDownSokenzan extends CardImpl {
|
public class BarrelDownSokenzan extends CardImpl {
|
||||||
|
|
||||||
public BarrelDownSokenzan(UUID ownerId, CardSetInfo setInfo) {
|
public BarrelDownSokenzan(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
|
||||||
this.subtype.add(SubType.ARCANE);
|
this.subtype.add(SubType.ARCANE);
|
||||||
|
|
||||||
|
|
||||||
// Sweep - Return any number of Mountains you control to their owner's hand. Barrel Down Sokenzan deals damage to target creature equal to twice the number of Mountains returned this way.
|
// Sweep - Return any number of Mountains you control to their owner's hand. Barrel Down Sokenzan deals damage to target creature equal to twice the number of Mountains returned this way.
|
||||||
this.getSpellAbility().addEffect(new SweepEffect(SubType.MOUNTAIN));
|
this.getSpellAbility().addEffect(new SweepEffect(SubType.MOUNTAIN));
|
||||||
DynamicValue sweepValue = new MultipliedValue(new SweepNumber("Mountain", false), 2);
|
DynamicValue sweepValue = new MultipliedValue(new SweepNumber("Mountain"), 2);
|
||||||
this.getSpellAbility().addEffect(new DamageTargetEffect(sweepValue));
|
this.getSpellAbility().addEffect(new DamageTargetEffect(sweepValue));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
}
|
}
|
||||||
|
|
38
Mage.Sets/src/mage/cards/b/BenalishMarshal.java
Normal file
38
Mage.Sets/src/mage/cards/b/BenalishMarshal.java
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
package mage.cards.b;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class BenalishMarshal extends CardImpl {
|
||||||
|
|
||||||
|
public BenalishMarshal(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}{W}");
|
||||||
|
subtype.add(SubType.HUMAN);
|
||||||
|
subtype.add(SubType.KNIGHT);
|
||||||
|
power = new MageInt(3);
|
||||||
|
toughness = new MageInt(3);
|
||||||
|
|
||||||
|
// Other creatures you control get +1/+1.
|
||||||
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, true)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BenalishMarshal(BenalishMarshal benalishMarshall) {
|
||||||
|
super(benalishMarshall);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BenalishMarshal copy() {
|
||||||
|
return new BenalishMarshal(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -43,6 +43,7 @@ import mage.constants.ComparisonType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -57,13 +58,13 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class BirthingPod extends CardImpl {
|
public class BirthingPod extends CardImpl {
|
||||||
|
|
||||||
public BirthingPod(UUID ownerId, CardSetInfo setInfo) {
|
public BirthingPod(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}{G/P}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}{G/P}");
|
||||||
|
|
||||||
// {1}{G/P}, {tap}, Sacrifice a creature: Search your library for a creature card with converted mana cost equal to 1 plus the sacrificed creature's converted mana cost,
|
// {1}{G/P}, {tap}, Sacrifice a creature: Search your library for a creature card with converted mana cost equal to 1 plus the sacrificed creature's converted mana cost,
|
||||||
// put that card onto the battlefield, then shuffle your library. Activate this ability only any time you could cast a sorcery.
|
// put that card onto the battlefield, then shuffle your library. Activate this ability only any time you could cast a sorcery.
|
||||||
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BirthingPodEffect(), new ManaCostsImpl("{1}{G/P}"));
|
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BirthingPodEffect(), new ManaCostsImpl("{1}{G/P}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ public class BlackCarriage extends CardImpl {
|
||||||
|
|
||||||
// Sacrifice a creature: Untap Black Carriage. Activate this ability only during your upkeep.
|
// Sacrifice a creature: Untap Black Carriage. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||||
new UntapSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))),
|
new UntapSourceEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)),
|
||||||
new IsStepCondition(PhaseStep.UPKEEP), "Sacrifice a creature: Untap {this}. Activate this ability only during your upkeep."));
|
new IsStepCondition(PhaseStep.UPKEEP), "Sacrifice a creature: Untap {this}. Activate this ability only during your upkeep."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
|
@ -50,11 +51,11 @@ import mage.target.common.TargetCreatureOrPlayer;
|
||||||
public class BlastingStation extends CardImpl {
|
public class BlastingStation extends CardImpl {
|
||||||
|
|
||||||
public BlastingStation(UUID ownerId, CardSetInfo setInfo) {
|
public BlastingStation(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
|
|
||||||
// {tap}, Sacrifice a creature: Blasting Station deals 1 damage to target creature or player.
|
// {tap}, Sacrifice a creature: Blasting Station deals 1 damage to target creature or player.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetCreatureOrPlayer());
|
ability.addTarget(new TargetCreatureOrPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
// Whenever a creature enters the battlefield, you may untap Blasting Station.
|
// Whenever a creature enters the battlefield, you may untap Blasting Station.
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -39,14 +40,13 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Quercitron
|
* @author Quercitron
|
||||||
|
@ -58,9 +58,9 @@ public class BlightedShaman extends CardImpl {
|
||||||
static {
|
static {
|
||||||
filterSwamp.add(new SubtypePredicate(SubType.SWAMP));
|
filterSwamp.add(new SubtypePredicate(SubType.SWAMP));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlightedShaman(UUID ownerId, CardSetInfo setInfo) {
|
public BlightedShaman(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||||
this.subtype.add(SubType.HUMAN, SubType.CLERIC, SubType.SHAMAN);
|
this.subtype.add(SubType.HUMAN, SubType.CLERIC, SubType.SHAMAN);
|
||||||
|
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
@ -71,10 +71,10 @@ public class BlightedShaman extends CardImpl {
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filterSwamp)));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filterSwamp)));
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// {tap}, Sacrifice a creature: Target creature gets +2/+2 until end of turn.
|
// {tap}, Sacrifice a creature: Target creature gets +2/+2 until end of turn.
|
||||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new TapSourceCost());
|
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new TapSourceCost());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.FilterSpell;
|
import mage.filter.FilterSpell;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
@ -49,28 +50,28 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public class BloodFunnel extends CardImpl {
|
public class BloodFunnel extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("Noncreature spells");
|
private static final FilterCard filter = new FilterCard("Noncreature spells");
|
||||||
private static final FilterSpell filterNoncreature = new FilterSpell("a noncreature spell");
|
private static final FilterSpell filterNoncreature = new FilterSpell("a noncreature spell");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||||
filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BloodFunnel(UUID ownerId, CardSetInfo setInfo) {
|
public BloodFunnel(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||||
|
|
||||||
// Noncreature spells you cast cost {2} less to cast.
|
// Noncreature spells you cast cost {2} less to cast.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 2)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 2)));
|
||||||
|
|
||||||
// Whenever you cast a noncreature spell, counter that spell unless you sacrifice a creature.
|
// Whenever you cast a noncreature spell, counter that spell unless you sacrifice a creature.
|
||||||
Effect effect = new CounterUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
Effect effect = new CounterUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
effect.setText("counter that spell unless you sacrifice a creature");
|
effect.setText("counter that spell unless you sacrifice a creature");
|
||||||
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD,
|
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD,
|
||||||
effect,
|
effect,
|
||||||
filterNoncreature,
|
filterNoncreature,
|
||||||
false,
|
false,
|
||||||
true));
|
true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,4 +83,4 @@ public class BloodFunnel extends CardImpl {
|
||||||
public BloodFunnel copy() {
|
public BloodFunnel copy() {
|
||||||
return new BloodFunnel(this);
|
return new BloodFunnel(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
* 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.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -38,6 +37,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
|
|
||||||
|
@ -45,11 +45,12 @@ import mage.target.common.TargetCreatureOrPlayer;
|
||||||
* @author Loki
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public class BloodRites extends CardImpl {
|
public class BloodRites extends CardImpl {
|
||||||
|
|
||||||
public BloodRites(UUID ownerId, CardSetInfo setInfo) {
|
public BloodRites(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
||||||
|
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{1}{R}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{1}{R}"));
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetCreatureOrPlayer());
|
ability.addTarget(new TargetCreatureOrPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,7 +50,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class BloodflowConnoisseur extends CardImpl {
|
public class BloodflowConnoisseur extends CardImpl {
|
||||||
|
|
||||||
public BloodflowConnoisseur(UUID ownerId, CardSetInfo setInfo) {
|
public BloodflowConnoisseur(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||||
this.subtype.add(SubType.VAMPIRE);
|
this.subtype.add(SubType.VAMPIRE);
|
||||||
|
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
@ -57,7 +58,7 @@ public class BloodflowConnoisseur extends CardImpl {
|
||||||
|
|
||||||
// Sacrifice a creature: Put a +1/+1 counter on Bloodflow Connoisseur.
|
// Sacrifice a creature: Put a +1/+1 counter on Bloodflow Connoisseur.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreatureOrPlayer;
|
import mage.target.common.TargetCreatureOrPlayer;
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ import mage.target.common.TargetCreatureOrPlayer;
|
||||||
public class BloodshotCyclops extends CardImpl {
|
public class BloodshotCyclops extends CardImpl {
|
||||||
|
|
||||||
public BloodshotCyclops(UUID ownerId, CardSetInfo setInfo) {
|
public BloodshotCyclops(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}");
|
||||||
this.subtype.add(SubType.CYCLOPS, SubType.GIANT);
|
this.subtype.add(SubType.CYCLOPS, SubType.GIANT);
|
||||||
|
|
||||||
this.power = new MageInt(4);
|
this.power = new MageInt(4);
|
||||||
|
@ -60,7 +61,7 @@ public class BloodshotCyclops extends CardImpl {
|
||||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||||
new DamageTargetEffect(new SacrificeCostCreaturesPower()),
|
new DamageTargetEffect(new SacrificeCostCreaturesPower()),
|
||||||
new TapSourceCost());
|
new TapSourceCost());
|
||||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
ability.addTarget(new TargetCreatureOrPlayer());
|
ability.addTarget(new TargetCreatureOrPlayer());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
* permitted provided that the following conditions are met:
|
* permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
* conditions and the following disclaimer.
|
* conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
* 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
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
* provided with the distribution.
|
* provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
* 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
|
* 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
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
@ -20,12 +20,11 @@
|
||||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
* 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
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* 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.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -39,6 +38,7 @@ import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,12 +48,13 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
public class BloodthroneVampire extends CardImpl {
|
public class BloodthroneVampire extends CardImpl {
|
||||||
|
|
||||||
public BloodthroneVampire(UUID ownerId, CardSetInfo setInfo) {
|
public BloodthroneVampire(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||||
|
|
||||||
this.subtype.add(SubType.VAMPIRE);
|
this.subtype.add(SubType.VAMPIRE);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent())));
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn),
|
||||||
|
new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BloodthroneVampire(final BloodthroneVampire card) {
|
public BloodthroneVampire(final BloodthroneVampire card) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
@ -45,10 +45,10 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class BoneSplinters extends CardImpl {
|
public class BoneSplinters extends CardImpl {
|
||||||
|
|
||||||
public BoneSplinters(UUID ownerId, CardSetInfo setInfo) {
|
public BoneSplinters(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}");
|
||||||
|
|
||||||
// As an additional cost to cast Bone Splinters, sacrifice a creature.
|
// As an additional cost to cast Bone Splinters, sacrifice a creature.
|
||||||
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))));
|
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||||
// Destroy target creature.
|
// Destroy target creature.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)")));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)")));
|
||||||
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature"));
|
this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature"));
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue