myk's code contributions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: myk's code contributions
by myk » 04 Feb 2013, 18:42
I saw the checkin. It's completely understandable. Thanks!
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by myk » 06 Feb 2013, 00:24
After the next beta release, would it be alright if I added some information to setdata.txt (or perhaps blockdata.txt) and related data structures that would indicate for each set/block whether it is a core set? I'm trying to get a better layout for the set filter dialog and it would be useful if I could distinguish core sets from expansion sets.
Also, what is the two-letter code2 used for? I don't see any uses in the source.
Also, what is the two-letter code2 used for? I don't see any uses in the source.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Max mtg » 06 Feb 2013, 06:29
No probmlem at all. As for adding a field to CardEdition class, it's quite simple and does not need to wait till when next beta is released. So you might add it now, if you have time.
Still "core" is property of a set. Blocks might derive that property from the sets they include.
Eclipse has helped me to find code2 useage:
forge.gui.download.GuiDownloadSetPicturesLQ.addCardToList(ArrayList<DownloadObject>, CardPrinted, String)
Still "core" is property of a set. Blocks might derive that property from the sets they include.
Eclipse has helped me to find code2 useage:
forge.gui.download.GuiDownloadSetPicturesLQ.addCardToList(ArrayList<DownloadObject>, CardPrinted, String)
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: myk's code contributions
by myk » 06 Feb 2013, 10:37
Hrm, I did the same search for usage in eclipse and didn't see it. I must have been blind.
Ok, I'll add the info to setdata.txt then. Thanks!
Ok, I'll add the info to setdata.txt then. Thanks!
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Max mtg » 06 Feb 2013, 13:07
Everything is fine, except for set type parsing - it would be better to do so in Reader nested class and pass enum member to constructor.
Code formatting is great.
Code formatting is great.
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: myk's code contributions
by Rob Cashwalker » 06 Feb 2013, 14:00
The 2-letter set code supports finding pictures distributed by the HQ pics team. Older sets only had 2-letter codes, and some of the 3-letter codes they use now aren't the same as the official list of 3-letter codes.
When Forge downloads set-pics, it uses the 3-letter codes for the folder no matter the age of the set.
When Forge downloads set-pics, it uses the 3-letter codes for the folder no matter the age of the set.
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: myk's code contributions
by myk » 06 Feb 2013, 18:05
Max: Thanks! I'll fix up where the enum is parsed.
Rob: Thanks, I see -- I'll add a comment to the code2 field with that explanation.
Rob: Thanks, I see -- I'll add a comment to the code2 field with that explanation.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by friarsol » 07 Feb 2013, 01:47
Hey myk,
It'd be nice to have a filter in Quest mode for packs/decks. So I can filter them out in the same way I can filter out card types.
It'd be nice to have a filter in Quest mode for packs/decks. So I can filter them out in the same way I can filter out card types.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: myk's code contributions
by myk » 07 Feb 2013, 04:27
Ah, the items in the spell shops? Yeah, I think I can stick that filter button in that blank spot under the Total Cards label.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by friarsol » 07 Feb 2013, 04:41
Right, any non-card item, which are generally pre-built decks/boosters/starters etc. I was also was eyeing that giant gaping hole for the spot for filtering out these.myk wrote:Ah, the items in the spell shops? Yeah, I think I can stick that filter button in that blank spot under the Total Cards label.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: myk's code contributions
by moomarc » 07 Feb 2013, 05:51
I'll add a product item to the sprite sheetfriarsol wrote:Right, any non-card item, which are generally pre-built decks/boosters/starters etc. I was also was eyeing that giant gaping hole for the spot for filtering out these.myk wrote:Ah, the items in the spell shops? Yeah, I think I can stick that filter button in that blank spot under the Total Cards label.
EDIT: Done! I've hooked up the icon in FSkin.editorImages and added a commented out basic hook for it in SEditorUtil. I wasn't sure where to go from there to get everything working so I'll leave it at that.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: myk's code contributions
by myk » 07 Feb 2013, 07:55
You're awesome. Thanks, Marc (or do you prefer "moo"?)
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by myk » 07 Feb 2013, 09:51
Bah, why do the simple requests always turn out to be the most complicated? 500 lines into the diff, maybe we should discuss this a bit. Almost all the filters are set up to handle CardPrinted. The entire filter system would need to be overhauled to be based on InventoryItem. This should probably happen, since that is what the tables are, anyway, but there will probably be an explosion of "if (item instanceof CardPrinted)" lines unless we add a bunch of methods to the InventoryItem interface that return null for other types. I might be able to hack it in around the edges, basically by special casing non-CardPrinted items in CCardCatalog, but I'd hate to think I'm contributing to code entropy.
Edit: Ok, the "hacky" way isn't too terrible. Nonetheless I'd be open to changing it if anyone has suggestions on how to make it more elegant. r19452
Edit: Ok, the "hacky" way isn't too terrible. Nonetheless I'd be open to changing it if anyone has suggestions on how to make it more elegant. r19452
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Max mtg » 07 Feb 2013, 10:53
I made a previous version of deckeditor, where all filters worked with boxes, boosters and cards (and I still hate Doublestrike for remaking it with his new look and feel, but ruined features)
Can you give a specific example?
Can you give a specific example?
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: myk's code contributions
by Max mtg » 07 Feb 2013, 10:58
http://svn.slightlymagic.net/websvn/dif ... &peg=19452
That's not good.
com.google.common.base.Predicates.instanceOf(CardPrinted.class)
That's not good.
com.google.common.base.Predicates.instanceOf(CardPrinted.class)
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Who is online
Users browsing this forum: No registered users and 41 guests