guy12 1 Posted February 13, 2015 Share Posted February 13, 2015 Hi, i have a problem with add function to button. I would like to add AFK system to this button. Here i given the code, what i doing wrong? inventorywindow: ... "name" : "AfkButton", "type" : "button", ... there is all ok because i see button in game and i can click on it uiinventory: self.afkButton = None self.afkButton.SetEvent(ui.__mem_func__(self.ClickAfkButton)) self.afkButton.SetEvent(ui.__mem_func__(self.ClickAfkButton)) def ClickAfkButton(self): event.QuestButtonClick(constInfo.AFK_BUTTON) i add this functions under my functions from other buttons constInfo: AFK_BUTTON = 0 game.py "afk" : self.__openAfk, def __openAfk(self, id): constInfo.AFK_BUTTON = int(id) if constInfo.AFK_BUTTON == 0: constInfo.AFK_BUTTON = 1 self.PopupMessage("AFK active") elif constInfo.AFK_BUTTON == 1: constInfo.AFK_BUTTON = 0 self.PopupMessage("AFK deactived") What i doing wrong? Thanks for help! Link to comment Share on other sites More sharing options...
ScreamMyName 100 Posted February 13, 2015 Share Posted February 13, 2015 uiinvetory search for self.mallButton = self.GetChild2("MallButton") add underneath it self.afkButton = self.GetChild2("AfkButton") and if you get any syserr please paste it here. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now