Asdria 1 Posted December 27, 2020 Share Posted December 27, 2020 (edited) Hey guys i have a problem. Can somebody help me with this problem. The rank points won´t show up after ill cross my mouse over the name in the character window. There are no sysser errors. I think the problem is source. Thank you in advance! Edited December 28, 2020 by Asdria Link to comment Share on other sites More sharing options...
Premium Hunger 474 Posted December 27, 2020 Premium Share Posted December 27, 2020 (edited) Is not the source. I will give you the fix today later on. The problem comes from ui.py / the class for image toolTip. The toolTip won’t show up on any image that uses toolTip. Edited December 27, 2020 by Hunger Link to comment Share on other sites More sharing options...
Asdria 1 Posted December 27, 2020 Author Share Posted December 27, 2020 2 minutes ago, Hunger said: Is not the source. I will give you the fix today later on. The problem comes from ui.py / the class for image toolTip. The toolTip won’t show up on any image that uses toolTip. You are a life saver thank you! Link to comment Share on other sites More sharing options...
Premium Solution Hunger 474 Posted December 27, 2020 Premium Solution Share Posted December 27, 2020 9 hours ago, Asdria said: You are a life saver thank you! Replace the entire ImageBox class in ui.py with this: class ImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.eventDict={} self.eventFunc = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None} self.eventArgs = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None} def __del__(self): Window.__del__(self) self.eventFunc = None self.eventArgs = None def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name=imageName wndMgr.LoadImage(self.hWnd, imageName) if len(self.eventDict)!=0: print "LOAD IMAGE", self, self.eventDict def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def GetWidth(self): return wndMgr.GetWidth(self.hWnd) def GetHeight(self): return wndMgr.GetHeight(self.hWnd) def OnMouseOverIn(self): try: self.eventDict["MOUSE_OVER_IN"]() except KeyError: pass def OnMouseOverOut(self): try: self.eventDict["MOUSE_OVER_OUT"]() except KeyError: pass def SAFE_SetStringEvent(self, event, func): self.eventDict[event]=__mem_func__(func) def SetEvent(self, func, *args) : result = self.eventFunc.has_key(args[0]) if result : self.eventFunc[args[0]] = func self.eventArgs[args[0]] = args else : print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0] def OnMouseLeftButtonUp(self) : if self.eventFunc["mouse_click"] : apply(self.eventFunc["mouse_click"], self.eventArgs["mouse_click"]) def OnMouseOverIn(self) : if self.eventFunc["mouse_over_in"] : apply(self.eventFunc["mouse_over_in"], self.eventArgs["mouse_over_in"]) else: try: self.eventDict["MOUSE_OVER_IN"]() except KeyError: pass def OnMouseOverOut(self) : if self.eventFunc["mouse_over_out"] : apply(self.eventFunc["mouse_over_out"], self.eventArgs["mouse_over_out"]) else : try: self.eventDict["MOUSE_OVER_OUT"]() except KeyError: pass 1 Link to comment Share on other sites More sharing options...
Asdria 1 Posted December 27, 2020 Author Share Posted December 27, 2020 7 hours ago, Hunger said: Replace the entire ImageBox class in ui.py with this: class ImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.eventDict={} self.eventFunc = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None} self.eventArgs = {"mouse_click" : None, "mouse_over_in" : None, "mouse_over_out" : None} def __del__(self): Window.__del__(self) self.eventFunc = None self.eventArgs = None def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name=imageName wndMgr.LoadImage(self.hWnd, imageName) if len(self.eventDict)!=0: print "LOAD IMAGE", self, self.eventDict def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def GetWidth(self): return wndMgr.GetWidth(self.hWnd) def GetHeight(self): return wndMgr.GetHeight(self.hWnd) def OnMouseOverIn(self): try: self.eventDict["MOUSE_OVER_IN"]() except KeyError: pass def OnMouseOverOut(self): try: self.eventDict["MOUSE_OVER_OUT"]() except KeyError: pass def SAFE_SetStringEvent(self, event, func): self.eventDict[event]=__mem_func__(func) def SetEvent(self, func, *args) : result = self.eventFunc.has_key(args[0]) if result : self.eventFunc[args[0]] = func self.eventArgs[args[0]] = args else : print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0] def OnMouseLeftButtonUp(self) : if self.eventFunc["mouse_click"] : apply(self.eventFunc["mouse_click"], self.eventArgs["mouse_click"]) def OnMouseOverIn(self) : if self.eventFunc["mouse_over_in"] : apply(self.eventFunc["mouse_over_in"], self.eventArgs["mouse_over_in"]) else: try: self.eventDict["MOUSE_OVER_IN"]() except KeyError: pass def OnMouseOverOut(self) : if self.eventFunc["mouse_over_out"] : apply(self.eventFunc["mouse_over_out"], self.eventArgs["mouse_over_out"]) else : try: self.eventDict["MOUSE_OVER_OUT"]() except KeyError: pass Already figured it out, can be closed you are a life saver! Could not figure it out in forever 1 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