It is currently 22 May 2025, 16:05
   
Text Size

myk's code contributions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: myk's code contributions

Postby ArsenalNut » 29 Jan 2013, 07:03

myk wrote:
ArsenalNut wrote:I would suggest making three separate input fields for Name, Text, and Type so you can do more complex searches like "goblins with haste".

If you haven't played with the Advanced search mode of the Gatherer, you might want to look at it. I really like the way you can build up the logic for the search. I use the rules text search functionality all the time to find cards with similar effects when scripting new cards. I also like the way the types and subtypes are actually list boxes instead of free text.
I just took a look at the advanced search page for Gatherer -- there definitely is some good functionality there. It would take a separate UI page to implement, though. Not to say it can't be done -- it could be implemented in a dialog that comes up when you select "Advanced search" from the "Filter by" popup menu. The advanced search would be added to the restriction list just like the other restrictions.

I'd like to point out, though, that in this design you /can/ search for goblins with haste: searches are stackable. Type in Goblin, check type and uncheck the others, hit ctrl-enter. this will add that restriction to the filter stack and clear the search textbox. Then type in haste, check text and uncheck type.
#-o I hadn't read the thread completely so I missed the stackable filters part. That is a definite step up.

I think most of the useful functionality of the Gatherer is covered by what is currently implemented and what you are planning to add. I was thinking more of the actual Gatherer's UI implementation with the and/or/not pull down and the add button. For me the add button would more intuitive than Ctrl-Enter but I'll get used to whatever is implemented. I personally like list boxes for enumerated lists like subtype so I don't fat finger free text in my search. I do that enough with card names :D
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: myk's code contributions

Postby Chris H. » 29 Jan 2013, 17:25

myk wrote:Thoughts? Suggestions? The code is currently just the UI elements, and currently don't actually do anything other than appear and disappear. If this looks good, though, I'll start on hooking up the plumbing and moving the code from its current jumble in the view to appropriate places in the controller.
 
I am not an expert in UI design by any means. :)

I like the idea of having a basic and an advanced type of set up. Click on a checkbox titled Advanced Filters would add in additional filter options. Might not be practicle.

At some point we will need to add in some of your work so that we can let the masses play test and they can then get back to us with their creative ideas.
User avatar
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: myk's code contributions

Postby myk » 29 Jan 2013, 17:32

ok, let me write up the plumbing, then, and get the point where we can merge.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby Hellfish » 29 Jan 2013, 17:50

Since you're doing extensive deck editor work, myk, I was wondering if you have any thoughts regarding Variants and sideboards in deck editors?

Currently, there are editors for Scheme decks and Planar decks separately but none to "bake" default scheme/planar decks into regular decks, like in the decks gos release.There is also the matter of having the ability to edit the sideboard, with or without Variant decks.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: myk's code contributions

Postby myk » 29 Jan 2013, 19:29

Hellfish wrote:Since you're doing extensive deck editor work, myk, I was wondering if you have any thoughts regarding Variants and sideboards in deck editors?

Currently, there are editors for Scheme decks and Planar decks separately but none to "bake" default scheme/planar decks into regular decks, like in the decks gos release.There is also the matter of having the ability to edit the sideboard, with or without Variant decks.
Unfortunately, I don't have enough experience yet with scheme and planar decks to have a solid opinion on what should be done, but making the sideboard easier to use is definitely on my radar.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby myk » 29 Jan 2013, 21:43

I'm implementing dynamic retrieval of quest world restrictions, and I have a quick question: why is the Main world's GameFormatQuest object null?
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby Max mtg » 29 Jan 2013, 21:57

myk wrote:I'm implementing dynamic retrieval of quest world restrictions, and I have a quick question: why is the Main world's GameFormatQuest object null?
GameFormatQuest AFAIR holds restrictions for cards that one can win in that world.
Probably it's null due to no restriction applied.
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

Postby myk » 29 Jan 2013, 22:08

That is not the case for my current quest. My quest data file includes, for example:
Code: Select all
  <format>
    <format name="Standard" unlocksUsed="2" canUnlock="1"/>
    <set s="ISD"/>
    <set s="DKA"/>
    <set s="AVR"/>
    <set s="M13"/>
    <set s="RTR"/>
    <set s="M12"/>
    <set s="PC2"/>
  </format>
  <mode>Fantasy</mode>
  <worldId>Main world</worldId>
but when I call:
Code: Select all
                for (final QuestWorld w : Singletons.getModel().getWorlds()) {
                    addMenuItem(world, w.getName() + " world", !isActive(activeWorlds, w), null, new Command() {
                        @Override
                        public void execute() {
                            addRestriction(buildWorldRestriction(w), activeWorlds, w);
                        }
                    });
                }
I get a NPE when I get down to the main world (Shandalar and Jamuraa have non-null formats as expected)

Edit: ah, I think I see. getWorlds() will only get me the definitions in worlds.txt. I need to go through QuestData to get the custom global format.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby myk » 30 Jan 2013, 19:16

ok, I'm just about ready to merge my code to trunk. I had gone through and added appropriate subversion properties to source files (e.g. svn:eol-style native, setting mime types, etc), but I realize now that it will make the diff almost impossible to read: marking the line endings as native will make the entire file appear in the diff (at least on WebSVN. you can ignore whitespace change if diffing from the commandline), so I'll nix that part of the merge and just copy over the modified files instead of doing a svn merge --reintegrate. Here's the list of changes:

- fixed resize cursor not appearing when hovering between columns in table headers
- added forge-specific spinner widget (FSpinner)
- allowed labels to have their toggle state read externally and added configuration to set whether the onClick command is executed on mouse button down or mouse button up (FLabel)
- added builder pattern to FTextField and autoset properties to common values
- fixed header comments in WrapLayout
- renamed DialogCustomFormat to the more generic DialogChooseSets since I use it now from the filters too; extended its functionality to run a specified command on ok button click
- removed Filters dockable panel
- added old filters functionality to the stats buttons above the catalog table (stats can no longer be removed via a preference setting)
- combined scattered metadata about the filters (e.g. icon, label, filter predicate) into a single enum
- rewrote filter utility functions to not have any side effects (they now use no global data/singletons)
- added "Owned" column to spell shop catalog, indicating number of cards already owned by player (can remove column with preference)
- don't count the "click" as a sort command when resizing a column
- exposed top-level main world custom format in QuestController -- other format-retrieving methods would be masked by the current world selection
- added utility fn to TextUtils to create a (locale-independent) Title out of an ENUM
- added a templated Pair<T, V> utility class for ad-hoc two-value parameter returning
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby myk » 30 Jan 2013, 22:10

committed to trunk. tell me if you have any issues with it!
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby Chris H. » 31 Jan 2013, 00:04

myk wrote:committed to trunk. tell me if you have any issues with it!
 
I updated my local copy to rev 19299 and checked out the deck editor. I like it and being able to check it out first hand helps me to visualize your changes.

In the past several people commented that they were not able to find the search feature. It was there in a tab named filters and there was no tab named search. :wink: It should now be far easier for people to find.

Might want to move the add card buttons down and to move the filter text box up.

Overall I like what I see so far.
User avatar
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: myk's code contributions

Postby Sloth » 31 Jan 2013, 08:49

myk wrote:committed to trunk. tell me if you have any issues with it!
I like it. Good work myk!
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: myk's code contributions

Postby Max mtg » 31 Jan 2013, 11:38

myk wrote:- added a templated Pair<T, V> utility class for ad-hoc two-value parameter returning
That's wrong.

There are already such classes:
Code: Select all
org.apache.commons.lang3.tuple.ImmutablePair<L, R>
org.apache.commons.lang3.tuple.MutablePair<L, R>
both are descendants to
Code: Select all
org.apache.commons.lang3.tuple.Pair<L, R>
which in turn implements well-known
Code: Select all
java.util.Map.Entry<K, V>
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

Postby myk » 31 Jan 2013, 16:25

tuple.Pair is exactly what I was looking for. Thanks! Fixed in r19310.

Chris: I play tested moving the add buttons below the search bar, but it seemed I was racking up more "mouse mileage" than having it the other way around. Moreover, the modifications to the UI that the spell shop makes would look strange (IMHO) if they were below the search bar and the restriction markers. I'd kind of like to get it out to users and start cataloging some user opinions before I make too many more changes.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: myk's code contributions

Postby Chris H. » 31 Jan 2013, 20:46

myk wrote:Chris: I play tested moving the add buttons below the search bar, but it seemed I was racking up more "mouse mileage" than having it the other way around. Moreover, the modifications to the UI that the spell shop makes would look strange (IMHO) if they were below the search bar and the restriction markers. I'd kind of like to get it out to users and start cataloging some user opinions before I make too many more changes.
 
Ah, sounds good to me. :)

myk wrote:At this point, I'm just making minor adjustments and adding bits of functionality here and there as I play test the changes. Is there anything specific you think needs to be done before a release?
 
Just for the heck of it I minimized the forge window down to 800 x 600 pixels. Some things are being drawn outside of the panels. The previous deck editor had similar issues.

Not sure how to handle this one. Might make sense to move the panels around until we get a layout that is friendly to small sized displays. Or we can just let people move them around themselves.
 
Attachments
Screen Shot.png
deck editor with default prefs at 800 x 600 pixels
User avatar
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

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 15 guests


Who is online

In total there are 15 users online :: 0 registered, 0 hidden and 15 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 15 guests

Login Form