Jump to content

Recommended Posts

  • Premium

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(COLOR_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(COLOR_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.gameWindow != None:
            self.sub_parent.blockBar.swib_normal.SetColor(COLOR_INACTIVE)
        pass
    
    def Activate_rare(self):
        self.sub_parent.resetSwitch_rare()
        self.sub_parent.StatusBar_rare.SetColor(COLOR_ACTIVE_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_INACTIVE_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.gameWindow != 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.gameWindow != None:
            self.sub_parent.blockBar.swib_normal.SetColor(COLOR_FINISHED)
        pass
        
    def Finish_rare(self):
        # self.Status_new.SetColor(COLOR_FINISHED)
        self.sub_parent.StatusBar_rare.SetColor(COLOR_FINISHED)
        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.gameWindow != 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

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.