It is currently 27 Apr 2024, 10:18
   
Text Size

HQ Cards Picture Support

Post MTG Forge Related Programming Questions Here

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

Re: HQ Cards Picture Support

Postby Vasiliy » 22 Dec 2009, 16:41

Rob Cashwalker wrote:Does this just change the path from which the picture will be loaded from or does it copy it into the res/pics folder? (overwriting existing one)
Does it copy it into the res/pics folder (overwriting existing one).
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Cards Picture Support

Postby Vasiliy » 22 Dec 2009, 16:44

DennisBergkamp wrote:
Vasiliy wrote:Hello.

Marek14:
I can add to project next algoritm :
1. User select folder, where he has all HQ picture.
2. Forge analysing all picture in folder and all subfolder.
3. If it found HQ cards, it copy these card to pics catalog in Forge.

In this algoritm i can add support only such cards name format. Example: Bad Moon.full.jpg, Ballista Squad.full.jpg and so forth.
Algoritm found this card, copy in pics folder and rename it to Forge Cards format.
Example: Bad Moon.full.jpg -> bad_moon.jpg
Ballista Squad.full.jpg -> ballista_squad.jpg

If you want, then i start writing this algoritm.
Cool, yes this sounds great! A lot of people already have their HQ pics downloaded :)
This algoritm i am not create. Button "Change picture" change image of selected in table card.
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Cards Picture Support

Postby DennisBergkamp » 22 Dec 2009, 17:44

Rob Cashwalker wrote:Does this just change the path from which the picture will be loaded from or does it copy it into the res/pics folder? (overwriting existing one)

Dennis - do you think you can start adapting the basic land picture variation code to work for all types of cards?
Hmm, we would have to write something new entirely. I can't even remember how I did the land variation thing, but I think it's just hardcoded. There's no way it would work for all of the other cards... ideally different picture versions would be something that the user can specify in the deck editor... but how to do this?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Cards Picture Support

Postby Vasiliy » 27 Dec 2009, 18:57

I add new feature "Import pictures" in r 229.

It copy all "supported pictures" from selected folder and all subfolder to res/pics.
"suported pictures" - It is pictures with file format "Card name.full.jpg"
Example: Abyssal Specter.full.jpg

Screenshots:
Image

Image

I have one problem in these code:
When files are coping, window is hanging and JProgressbar is not updated :(
Please help me and rewrite these code. [-o<
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Cards Picture Support

Postby silly freak » 27 Dec 2009, 20:33

maybe you can read in yourself into SwingWorker (Java tutorials about Swing & Threads)

The problem is that if you download the pictures in actionPerformed, The Swing Thread does exactly that, and nothing else. you need a background thread for downloading. SwingWorker gives you an easy way to do that. forge.Gui_DownloadPictures doesn't use a SwingWorker, but also executes the downloads in a separate thread
___

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: HQ Cards Picture Support

Postby Vasiliy » 28 Dec 2009, 18:41

Vasiliy wrote:I add new feature "Import pictures" in r 229.
I have one problem in these code:
When files are coping, window is hanging and JProgressbar is not updated :(
I fix these bug in r233. Thanks silly freak for idea use SwingWorker.
Sorry for my english. I speak english very bad.
Vasiliy
Programmer
 
Posts: 47
Joined: 15 Nov 2009, 12:26
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 114 guests


Who is online

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

Login Form