Page 1 of 6
		
			
				SVN
				
Posted: 
12 Oct 2009, 17:20 
				by DennisBergkamp
				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  
http://code.google.com/p/cardforge/ 
			 
			
		
			
				Re: SVN
				
Posted: 
12 Oct 2009, 18:02 
				by nantuko84
				my congratulations! 

 
			 
			
		
			
				Re: SVN
				
Posted: 
12 Oct 2009, 20:42 
				by nantuko84
				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  

 
			 
			
		
			
				Re: SVN
				
Posted: 
12 Oct 2009, 21:18 
				by DennisBergkamp
				Thanks Nantuko, I'll check 'em out and most definitely add them 

 
			 
			
		
			
				Re: SVN
				
Posted: 
12 Oct 2009, 21:22 
				by Rob Cashwalker
				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?
			 
			
		
			
				Re: SVN
				
Posted: 
12 Oct 2009, 22:27 
				by DennisBergkamp
				
 Seriously, that just made me laugh out loud  
 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.
 
			 
			
		
			
				Re: SVN
				
Posted: 
12 Oct 2009, 22:34 
				by DennisBergkamp
				On the google code SVN page when selecting CardFactory.java:
 
Source path:  svn/  trunk/ MTGForgeNew/ CardFactory.java
This file is too large to display.
 
  
 
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 09:50 
				by frwololo
				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
 
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 14:43 
				by Rob Cashwalker
				OK.. so I was missing something. 

 
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 16:25 
				by DennisBergkamp
				This is quite a nice update, thanks a lot Nantuko! 
Cards can be filtered by color and type now  
 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?
 
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 16:47 
				by DennisBergkamp
				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.
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 18:32 
				by silly freak
				can I pleease join the project in google? please PM me for whatever info you need; i have a google account already
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 19:33 
				by DennisBergkamp
				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.
			 
			
		
			
				Re: SVN
				
Posted: 
13 Oct 2009, 19:41 
				by DennisBergkamp
				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.
 
			 
			
		
			
				Re: SVN
				
Posted: 
15 Oct 2009, 18:34 
				by DennisBergkamp
				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).