Update Adding new vanity items authored by Jake Harrington's avatar Jake Harrington
Below are the steps to adding a new vanity item: ### Below are the steps to adding a new vanity item:
1. The sprite png must be created and added to the correct vanity type folder in [ui-data](https://gitlab.engr.ship.edu/merlin/freshmanrpgsuite/-/tree/main/FreshmanRPG/GameClient-desktop/ui-data) (i.e. a hat would be added to the "hats" folder) 1. The sprite png must be created and added to the correct vanity type folder in [ui-data](https://gitlab.engr.ship.edu/merlin/freshmanrpgsuite/-/tree/main/FreshmanRPG/GameClient-desktop/ui-data) (i.e. a hat would be added to the "hats" folder)
2. A vanity item consists of several pieces of information: 2. A vanity item consists of several pieces of information:
- ID - an identifying number, but the database - ID - an identifying number, but the database
...@@ -8,3 +8,16 @@ provides this for new items so it is not something you have to give ...@@ -8,3 +8,16 @@ provides this for new items so it is not something you have to give
- textureName - name of the sprite png (from above step, without “.png”) - textureName - name of the sprite png (from above step, without “.png”)
- type - the type of vanity item (eyes, hat, shirt, etc., all types can be found in VanityType.java) - type - the type of vanity item (eyes, hat, shirt, etc., all types can be found in VanityType.java)
3. For use with testing, this information can be added to VanityForTest.java, and when the database is rebuilt it will be added to the VanityItems table on the database. 3. For use with testing, this information can be added to VanityForTest.java, and when the database is rebuilt it will be added to the VanityItems table on the database.
## Extras
### Add vanity item as a default
1. The default table represents vanity items that are included in every player’s inventory. It just consists of a list of vanity ID’s of the items that should be included as default.
1. To add a new default item, add the ID to DefaultItemsForTest.java, and when the database is rebuilt, it will be located in the DefaultItems table.
### Add vanity item to the shop
1. Add the items price to the items creation line of code in VanityForTest.java
1. The shop table is created from the items table so it does not have to be explicitly added by someone here.
### Add vanity item to a players inventory
1. The inventory table consists of a player ID, a vanity ID, and a flag for if they are currently wearing that item.
1. To add an item to a player’s inventory, add the ID of the player who is going to own the item, the ID of the vanity item they should own, and a 1 if they are wearing it or 0 if they are not to PlayerOwnsVanityForTest.java, and once the database is rebuilt, it will be located in the VanityInventory table.
\ No newline at end of file