@@ -33,9 +33,7 @@ The `data/inventory.json` file controls the data for all items in the inventory.
33
33
2 . Add, remove, or edit item entries using the following format:
34
34
``` json
35
35
{
36
- ...
37
- "Gold Coin" : {"type" : " currency" , "effect" : " collect" , "quantity" : 1 },
38
- ...
36
+ "Gold Coin" : {"type" : " currency" , "effect" : " collect" , "quantity" : 1 }
39
37
}
40
38
```
41
39
@@ -52,17 +50,24 @@ Each item in the inventory has the following properties:
52
50
### Adding a New Item Icon
53
51
To add a new item icon to the inventory:
54
52
55
- 1 . Open ` src/GUI/inventory_gui.py ` .
56
- 2 . Locate the initializer method (` self.icons: {} ` ).
57
- 3 . Map the item name in ` inventory.json ` to the icon's location in the spritesheet. Use the following format:
53
+ 1 . Open ` src/inventory_gui.py ` .
54
+ 2 . Locate the initializer method (` self.icons: {} ` ).
55
+ 3 . Map the item name in ` inventory.json ` to the icon's location in the sprite sheet. Use the following format:
56
+
57
+ ``` py
58
+ class InventoryGUI :
58
59
59
- ``` python
60
- " Gold Coin" : self .extract_icon(0 , 0 ),
60
+ def __init__ (self , ):
61
+
62
+ self .icons = { " Gold Coin" : self .extract_icon(0 , 0 ) }
63
+
64
+ def extract_icon (self , x , y , size = 16 ):
65
+ ...
61
66
```
62
67
63
68
[ ![ icons-inventory-gui.png] ( https://i.postimg.cc/CMNKKL8T/icons-inventory-gui.png )] ( https://postimg.cc/231YcYT2 )
64
69
65
- 4 . Test the new item in-game to verify functionality and ensure no errors occur.
70
+ 4 . Test the new item in-game to verify functionality and ensure no errors occur.
66
71
67
72
## Known Issues
68
73
0 commit comments