demilich1 / metastone

Hearthstone simulator written in Java with full GUI support
GNU General Public License v2.0
132 stars 80 forks source link

Added support for custom Hero and Hero Power textures #373

Open guyde2011 opened 7 years ago

guyde2011 commented 7 years ago

This is one of the few gui tweaks I had on my local version - it takes textures from the /assets and loads them. Keep in mind that it does not break any cards - when there isn't any texture given it's going to use the basic hero power texture of the played class.

Here's an example for an updated Jaraxxus card code:

"name": "Lord Jaraxxus",
"baseManaCost": 9,
"heroPower": "hero_power_inferno",
"type": "HERO",
"asset": "jaraxxus",
"heroClass": "WARLOCK",
"rarity": "LEGENDARY",
"race": "DEMON",
"attributes": {
    "HP": 15,
    "MAX_HP": 15
},
"collectible": false,
"set": "CLASSIC",
"fileFormatVersion": 1

Pretty much the same as it used to be with the additional "asset": "jaraxxus" line which points to /assets/jaraxxus.png

akoscz commented 7 years ago

does the addition of the asset attribute to the card format constitute an increment of the fileFormatVersion ?

guyde2011 commented 7 years ago

@akoscz First of all, using null as a default value is bad practice - in the future it could lead to some problems - using a default value other than null (<Def>) means that if we have a loading problem which causes the loaded string to be null than we would not be able to track it if we were to use null.

For the fileFormatVersion - I felt that it wasn't really a big change as it is able to load the already existing files.

For the file separator - yeah I should patch it - did you patch it on your local copy? (if you did can you upload it?)

webadict commented 7 years ago

fileFormatVersion has like... zero use right now. It would be nice to use eventually.

akoscz commented 7 years ago

@guyde2011 re: File.separator, take a look at the usage in CardCatalogue.java. I have not patched it on my local copy. I'll kindly ask you to make the change and update your PR. :) Thanks!