CardDb exception
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
41 posts
• Page 2 of 3 • 1, 2, 3
Re: CardDb exception
by Sloth » 01 Sep 2011, 20:39
Yes, but only with a limited card pool.Max mtg wrote:Sorting resets when a card is taken away from the cardpool in top table, right?
In constructed (full card pool) it won't reset.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: CardDb exception
by Max mtg » 01 Sep 2011, 21:10
That's reasonable, beacuse in constructed when cardpool is unlimited, cards are not removed from the upper list, it is not updated and sorted overSloth wrote:Yes, but only with a limited card pool.Max mtg wrote:Sorting resets when a card is taken away from the cardpool in top table, right?
In constructed (full card pool) it won't reset.

So the difference in sort order you see is because the tableModel remembers sort order 1 level deep. Like "sort only by color, regardless of others", while originally it was sorted by color, then name... It isn't hard to make a cascade table sorter
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: CardDb exception
by Max mtg » 01 Sep 2011, 22:11
fixed at r10150Sloth wrote:Yes, but only with a limited card pool.Max mtg wrote:Sorting resets when a card is taken away from the cardpool in top table, right?
In constructed (full card pool) it won't reset.
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: CardDb exception
by friarsol » 02 Sep 2011, 01:24
I'm kinda confused about the new sorting by color. The ordering is not logical and completely different than it used to be.
This is the ordering it appears to be:
Colorless
White
Blue
Black
Multi
Red
Green
Where did this order come from and why was it changed from the alphabetical order it used to be?
It also appears that my Quest file I played last night is no longer supported?
This is the ordering it appears to be:
Colorless
White
Blue
Black
Multi
Red
Green
Where did this order come from and why was it changed from the alphabetical order it used to be?
It also appears that my Quest file I played last night is no longer supported?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: CardDb exception
by Max mtg » 02 Sep 2011, 08:53
This comes from the order cards are numbered throughout a set, though it was not always working.friarsol wrote:I'm kinda confused about the new sorting by color. The ordering is not logical and completely different than it used to be.
Where did this order come from and why was it changed from the alphabetical order it used to be?
It also appears that my Quest file I played last night is no longer supported?
Since r10169 the order is: W U B R G multi colorless
just same as here: http://magiccards.info/cfx/en.html
Old questfile is not supported ATM. I'm trying to add support for outdated quest format
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: CardDb exception
by Max mtg » 02 Sep 2011, 09:36
@10171 old quest saves are supported again (saves from 10146 till 10151 are NOT supported)
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: CardDb exception
by Sloth » 02 Sep 2011, 09:55
When I finish a quest match and chose legacy as price booster, I get this:
- | Open
- java.lang.NullPointerException
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:155)
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:1)
at net.slightlymagic.maxmtg.Predicate$NodeAnd.isTrue(Predicate.java:219)
at net.slightlymagic.maxmtg.Predicate.random(Predicate.java:124)
at forge.quest.data.QuestBoosterPack.generateDistinctCards(QuestBoosterPack.java:163)
at forge.quest.data.QuestBoosterPack.generateCards(QuestBoosterPack.java:185)
at forge.quest.data.QuestData.addCards(QuestData.java:346)
at forge.Gui_WinLose.giveBooster(Gui_WinLose.java:391)
at forge.Gui_WinLose.giveQuestRewards(Gui_WinLose.java:401)
at forge.Gui_WinLose.quitButton_actionPerformed(Gui_WinLose.java:350)
at forge.Gui_WinLose$3.actionPerformed(Gui_WinLose.java:145)
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: CardDb exception
by Max mtg » 02 Sep 2011, 10:53
@10173 no longer happensSloth wrote:When I finish a quest match and chose legacy as price booster, I get this:
- | Open
- java.lang.NullPointerException
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:155)
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:1)
at net.slightlymagic.maxmtg.Predicate$NodeAnd.isTrue(Predicate.java:219)
at net.slightlymagic.maxmtg.Predicate.random(Predicate.java:124)
at forge.quest.data.QuestBoosterPack.generateDistinctCards(QuestBoosterPack.java:163)
at forge.quest.data.QuestBoosterPack.generateCards(QuestBoosterPack.java:185)
at forge.quest.data.QuestData.addCards(QuestData.java:346)
at forge.Gui_WinLose.giveBooster(Gui_WinLose.java:391)
at forge.Gui_WinLose.giveQuestRewards(Gui_WinLose.java:401)
at forge.Gui_WinLose.quitButton_actionPerformed(Gui_WinLose.java:350)
at forge.Gui_WinLose$3.actionPerformed(Gui_WinLose.java:145)
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: CardDb exception
by friarsol » 02 Sep 2011, 13:37
Wow. The Deck Editor undoing the sorting on card movement is a terrible UI experience. Here's my situation:
Started a new quest and want to sell off most of my collection except for my built deck (something I do everytime I start a new quest).
Sort by color, so I can find cards that I know aren't in my deck faster:
Click on top card.
Click sell.
Card sells, but my list "unsorts" while I was just on White cards selling, now a Black card that I know is in my Deck is first on the list and highlighted. It's not apparent that the card I just tried to sell was sold (since the cards near it have been shuffled).
Next I have to click Color twice (because the editor itself thinks its sorted) to get the sort back to how I want. But the next card I sell does the same thing.
If I leave the deck in the "unsorted" state I can sell just fine, but then I need to actually read each card to remember if it was in my deck or not.
Started a new quest and want to sell off most of my collection except for my built deck (something I do everytime I start a new quest).
Sort by color, so I can find cards that I know aren't in my deck faster:
Click on top card.
Click sell.
Card sells, but my list "unsorts" while I was just on White cards selling, now a Black card that I know is in my Deck is first on the list and highlighted. It's not apparent that the card I just tried to sell was sold (since the cards near it have been shuffled).
Next I have to click Color twice (because the editor itself thinks its sorted) to get the sort back to how I want. But the next card I sell does the same thing.
If I leave the deck in the "unsorted" state I can sell just fine, but then I need to actually read each card to remember if it was in my deck or not.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: CardDb exception
by Max mtg » 02 Sep 2011, 13:55
got it, will fix in another patch today
The deckeditor evolution is not over yet. I'm actually organizing tables with cards as separate components.
The deckeditor evolution is not over yet. I'm actually organizing tables with cards as separate components.
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: CardDb exception
by friarsol » 02 Sep 2011, 15:54
Great thanks for patching. Another thing I noticed in quest mode is that the "sort by new" feature has been removed. So even though I did just see all the cool cards I just won, i now have to remember what i wanted to add to my deck.
Maybe instead of overwriting the Rarity, we can add a "acquired" field for Quests decks, and be able to sort by when cards were acquired?
Maybe instead of overwriting the Rarity, we can add a "acquired" field for Quests decks, and be able to sort by when cards were acquired?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: CardDb exception
by Max mtg » 02 Sep 2011, 18:00
See revision 10181+ for fixes with sortingfriarsol wrote:Great thanks for patching. Another thing I noticed in quest mode is that the "sort by new" feature has been removed. So even though I did just see all the cool cards I just won, i now have to remember what i wanted to add to my deck.
Maybe instead of overwriting the Rarity, we can add a "acquired" field for Quests decks, and be able to sort by when cards were acquired?
Yes, the column marking 'new' was removed. This is a temporary means as well.
Now, when deckeditors' code became much cleaner, I can add this data to upper table as a separate column
BTW, would you like me to add a column in cardshop, that marks how may decks use the given card in the 'owned list'?
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: CardDb exception
by friarsol » 02 Sep 2011, 18:46
That's handy. I think there is an Issue open regarding this where I suggested it might be easier to be able to sell from the Deck Editor. But if the ultimate goal is to clean those up, having the cardshop report deck appearances would be almost as good.Max mtg wrote:BTW, would you like me to add a column in cardshop, that marks how may decks use the given card in the 'owned list'?
http://cardforge.org/bugz/view.php?id=102
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: CardDb exception
by Max mtg » 02 Sep 2011, 18:59
Thanks for this issue reference.friarsol wrote:That's handy. I think there is an Issue open regarding this where I suggested it might be easier to be able to sell from the Deck Editor. But if the ultimate goal is to clean those up, having the cardshop report deck appearances would be almost as good.Max mtg wrote:BTW, would you like me to add a column in cardshop, that marks how may decks use the given card in the 'owned list'?
http://cardforge.org/bugz/view.php?id=102
Yes, you can just sort by #decks and sell all that cards that would have 0 or blank value there;
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: CardDb exception
by Max mtg » 02 Sep 2011, 22:54
10182 - added a column with number of decks.
May I close issue 102 with that?
May I close issue 102 with that?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
41 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 68 guests