-
Notifications
You must be signed in to change notification settings - Fork 3
/
inventory.py
34 lines (22 loc) · 902 Bytes
/
inventory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
import json
from sdl2.ext import Resources
from const import Colors
from ui import DialogBox
from db import DataBase
RESOURCES = Resources(__file__, 'resources', 'ui')
class Inventory:
def __init__(self, renderer):
self.db = DataBase()
self.renderer = renderer
self.inventory = self.db.get_player_inventory()
self.equipped = json.loads(self.inventory["equipped"])
self.left_hand_id = self.equipped["left_hand"]
self.left_hand = self.db.get_item_by_id(self.left_hand_id)
self.inv_text = {0: self.left_hand["name"], 1: self.left_hand["description"]}
self.inv_dialog = DialogBox(self.renderer, Colors.WHITE, 16, (300, 200), Colors.BLACK, "GlametrixBold.otf")
def update(self, elapsed_time):
pass
def draw(self):
inv_text = self.inv_text
#self.inv_dialog.draw(inv_text)