Page 4 of 4

Re: HQ Cards Picture Support

PostPosted: 22 Dec 2009, 16:41
by Vasiliy
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).

Re: HQ Cards Picture Support

PostPosted: 22 Dec 2009, 16:44
by Vasiliy
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.

Re: HQ Cards Picture Support

PostPosted: 22 Dec 2009, 17:44
by DennisBergkamp
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?

Re: HQ Cards Picture Support

PostPosted: 27 Dec 2009, 18:57
by Vasiliy
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<

Re: HQ Cards Picture Support

PostPosted: 27 Dec 2009, 20:33
by silly freak
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

Re: HQ Cards Picture Support

PostPosted: 28 Dec 2009, 18:41
by Vasiliy
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.