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 » 02 Feb 2013, 07:38
I do not believe I can get the filtered deck generation code done before the Monday beta release. It is a much larger task than it originally appeared. The generation code currently makes several assumptions on what kinds of cards are available that just won't generally be true when the pool is pre-filtered. Getting the "random cardpool" button working was easy enough, but actual, playable deck generation is going to take a good bit of refactoring. I'd like to use the next few days to do some more testing of the code I've already written instead, to see if I can squash any bugs before it hits the beta crowd.
- 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 Tygrak » 02 Feb 2013, 11:03
Can I ask you where did you move the import deck button? If you already answered that question, sorry I didn't read the whole topic.
(Also sorry for my english, I am not a native speaker
)
(Also sorry for my english, I am not a native speaker

- Tygrak
- Posts: 18
- Joined: 02 Feb 2013, 10:52
- Has thanked: 0 time
- Been thanked: 0 time
Re: myk's code contributions
by myk » 02 Feb 2013, 11:44
Import deck hasn't moved -- it's behind the "All Decks" tab just like it's always been.
- 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 Tygrak » 02 Feb 2013, 11:59
It dissapeared for me. I have no all decks tab now. In the 1.3.5 beta it is still there but in the daily build it isn't.
- Tygrak
- Posts: 18
- Joined: 02 Feb 2013, 10:52
- Has thanked: 0 time
- Been thanked: 0 time
Re: myk's code contributions
by Chris H. » 02 Feb 2013, 14:11
Tygrak wrote:It dissapeared for me. I have no all decks tab now. In the 1.3.5 beta it is still there but in the daily build it isn't.
Delete the file named "editor_preferred.xml" which can be found in the /res/layouts/ folder and then restart Forge.
-
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
by myk » 02 Feb 2013, 15:40
bah, it means I didn't test my code enough, though. I explicitly wrote code to make sure deleting the file shouldn't be necessary. My own editor_preferred.xml was upgraded without incident. Tygrak, would you happen to have a copy of a "bad" editor_preferred.xml? Did you have a custom layout?
Edit: I played around with "bad" xml files and was unable to reproduce this problem. If anyone else experiences it, please send me your editor_preferred.xml file.
Edit: I played around with "bad" xml files and was unable to reproduce this problem. If anyone else experiences it, please send me your editor_preferred.xml file.
- 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 » 03 Feb 2013, 07:17
i had a similiar crash when a parameter was added into xml file, yet my file didn't have it. So I guess assigning a default value for a missing parameter could partially or completelly solve the problem.
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 RumbleBBU » 03 Feb 2013, 16:12
Not posting from my own computer, so I need to be brief here... (and sorry, cannot post a screenshot.)
A slight problem related to the preset color and card type filter buttons that are now located on the left-hand side in the editor. The problem is that they do not automatically wrap to multiple lines if they do not fit on the panel. Recently, playing on a laptop, 1024x768 resolution, the last ones went off the panel and were not accesible - except by stretching the lefthand panel so much that the middle panel was not really usable.
I think it would be better if the color and card type buttons auto-wrapped like they used to.
A slight problem related to the preset color and card type filter buttons that are now located on the left-hand side in the editor. The problem is that they do not automatically wrap to multiple lines if they do not fit on the panel. Recently, playing on a laptop, 1024x768 resolution, the last ones went off the panel and were not accesible - except by stretching the lefthand panel so much that the middle panel was not really usable.
I think it would be better if the color and card type buttons auto-wrapped like they used to.
Re: myk's code contributions
by myk » 04 Feb 2013, 08:07
Thanks for the new icon, moo! It's much better than the purple blob I had there : )
- 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 moomarc » 04 Feb 2013, 09:10
Glad you like it!
Seems to work well across the different skins that don't have their own icon for it rather well too (can be a pain getting that right for the default sprite).

-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 Max mtg » 04 Feb 2013, 17:14
http://svn.slightlymagic.net/websvn/dif ... &peg=19381
Why have you done this?
Why have you done this?
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 » 04 Feb 2013, 18:10
when I added the bulk move APIs, it seemed wise to make the move explicit and consistent across all APIs that add/remove cards. In general, the pattern went from
for (int i; i < count; ++i) {
add(item);
}
to
add(item, count);
but since adding to a model would then add to a pool, it was too easy to forget to call the two-parameter version for the pool. removing the one-parameter method removed the possibility for that kind of error.
for (int i; i < count; ++i) {
add(item);
}
to
add(item, count);
but since adding to a model would then add to a pool, it was too easy to forget to call the two-parameter version for the pool. removing the one-parameter method removed the possibility for that kind of error.
- 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 » 04 Feb 2013, 18:27
It's definetelly the mistake of one who wrote that cycle.myk wrote:when I added the bulk move APIs, it seemed wise to make the move explicit and consistent across all APIs that add/remove cards. In general, the pattern went from
for (int i; i < count; ++i) {
add(item);
}
to
add(item, count);
but since adding to a model would then add to a pool, it was too easy to forget to call the two-parameter version for the pool. removing the one-parameter method removed the possibility for that kind of error.
I do not want that one-parameter version removed from ItemPool, because that overload is there by design. Also a lot of other code uses that pool and it becomes unconvinient to develop when you are obliged to supply that extra parameter.
I have already reverted that change for the core classes affected, but kept your changes to GUI-related classes. See the changes at http://svn.slightlymagic.net/websvn/rev ... &peg=19382
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 46 guests