New developer - search filters enhancement ready
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
16 posts
• Page 1 of 2 • 1, 2
New developer - search filters enhancement ready
by drdev » 27 Jul 2013, 06:57
First off, a quick introduction since I'm new. I've been employed as a full time software developer since graduating college almost 5 years ago with a CS degree. I've been playing Magic since high school, including playing MTGO since 8th edition was released (would have been v2.0 or v2.5 then). As a programmer with a particular interest in UI design and development, it's been hard to watch MTGO continue to struggle to provide a good user experience version after version, always feeling I could do better myself. Given that, I was very happy to stumble upon this project the other day. It seems like the perfect opportunity to contribute to an effort I believe in. I'm also quite impressed with what's already done.
After going through all the development setup (thanks for outlining that so well by the way), I decided I'd start with a simple fix/enhancement to the deck editor. A feature I like about the color and card type filters in MTGO v3 is the ability to right-click on a filter to show only cards of that color/type. I noticed the lack of this support almost immediately my first time using the deck editor. I also noticed that right and middle clicks were treated the same as left clicks on all the buttons and that sometimes clicking multiple filters quickly didn't seem to register each click.
The changes are pretty simple. Just check the mouse button in the mouse event handlers, calling the existing command handler for the left mouse button, doing nothing (at least for now) with the middle button, and calling a new right-click command for the right mouse button. I added a new "group" property to the StatTypes enum for distinguishing between color and card type stat types and then hooked into the right-click command for each color and card type filter button to set the selected state of the right-clicked button to true and the selected states of all other buttons in the same group to false before applying the filters. Combined with a tweak to use mouseReleased instead of mouseClicked (which previously made any effort to click multiple buttons quickly often fail because you moved the mouse a pixel between mouse down and mouse up), using the filters is much snappier now. I also extended the tooltip for each button to mention the right-click behavior.
I've applied to join the Developers - Forge group already, so as soon as I'm accepted I'm ready to commit this. Is there anything more I need to do, or any concerns about the changes I'd be committing?
Thanks again for this opportunity.
-Dan
After going through all the development setup (thanks for outlining that so well by the way), I decided I'd start with a simple fix/enhancement to the deck editor. A feature I like about the color and card type filters in MTGO v3 is the ability to right-click on a filter to show only cards of that color/type. I noticed the lack of this support almost immediately my first time using the deck editor. I also noticed that right and middle clicks were treated the same as left clicks on all the buttons and that sometimes clicking multiple filters quickly didn't seem to register each click.
The changes are pretty simple. Just check the mouse button in the mouse event handlers, calling the existing command handler for the left mouse button, doing nothing (at least for now) with the middle button, and calling a new right-click command for the right mouse button. I added a new "group" property to the StatTypes enum for distinguishing between color and card type stat types and then hooked into the right-click command for each color and card type filter button to set the selected state of the right-clicked button to true and the selected states of all other buttons in the same group to false before applying the filters. Combined with a tweak to use mouseReleased instead of mouseClicked (which previously made any effort to click multiple buttons quickly often fail because you moved the mouse a pixel between mouse down and mouse up), using the filters is much snappier now. I also extended the tooltip for each button to mention the right-click behavior.
I've applied to join the Developers - Forge group already, so as soon as I'm accepted I'm ready to commit this. Is there anything more I need to do, or any concerns about the changes I'd be committing?
Thanks again for this opportunity.
-Dan
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: New developer - search filters enhancement ready
by Sloth » 27 Jul 2013, 08:00
Welcome Dan,
we don't have a lead UI developer at the moment and i'm not very proficient in that part of our code, but your changes sound promising, so if nobody objects i will grant you commit rights tomorrow.
we don't have a lead UI developer at the moment and i'm not very proficient in that part of our code, but your changes sound promising, so if nobody objects i will grant you commit rights tomorrow.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: New developer - search filters enhancement ready
by friarsol » 27 Jul 2013, 14:21
Sounds good to me. It'd be great to have someone interested in the UI to join the team.
Just curious since I've never used mtgo, is this an exclusive search? Or is this just toggling off all of the other filters when you right click?
Just curious since I've never used mtgo, is this an exclusive search? Or is this just toggling off all of the other filters when you right click?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: New developer - search filters enhancement ready
by Chris H. » 27 Jul 2013, 15:40
Good to meet you Dan.
Yes, we can always use a hand in the UI department.

Yes, we can always use a hand in the UI department.
-
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: New developer - search filters enhancement ready
by drdev » 27 Jul 2013, 15:57
That sounds great. Although I find the card programming and AI fascinating, my main interest is working on the UI. I'd be happy to contribute.
friarsol, right clicking "red cards" for example will show only mono-red cards by toggling on all other color filters and ensuring the "red cards" filter is off.
The next area I'm interested in would be adding a card view to the deck editor. While I like the list view for the card pool, I think it's easier to build a deck when you can see the cards organized in piles, with options to sort into piles by CMC or color, plus the ability to manually drag drop cards into custom piles.
I saw the post about Card Zoom that made it seem like this was already possible in deck editor, but I couldn't access anything but list view. Let me know if this feature already exists (and how to access it) otherwise I'd love to tackle it.
friarsol, right clicking "red cards" for example will show only mono-red cards by toggling on all other color filters and ensuring the "red cards" filter is off.
The next area I'm interested in would be adding a card view to the deck editor. While I like the list view for the card pool, I think it's easier to build a deck when you can see the cards organized in piles, with options to sort into piles by CMC or color, plus the ability to manually drag drop cards into custom piles.
I saw the post about Card Zoom that made it seem like this was already possible in deck editor, but I couldn't access anything but list view. Let me know if this feature already exists (and how to access it) otherwise I'd love to tackle it.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: New developer - search filters enhancement ready
by spr » 27 Jul 2013, 21:31
Hi Dan,drdev wrote:...I saw the post about Card Zoom that made it seem like this was already possible in deck editor, but I couldn't access anything but list view. Let me know if this feature already exists (and how to access it) otherwise I'd love to tackle it.
The Card Zoom simply lets you view a single card at its original size or greater. Your proposal seems a lot more complicated! I did have a go at a rudimentary card carousel (see pic) since I was interested in the technique but performance left a lot to be desired especially from about 30 cards onwards.
Cheers,
Steve
Re: New developer - search filters enhancement ready
by moomarc » 27 Jul 2013, 21:33
All sounds great. I've gone ahead and approved you for commit rights. Welcome aboard! 

-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: New developer - search filters enhancement ready
by drdev » 27 Jul 2013, 21:50
Awesome thanks. I'll go ahead ahead and commit the filters enhancement right now.
With that, I have a few questions if anyone could answer them:
-Are there any legal concerns for Forge right now? I read some older posts mentioning issues in 2009 and 2011. If there are concerns, how would they affect me for contributing (if at all)?
-If I have design or development questions, should I create a forum post, pm somebody (if so, who?), or use some other means of communication?
-Do I need to notify anyone before committing in the future, or is it enough to just ensure the SVN trunk is up to date and everything compiles?
-Why does each view (home screen, deck editor, play screen) take up the whole window with no way to navigate between them or back to the previous view without "closing" the window? Have navigation tabs been considered?
Thanks.
-Dan
With that, I have a few questions if anyone could answer them:
-Are there any legal concerns for Forge right now? I read some older posts mentioning issues in 2009 and 2011. If there are concerns, how would they affect me for contributing (if at all)?
-If I have design or development questions, should I create a forum post, pm somebody (if so, who?), or use some other means of communication?
-Do I need to notify anyone before committing in the future, or is it enough to just ensure the SVN trunk is up to date and everything compiles?
-Why does each view (home screen, deck editor, play screen) take up the whole window with no way to navigate between them or back to the previous view without "closing" the window? Have navigation tabs been considered?
Thanks.
-Dan
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: New developer - search filters enhancement ready
by Chris H. » 27 Jul 2013, 22:34
Rares, the original dev, applied for a job at wotc and foolishly mentioned his Forge project and as a result he received a c&d notice. As they say, do not wake the sleeping bear.
We tend to prefer having our dev discussions take place in the open.

We tend to prefer having our dev discussions take place in the open.
-
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: New developer - search filters enhancement ready
by Sloth » 28 Jul 2013, 06:43
Contributing to Forge shouldn't cause legal concerns. Hosting/spreading could though, because the rules/game system of Magic have a copyright (WotC). In a lot of countries rules can't be protected by copyright laws, for example Russia (where slightlymagic.net is located) or Germany.drdev wrote:-Are there any legal concerns for Forge right now? I read some older posts mentioning issues in 2009 and 2011. If there are concerns, how would they affect me for contributing (if at all)?
Forum post.drdev wrote:-If I have design or development questions, should I create a forum post, pm somebody (if so, who?), or use some other means of communication?
If you feel save that your changes do not warrant any discussion, you can just commit it.drdev wrote:-Do I need to notify anyone before committing in the future, or is it enough to just ensure the SVN trunk is up to date and everything compiles?
Doublestrike (the creator of most of the current UI) has been absent for a long time now. I can't really remember what has been discussed and what fell under "it works so leave it like it is".drdev wrote:-Why does each view (home screen, deck editor, play screen) take up the whole window with no way to navigate between them or back to the previous view without "closing" the window? Have navigation tabs been considered?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: New developer - search filters enhancement ready
by moomarc » 28 Jul 2013, 13:02
Only thing extra I can add to Sloth's comments is to keep an eye on the targeted release dates. If anything might potentially introduce game breaking bugs, avoid committing that piece until just after the release so the daily build users have a better chance of picking up problems.
-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: New developer - search filters enhancement ready
by drdev » 28 Jul 2013, 16:10
Sounds like there's plenty I could work on. Cool. Have there been any recent discussions regarding desired UI design changes or other wish list items related to UI? Ideally I'd like to gather input before attempting any major changes to the existing UI (such as adding navigation tabs).
I will try not to commit large changes to close to target release dates. So far I've only been committing bug fixes and minor enhancements while I familarize myself with the code base, and I do thoroughly test before committing anything.
I will try not to commit large changes to close to target release dates. So far I've only been committing bug fixes and minor enhancements while I familarize myself with the code base, and I do thoroughly test before committing anything.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: New developer - search filters enhancement ready
by Max mtg » 28 Jul 2013, 18:17
WotC own US patent on game rules, worldwide copyright on card's art, and have also trademarked some of their planes walkers' names (besides the registered trademarks for the game title itself and probably its expansions).Sloth wrote:Contributing to Forge shouldn't cause legal concerns. Hosting/spreading could though, because the rules/game system of Magic have a copyright (WotC). In a lot of countries rules can't be protected by copyright laws, for example Russia (where slightlymagic.net is located) or Germany.drdev wrote:-Are there any legal concerns for Forge right now? I read some older posts mentioning issues in 2009 and 2011. If there are concerns, how would they affect me for contributing (if at all)?
Which of them could one violate writing java code implementing the game rules? None I suppose.
This site seems to be hosted in Germany, while the head admninstrator lives most likely in Russia.
Doublestrike left quite a contradictive legacy: on one side his work has renewed forge's UI and made it look less alike a common application and brought flexibility like resizable panels and docking tabs. On another, side the code quality, like total use of singletons, overloading swing's methods with his own implementations serving a different purpose, leaves a lot of questions behind.
So, my personal position is to welcome any changes that would replace that singletons-based architecture and provide a better implementation for the common tasks the UI solves.
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: New developer - search filters enhancement ready
by Chris H. » 29 Jul 2013, 12:44
Two things on the UI front that I would like to see addressed.
We need to decide on a minimum screen size which in the past was 800 x 600. And we should make sure that all of the components in a view are visible at the minimum size. Some components have been added to various views in recent months that make some of the views unusable at 800 x 600.
We should try to make sure that the game looks OK under the Mac OS. This can be a challenge. The Java that is released for Mac OS has hooks into the Mac OS GUI elements. This allows Java apps to look more Mac like under Mac OS but some of the tricks that can be performed with swing under unix/widows look bad when viewed under Mac OS.
We need to decide on a minimum screen size which in the past was 800 x 600. And we should make sure that all of the components in a view are visible at the minimum size. Some components have been added to various views in recent months that make some of the views unusable at 800 x 600.
We should try to make sure that the game looks OK under the Mac OS. This can be a challenge. The Java that is released for Mac OS has hooks into the Mac OS GUI elements. This allows Java apps to look more Mac like under Mac OS but some of the tricks that can be performed with swing under unix/widows look bad when viewed under Mac OS.
-
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: New developer - search filters enhancement ready
by drdev » 29 Jul 2013, 14:00
I would be willing to look into the minimum screen size concerns, but I don't have access to a Mac for testing Mac display. Do other developers on this project work on a Mac?
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
16 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 29 guests