The Shop UI is made up of 3 classes, ClothingShopUI, ShopPreviewTable, and ShopTable. These 3 classes combine to display available items and handle purchasing new vanity items.
The Shop UI is made up of 3 classes, ClothingShopUI, ShopPreviewTable, and ShopTable. These 3 classes combine to display available items and handle purchasing new vanity items.
## Clothing Shop UI
## Clothing Shop UI
-The clothing shop listens for 2 reports, one for getting all of the available vanities, and one for a key press of 'U' to open the shop.
The clothing shop listens for 2 reports, one for getting all of the available vanities, and one for a key press of 'U' to open the shop.
-The report containing all of the available vanities for purchase gets sent when the clothing shop is opened.
The report containing all of the available vanities for purchase gets sent when the clothing shop is opened.
## Shop Preview Table
## Shop Preview Table
-Handles functionality for displaying a preview of the vanity item on the side of the screen, using a switch statement in drawVanities method.
Handles functionality for displaying a preview of the vanity item on the side of the screen, using a switch statement in drawVanities method.
-If another type of vanity is added in, after adding it to the enum class, you will have to add another case to the switch statement in the drawVanities method, with the corresponding factory.
If another type of vanity is added in, after adding it to the enum class, you will have to add another case to the switch statement in the drawVanities method, with the corresponding factory.
## Shop Table
## Shop Table
-Constructor sets up all of the pieces of the shop that need to be displayed and adds them into the container in the correct order.
Constructor sets up all of the pieces of the shop that need to be displayed and adds them into the container in the correct order.
-If a new vanity type is added that shouldn't be in the shop, the for-each loop in the constructor needs to be updated so that it will ignore it and not try to add it to the shop.
If a new vanity type is added that shouldn't be in the shop, the for-each loop in the constructor needs to be updated so that it will ignore it and not try to add it to the shop.
-Otherwise, if a new vanity type + items are added, the for-each loop will automatically add it to the shop, but the preview table will need to be updated
Otherwise, if a new vanity type + items are added, the for-each loop will automatically add it to the shop, but the preview table will need to be updated
-When a player owns/cannot afford/has just bought an item from the shop the button turns gray and no longer listens for a click while looking at that specific vanity item
When a player owns/cannot afford/has just bought an item from the shop the button turns gray and no longer listens for a click while looking at that specific vanity item
-When the selected filter is changed, it re-sends a shop inventory request, and sets the selected vanity index to 0 so that it always displays the first item of that type when changed
When the selected filter is changed, it re-sends a shop inventory request, and sets the selected vanity index to 0 so that it always displays the first item of that type when changed