#Sets the window name
self.ui.setWindowTitle("QuestTyper")
#Changes the window Icon.
self.setWindowIcon(QtGui.QIcon('icon175x175.jpeg'))
# avatar click
self.ui.avatar.clicked.connect(self.ClickAvatar) # points to function
self.ui.NewsFeed.setText("asd")
# Functions to call buy functions
self.SetUI(monster_1, self.buy_1, self.ui
.Price_1, self.ui.LVL_1, self.ui.Income_1)
self.SetUI(monster_2, self.buy_2, self.ui.Price_2, self.ui.LVL_2, self.ui.Income_2)
self.SetUI(monster_3, self.buy_3, self.ui.Price_03, self.ui.LVL_03,
self.ui.Income_03)
self.SetUI(monster_4, self.buy_4, self.ui.Price_4, self.ui.LVL_4, self.ui.In
come_4)
self.SetUI(monster_5, self.buy_5, self.ui.Price_5, self.ui.LVL_5, self.ui.Income_5)
self.SetUI(monster_6, self.buy_6, self.ui.Price_6, self.ui.LVL_6, self.ui.Income_6)
self.SetUI(monster_7, self.buy_7, self.ui.Price_7, self.ui.LVL_7, self.ui.Income_7)
self.SetUI(monster_8, self.buy_8
, self.ui.Price_8, self.ui.LVL_8, self.ui.Income_8)
def SetUI(self, monster, buyFunc, price, level, income): # PyQT function
price.clicked.connect(buyFunc)
price.setText("$ " + str(monster.price))
level.setText(str(inv.MonsterCount(monster.name)))
income.setText("$ " + str(monster.points*inv.MonsterCount(mo
nster.name)) + "/sec")
def keyPressEvent(self, e): # PyQT function
if e.key() == QtCore.Qt.Key_Escape: # if escape is pressed
self.close() # close QuestWindow
exit()
def ClickAvatar(self): # method used for manually generating points without the usage
of monsters
inv.points += 1
self.ui.CurrentPoints.setText("$ " + str
(inv.points)) # updates the UI manually,
no need to wait for PointLoop
# buy functions pointing to general purchase function
def buy_1(self):
self.GeneralBuy(monster_1, self.ui.LVL_1, self.ui.Income_1)
def buy_2(self):
self.GeneralBuy(monster_2, self.ui.LVL_2, self.ui.Income_2)
def buy_3(self):
self.GeneralBuy(monster_3, s
elf.ui.LVL_03, self.ui.Income_03)
def buy_4(self):
self.GeneralBuy(monster_4, self.ui.LVL_4, self.ui.Income_4)
26