It is currently 22 May 2025, 22:45
   
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 Max mtg » 12 Feb 2013, 18:58

does not crash now, yet a different effect happens
see video from http://www.mediafire.com/?kpe9mg46g58klvd
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 » 12 Feb 2013, 19:41

It seems that video was encoded with the Camtasia tscc codec, which is Windows-only : ( Could you possibly export the video with another codec?
http://techsmith.custhelp.com/app/answers/detail/a_id/154/related/1/session/L2F2LzEvdGltZS8xMzYwNjk3OTIyL3NpZC9wM0JockhpbA%3D%3D
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 » 12 Feb 2013, 19:48

Will this work better?
Last edited by Max mtg on 12 Feb 2013, 21:56, edited 1 time in total.
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 » 12 Feb 2013, 21:09

yes, thanks. and humbug. That is actually what happens on my system as well if I force it down that path instead of using the value returned by SwingUtilities.getRoot().

After reading the jdk source code, I believe I have found the answer -- setting the popup owner to null. Could you try it once more? (my apologies for the time this is taking : / )
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 » 12 Feb 2013, 21:55

works now!

does it search by checking if substring is present? That leads to some unexpected result. I think matching only the beginning of cardname would be better
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 » 13 Feb 2013, 01:19

It currently matches a substring. This allows for a card to be found even if the entire name isn't remembered. I can see how both modes could be useful, and I can also see how either mode could be confusing. It could also be argued that if a user wants a substring search, they should be using the text filter (ctrl-F), not the find feature. Does anyone else have an opinion on what is expected from a 'find-as-you-type' feature?
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 friarsol » 13 Feb 2013, 04:09

myk wrote:It currently matches a substring. This allows for a card to be found even if the entire name isn't remembered. I can see how both modes could be useful, and I can also see how either mode could be confusing. It could also be argued that if a user wants a substring search, they should be using the text filter (ctrl-F), not the find feature. Does anyone else have an opinion on what is expected from a 'find-as-you-type' feature?
While I understand that substring could provide results that were unexpected, it would also simplify finding certain card names much more easily. The 120 different cards that start with "Goblin" would need to be typed out instead of just typing "Sap" to get Goblin Sappers. I always think the card Mogg Fanatic is actually called Goblin Fanatic, but whenever I search it on magiccards.info I just type "Fanatic" and the right name comes up.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: myk's code contributions

Postby moomarc » 13 Feb 2013, 05:07

I'm also in favor of matching the substring. It's handy when your brain decides to block out the fact that a card's name startes with 'The '.
-Marc
User avatar
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

Postby Max mtg » 13 Feb 2013, 06:54

as I hit escape while focusing the table I get some strange red symbol appear in the popup (while expecting the popup to fade away)

I have also commited a change to DeckEditorUI. Since strings are immutable, every toUpper/toLower allocates a new instance. That's not neccesary if case-invariant comparisons are provided by libraries - see 19566
Attachments
fsearch.png
fsearch.png (8.22 KiB) Viewed 3295 times
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 » 13 Feb 2013, 08:22

good suggestion on the StringUtils and testing for asciiprintables -- there aren't any non-ascii names, right? Even the "AE" glyph is found by looking for a followed by e.

Does esc not work for you at all? Could you test to see what key code you get in keyPressed() when you hit escape?

btw, the red coloring indicates the substring was not found in the table. Try typing Goblinaaaaa and you can see the text shift from white to red, and back to white when you backspace over the aaaaa
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 » 13 Feb 2013, 09:46

ESC does clear the previously entered string, but adds that character (screenshot) to the empty line. Char code must be VK_ESCAPE.
After you have applied that character filter, it works properly.

myk wrote:btw, the red coloring indicates the substring was not found in the table. Try typing Goblinaaaaa and you can see the text shift from white to red, and back to white when you backspace over the aaaaa
thanks, Captain :)
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 friarsol » 13 Feb 2013, 13:17

myk wrote:good suggestion on the StringUtils and testing for asciiprintables -- there aren't any non-ascii names, right? Even the "AE" glyph is found by looking for a followed by e.
Forge only uses ascii characters for card names. There are a few cards that do have non-ascii characters that get "simplified" to ascii. AEther Storm, Junun Efreet, El-Hajjaj, Ghazban Ogre, etc.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: myk's code contributions

Postby myk » 13 Feb 2013, 23:39

Quick question: is there any reason why Command doesn't extend Runnable?
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 » 15 Feb 2013, 09:47

Hi all,

I've been keeping a list of things I see that I think could use some love. Does anyone have opinions on the order in which they should be done? Anything on here that people think should not be touched or want to do themselves? Any specific requests for UI or UE (User Experience) issues that I've missed?
  • cards labeled NEW compared to last time deck was edited (cards get a lastAcquired timestamp (only updated for first four copies, probably ok not to special case lands and relentless rats), decks get lastModified, compare on display)
  • show related card when hovering over the stack item for a target effect
  • remember deck editor column order
  • combine Duels and Challenges into one page, with challenges taking up the top slots in the duels list (visually differentiate from duel opponents)
  • add dragtab windows to default place if they're missing in the editor_preferred.xml file
  • move user preferences and downloadable content out of program directory so they are persisted across upgrades when users decompress to a different path (no more "pic import" steps or copying over of preferences)
  • sort indicator for table columns with highest sort priority
  • consolidate sideboard listview items so multiple copies of cards don't take up an extra line, just show qty name
  • configuration dialog for sound. can play each sound, turn it on/off, configure global volume
  • for each screen/dialog:
    • set useful default widget focus on show
    • ensure correct tab-focus order
    • attach keylisteners for useful enter/space,arrow hotkeys
  • enable tabbing through cards in match, activating them with space, enter from anywhere activates default button (ok, usually)
  • save deck editor filter settings per deck
  • don't propagate changes to current quest deck when you select 'no' at the save prompt
  • move Import deck functionality to a button on the Current Deck tab
  • keep remaining items selected in tables when some items disappear due to a move operation
  • make deck generation restricted by current filter
  • quest deck generation
  • remove Command, use existing Runnable
  • integrate Foreroes new sounds
  • show how many cards are being hidden by the current filter

current task:
r-click menu and functionality for filter widgets (edit, change options, temporarily disable)
Last edited by myk on 15 Feb 2013, 11:33, edited 1 time in total.
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 » 15 Feb 2013, 09:56

very cool.
My only concern is: do not modify deck class.

I saw the only unique feature for Command class - that it is Serializable. Don't know why this inheritance is needed.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 23 guests


Who is online

In total there are 23 users online :: 0 registered, 0 hidden and 23 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 23 guests

Login Form