Skip to content

Commit

Permalink
saving fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Graebl committed Apr 5, 2018
1 parent 7210685 commit 94b741d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions armor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initUI(self, player):

for key, value in player.armor.items():
widget = ArmorItemWidget(key,value[0],value[1])
widget.armorItem.textChanged.connect(lambda location, item, buff, player=player : self.valUpdate(location, item, buff, player))
widget.widgetUpdate.connect(lambda location, item, buff, player=player : self.valUpdate(location, item, buff, player))
vbox.addWidget(widget)

armor_guy = QLabel(self)
Expand All @@ -25,8 +25,8 @@ def initUI(self, player):
self.setLayout(hbox)
self.setFixedHeight(self.sizeHint().height())

def valUpdate(self, location, item, buff, player):
player.updateArmor(location, item, buff)
def valUpdate(self, location, item, buff, player):
player.updateArmor(location, item, buff)

class ArmorItemWidget(QGroupBox):

Expand All @@ -43,16 +43,18 @@ def initUI(self):
vbox = QVBoxLayout()
self.armorItem = QLineEdit(self.name)
self.armorItem.setPlaceholderText("Enter name of item")
self.armorItem.textChanged.connect(self.valUpdate)
self.buffField = QLineEdit(self.buff)
self.buffField.setPlaceholderText("Enter item buff or quality")
self.buffField.textChanged.connect(self.valUpdate)
vbox.addWidget(self.armorItem)
vbox.addWidget(self.buffField)
self.setLayout(vbox)

def valUpdate(self):
self.buff = self.buffField.text()
self.name = self.armorItem.text()
self.widgetUpdate.emit(self.location,self.name, self.buff)
self.widgetUpdate.emit(self.location, self.name, self.buff)

def resource_path(relative_path):
if hasattr(sys, '_MEIPASS'):
Expand Down

0 comments on commit 94b741d

Please sign in to comment.