Forge version 1.2.8
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
23 posts
• Page 2 of 2 • 1, 2
Re: Forge version 1.2.8
by friarsol » 09 Jun 2012, 18:05
That's fine, I poked through the draft code and couldn't figure out what the error was about. It looks like the pack is being created just fine, and the cards were generated, so it must not be being placed into the layout properly.Chris H. wrote:I plan to release the next beta on Monday if no one has any objections.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Forge version 1.2.8
by Chris H. » 10 Jun 2012, 23:40
I was doing some checkstyle fixes before our next beta release and I came across one that causes me some concern and I wanted some input from people that are more experienced than myself.
In src.main.forge.gui.toolbox.CardFaceSymbols we have the following method at lines 234 through 248:
Line 236 gives us an "Empty statement" checkstyle error. It looks like we have a missplaced ";" char at the end of the if statement which will result in the next statement being processed whether or not the test returns true or not.
I think that we should delete the ";" char which causes the empty statement before the next beta release. Am I right about this situation?
In src.main.forge.gui.toolbox.CardFaceSymbols we have the following method at lines 234 through 248:
- Code: Select all
public static int getWidth(final CardManaCost manaCost) {
int width = manaCost.getShards().size();
if (manaCost.getGenericCost() > 0 || (manaCost.getGenericCost() == 0 && width == 0));
width++;
/*
StringTokenizer tok = new StringTokenizer(manaCost, " ");
while (tok.hasMoreTokens()) {
String symbol = tok.nextToken();
width += symbol.length() > 2 ? 10 : 14; // slash.png is only 10
// pixels wide.
}
*/
return width * 14;
}
Line 236 gives us an "Empty statement" checkstyle error. It looks like we have a missplaced ";" char at the end of the if statement which will result in the next statement being processed whether or not the test returns true or not.
I think that we should delete the ";" char which causes the empty statement before the next beta release. Am I right about this situation?
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Forge version 1.2.8
by friarsol » 11 Jun 2012, 01:34
Looks right. I'm not really sure if that conditional matters or not, but it's hard to tell without knowing the goal of that codeblock.Chris H. wrote:I think that we should delete the ";" char which causes the empty statement before the next beta release. Am I right about this situation?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Forge version 1.2.8
by Chris H. » 11 Jun 2012, 02:34
friarsol wrote:Looks right. I'm not really sure if that conditional matters or not, but it's hard to tell without knowing the goal of that codeblock.Chris H. wrote:I think that we should delete the ";" char which causes the empty statement before the next beta release. Am I right about this situation?
It looks like this class draws the various symbols on top of the cards displayed in the battlefield display.
Mana, attack, defense, foil, phasing, summon sickness, counters, etc.
These symbols are already displayed OK I guess. Shrug.
I think that I may just leave it alone for tomorrow's beta release and then add it in afterwards. If it causes any problems I can then revert. And if it fixes anything we can then release another beta soon thereafter.

Wow, just did a search on the name for this method, getWidth. 110 instances. So it appears to be called from various areas of Doublestrike's new UI code.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Forge version 1.2.8
by Max mtg » 11 Jun 2012, 06:11
Thank you Chris, this was a bug causing a slight misalignment of mana costs without generic part.
I have commited r15868 to address that issue.
It is called from a single place: forge.view.arcane.CardPanel.paintChildren(Graphics).
If you are using Eclipse, invoke the "open call hierarchy" item from the context menu of the method in question to see the its actual callers.
I have commited r15868 to address that issue.
It is called from a single place: forge.view.arcane.CardPanel.paintChildren(Graphics).
If you are using Eclipse, invoke the "open call hierarchy" item from the context menu of the method in question to see the its actual callers.
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Forge version 1.2.8
by Chris H. » 11 Jun 2012, 11:43
Max mtg wrote:If you are using Eclipse, invoke the "open call hierarchy" item from the context menu of the method in question to see the its actual callers.
Ah, I was not sure how to find the callers. Using the search command I found far to many references. The "open call hierarchy" is a nice feature.

-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Forge version 1.2.8
by Rob Cashwalker » 11 Jun 2012, 16:21
Another way to see how a method gets used in context:
Highlight the method name, right-click and select References -> Project.
Highlight the method name, right-click and select References -> Project.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Forge version 1.2.8
by moomarc » 11 Jun 2012, 17:36
@Rob and Max: Thanks for the tips!Rob Cashwalker wrote:Another way to see how a method gets used in context:
Highlight the method name, right-click and select References -> Project.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
23 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 21 guests