I implemented the switchbot with 5 slots but I have a problem.
No change bonuses.
Code for the charms subject is right in the file.
Sysser :
0820 14:23:35984 :: Traceback (most recent call last):
0820 14:23:35984 :: File "ui.py", line 1108, in OnToggleDown
0820 14:23:35984 :: File "switchbot.py", line 57, in Activate
0820 14:23:35984 :: AttributeError
0820 14:23:35984 :: :
0820 14:23:35984 :: 'int' object has no attribute 'gameWindow'
0820 14:23:35984 ::
ui.py : 1108
def OnToggleDown(self):
if self.eventDown:
self.eventDown()
switchbot.py : 57
if self.parentWindow.parentWindow.gameWindow != None:
self.sub_parent.blockBar.swib_normal.SetColor(COLO R_ACTIVE)
pass
FULL FUNCTION :
class BonusSelector(ui.Bar):
def Activate(self):
self.sub_parent.resetSwitch()
self.Status_new.SetColor(COLOR_ACTIVE)
self.sub_parent.StatusBar.SetColor(COLOR_ACTIVE)
self.sub_parent.StatusText.SetText("Activ")
self.Starter.SetText("Opreste schimbarea ("+str(self.index+1)+")")
self.sub_parent.boni_active = 1
if self.parentWindow.parentWindow.gameWindow != None:
self.sub_parent.blockBar.swib_normal.SetColor(COLO R_ACTIVE)
pass
def Deactivate(self):
self.sub_parent.resetSwitch()
self.Status_new.SetColor(COLOR_INACTIVE)
self.sub_parent.StatusBar.SetColor(COLOR_INACTIVE)
self.sub_parent.StatusText.SetText("Dezactivati")
self.Starter.SetText("Incepeti schimbarea ("+str(self.index+1)+")")
self.sub_parent.boni_active = 0
if self.sub_parent.parentWindow.parentWindow.gameWind ow != None:
self.sub_parent.blockBar.swib_normal.SetColor(COLO R_INACTIVE)
pass
def Activate_rare(self):
self.sub_parent.resetSwitch_rare()
self.sub_parent.StatusBar_rare.SetColor(COLOR_ACTI VE_RARE)
self.sub_parent.StatusText_rare.SetText("6/7 Activ")
self.Starter_rare_boni.SetText("Opreste 6/7")
self.sub_parent.boni_rare_active = 1
if self.parentWindow.parentWindow.gameWindow != None:
self.sub_parent.blockBar.swib_rare.SetColor(COLOR_ ACTIVE_RARE)
pass
def Deactivate_rare(self):
self.sub_parent.resetSwitch_rare()
# self.Status_new.SetColor(COLOR_INACTIVE)
self.sub_parent.StatusBar_rare.SetColor(COLOR_INAC TIVE_RARE)
self.sub_parent.StatusText_rare.SetText("6/7 inactiv")
self.Starter_rare_boni.SetText("alege 6/7")
self.Starter_rare_boni.SetUp()
self.sub_parent.boni_rare_active = 0
if self.sub_parent.parentWindow.parentWindow.gameWind ow != None:
self.sub_parent.blockBar.swib_rare.SetColor(COLOR_ INACTIVE_RARE)
pass
def Finish(self):
self.Status_new.SetColor(COLOR_FINISHED)
self.sub_parent.StatusBar.SetColor(COLOR_FINISHED)
self.sub_parent.StatusText.SetText("Terminat")
self.Starter.SetText("Bonusul ("+str(self.index+1)+") a fost schimbat.")
self.sub_parent.boni_active = 0
if self.sub_parent.parentWindow.parentWindow.gameWind ow != None:
self.sub_parent.blockBar.swib_normal.SetColor(COLO R_FINISHED)
pass
def Finish_rare(self):
# self.Status_new.SetColor(COLOR_FINISHED)
self.sub_parent.StatusBar_rare.SetColor(COLOR_FINI SHED)
self.sub_parent.StatusText_rare.SetText("6/7 terminat")
self.Starter_rare_boni.SetText("6/7 schimbat")
self.sub_parent.boni_rare_active = 0
if self.sub_parent.parentWindow.parentWindow.gameWind ow != None:
self.sub_parent.blockBar.swib_rare.SetColor(COLOR_ FINISHED)
pass
def Block(self):
self.BlockBar.Show()
self.Starter.Hide()
pass
def Unblock(self):
self.BlockBar.Hide()
self.Starter.Show()
pass