It is currently 05 Sep 2025, 17:15
   
Text Size

SVN

Post MTG Forge Related Programming Questions Here

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

SVN

Postby DennisBergkamp » 12 Oct 2009, 17:20

So, I've actually uploaded my latest local source onto the google repository! Now, I don't really know how to use this stuff, but it's a start, at least :mrgreen:

http://code.google.com/p/cardforge/
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby nantuko84 » 12 Oct 2009, 18:02

my congratulations! ;)
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: SVN

Postby nantuko84 » 12 Oct 2009, 20:42

I've downloaded the source code and made some changes in deck editor to filter cards (how can you live without that? :) )
here is my patch, please take a look, hope you like it and we will see these changes in next release 8)
Attachments
deckEditorFilterCards.zip
(12.34 KiB) Downloaded 342 times
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: SVN

Postby DennisBergkamp » 12 Oct 2009, 21:18

Thanks Nantuko, I'll check 'em out and most definitely add them :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby Rob Cashwalker » 12 Oct 2009, 21:22

So how was doing this patch from SVN any different than using the source code from the last beta and posting the change file? The point of the SVN in theory would be that you could've uploaded the change directly and just told Dennis to check out the source. Or am I missing something?
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: SVN

Postby DennisBergkamp » 12 Oct 2009, 22:27

:lol:
Seriously, that just made me laugh out loud =D>

But I think the answer is easy, I don't think Nantuko has "committer" privileges (it's just you and I, Rob). Which brings up a good point, we should ask rares to add all of the other developers here on the forums.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby DennisBergkamp » 12 Oct 2009, 22:34

On the google code SVN page when selecting CardFactory.java:


Source path: svn/ trunk/ MTGForgeNew/ CardFactory.java

This file is too large to display.
:lol:
:roll:
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby frwololo » 13 Oct 2009, 09:50

Rob Cashwalker wrote:So how was doing this patch from SVN any different than using the source code from the last beta and posting the change file? The point of the SVN in theory would be that you could've uploaded the change directly and just told Dennis to check out the source.
You need committer's right to do that.
However most svn clients allow you to do a diff and create a patch, then send that to someone with committer's rights, which should make the merge of code painless
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: SVN

Postby Rob Cashwalker » 13 Oct 2009, 14:43

OK.. so I was missing something. :oops:
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: SVN

Postby DennisBergkamp » 13 Oct 2009, 16:25

This is quite a nice update, thanks a lot Nantuko!
Cards can be filtered by color and type now =D>

I assume this update could work for the Quest Deck Editor too, right?

EDIT: I noticed something though: when clicking one of the filters, whatever cards are added to the deck (at the bottom) just clear and disappear, is there an easy way to fix that?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby DennisBergkamp » 13 Oct 2009, 16:47

Actually, it seems that commenting out bottom.clear() in updateDisplay() fixes things. When something is filtered, updateDisplay() is called and accidentally clears the deck at the bottom.

But then the problem is that when clicking "New constructed deck", the deck doesn't clear.
So I've just added a separate method called clearDeck() which does a bottom.clear(), and it gets called when "New {type} deck" is clicked on the menu. From the limited testing I've done, this seems to work fine.

EDIT: There are some other funky things happening actually... when a deck is loaded, then cards added, then when a filter is applied the cards that were loaded stay but the cards that were added later disappear.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby silly freak » 13 Oct 2009, 18:32

can I pleease join the project in google? please PM me for whatever info you need; i have a google account already
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: SVN

Postby DennisBergkamp » 13 Oct 2009, 19:33

OK, so I'll play around with this a bit more to see if I can figure it out... but there's some weird things happening, I don't fully understand the deck editor code yet.

And yes, Silly Freak you should definitely join.
But Rares is the owner so he is the only one with permissions to add you, maybe also send him an email: mtgrares at yahoo dot com.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby DennisBergkamp » 13 Oct 2009, 19:41

I think this should do the trick:

Replace:
Code: Select all
public void updateDisplay() {
      updateDisplay(this.top, this.bottom);
}
with

Code: Select all
public void updateDisplay() {
      //updateDisplay(this.top, this.bottom);
       
       topModel.clear();
       
       if (AllZone.NameChanger.shouldChangeCardName()) {
         top = new CardList(AllZone.NameChanger.changeCard(top.toArray()));
         bottom = new CardList(AllZone.NameChanger.changeCard(bottom
               .toArray()));
      }

      Card c;
      String cardName;
      ReadBoosterPack pack = new ReadBoosterPack();

      // update top
      for (int i = 0; i < top.size(); i++) {
         c = top.get(i);

         // add rarity to card if this is a sealed card pool

         cardName = AllZone.NameChanger.getOriginalName(c.getName());
         if (!pack.getRarity(cardName).equals("error")) {
            c.setRarity(pack.getRarity(cardName));
         }
         
         boolean filteredOut = filterByColor(c);
         
         if (!filteredOut) {
            filteredOut = filterByType(c);
         }
         
         if (!filteredOut) {
            topModel.addCard(c);
         }
      }// for
      
      topModel.resort();
   }
Which basically does the same thing as the original method it called, but now it just completely ignores the bottom list.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: SVN

Postby DennisBergkamp » 15 Oct 2009, 18:34

By the way, I really am in favor of using the SVN, I think it should make things easier (especially for me: fewer code merges!). Although, sometimes updates are made on top of older local versions, in those cases I don't mind merging stuff at all.

So did you guys email rares about getting "committer" privileges? By you guys I mean Zerker, Silly Freak, ... , whoever else is interested.

Also, I've been fixing a few bugs here and there on a daily basis, so I will probably update the SVN every other day or so (since it's so easy anyway - one click of a button).
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 27 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 27 users online :: 0 registered, 0 hidden and 27 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 27 guests

Login Form