Skip to content

Commit bcfd344

Browse files
committed
Edited the document file slightly because of some Pycharm errors, also changed the correct path where the src/inventory_gui.py is now located in.
1 parent 7af0c8b commit bcfd344

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/Guides/InventoryGuide.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ The `data/inventory.json` file controls the data for all items in the inventory.
3333
2. Add, remove, or edit item entries using the following format:
3434
```json
3535
{
36-
...
37-
"Gold Coin": {"type": "currency", "effect": "collect", "quantity": 1},
38-
...
36+
"Gold Coin": {"type": "currency", "effect": "collect", "quantity": 1}
3937
}
4038
```
4139

@@ -52,17 +50,24 @@ Each item in the inventory has the following properties:
5250
### Adding a New Item Icon
5351
To add a new item icon to the inventory:
5452

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:
5859

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+
...
6166
```
6267

6368
[![icons-inventory-gui.png](https://i.postimg.cc/CMNKKL8T/icons-inventory-gui.png)](https://postimg.cc/231YcYT2)
6469

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.
6671

6772
## Known Issues
6873

0 commit comments

Comments
 (0)