Jump to content
×
×
  • Create New...

Remove Buff Affect


Recommended Posts

  • 3 months later...

update:

https://metin2.download/video/m7bTPN633aOw7g3x3m6qG13qk0UjiA52/.mp4

 

This is the hidden content, please

 

EDIT if you don't have update for class ImageBox

class ImageBox(Window):
    def __init__(self, layer = "UI"):
        Window.__init__(self, layer)
        self.eventDict={}
        self.eventFunc = {
            "MOUSE_LEFT_BUTTON_UP" : None, 
            "MOUSE_LEFT_BUTTON_DOWN" : None, 
            "MOUSE_RIGHT_BUTTON_UP" : None, 
            "MOUSE_RIGHT_BUTTON_DOWN" : None, 
            "MOUSE_OVER_IN" : None, 
            "MOUSE_OVER_OUT" : None
        }
        self.eventArgs = {
            "MOUSE_LEFT_BUTTON_UP" : None, 
            "MOUSE_LEFT_BUTTON_DOWN" : None, 
            "MOUSE_RIGHT_BUTTON_UP" : None, 
            "MOUSE_RIGHT_BUTTON_DOWN" : 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 SetColor(self, r, g, b, a):
        wndMgr.SetDiffuseColor(self.hWnd, r, g, b, a)    
    def GetWidth(self):
        return wndMgr.GetWidth(self.hWnd)
    def GetHeight(self):
        return wndMgr.GetHeight(self.hWnd)
        
    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 SAFE_SetEvent(self, func, *args):
        result = self.eventFunc.has_key(args[0])        
        if result :
            self.eventFunc[args[0]] = __mem_func__(func)
            self.eventArgs[args[0]] = args
        else :
            print "[ERROR] ui.py SAFE_SetEvent, Can`t Find has_key : %s" % args[0]
        
    def OnMouseLeftButtonUp(self):
        if self.eventFunc["MOUSE_LEFT_BUTTON_UP"] :
            apply(self.eventFunc["MOUSE_LEFT_BUTTON_UP"], self.eventArgs["MOUSE_LEFT_BUTTON_UP"])
            
    def OnMouseLeftButtonDown(self):
        if self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"] :
            apply(self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"], self.eventArgs["MOUSE_LEFT_BUTTON_DOWN"])
    def OnMouseRightButtonUp(self):
        if self.eventFunc["MOUSE_RIGHT_BUTTON_UP"] :
            apply(self.eventFunc["MOUSE_RIGHT_BUTTON_UP"], self.eventArgs["MOUSE_RIGHT_BUTTON_UP"])
            
    def OnMouseRightButtonDown(self):
        if self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"] :
            apply(self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"], self.eventArgs["MOUSE_RIGHT_BUTTON_DOWN"])
            
    def OnMouseOverIn(self) :
        if self.eventFunc["MOUSE_OVER_IN"] :
            apply(self.eventFunc["MOUSE_OVER_IN"], self.eventArgs["MOUSE_OVER_IN"])
    def OnMouseOverOut(self) :
        if self.eventFunc["MOUSE_OVER_OUT"] :
            apply(self.eventFunc["MOUSE_OVER_OUT"], self.eventArgs["MOUSE_OVER_OUT"])
            
    def SAFE_SetStringEvent(self, event, func,isa=FALSE):
        if not isa:
            self.eventDict[event]=__mem_func__(func)
        else:
            self.eventDict[event]=func
    
    def SetOnMouseLeftButtonUpEvent(self, event, *args):
        self.eventFunc["MOUSE_LEFT_BUTTON_UP"] = event
        self.eventArgs["MOUSE_LEFT_BUTTON_UP"] = args

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 19
  • Love 13
  • Good 4
  • Sad 2
  • Dislove 1
Link to comment
Share on other sites

  • 2 weeks later...
6 hours ago, 2358 said:
  1. The size of the icons does not increase when you click on it with the mouse
  2. How do I make it compatible with the conversion system ?

1 -> Just add self.SetScale(0.8,0.8) in OnMouseOverIn function, and self.SetScale(0.7, 0.7) in OnMouseOverOut function

Edited by IShungite
Link to comment
Share on other sites

  • 2 months later...
On 11/30/2020 at 7:56 PM, Chriss said:

update:

https://metin2.download/video/m7bTPN633aOw7g3x3m6qG13qk0UjiA52/.mp4

 

This is the hidden content, please

 

EDIT if you don't have update for class ImageBox

class ImageBox(Window):
    def __init__(self, layer = "UI"):
        Window.__init__(self, layer)
        self.eventDict={}
        self.eventFunc = {
            "MOUSE_LEFT_BUTTON_UP" : None, 
            "MOUSE_LEFT_BUTTON_DOWN" : None, 
            "MOUSE_RIGHT_BUTTON_UP" : None, 
            "MOUSE_RIGHT_BUTTON_DOWN" : None, 
            "MOUSE_OVER_IN" : None, 
            "MOUSE_OVER_OUT" : None
        }
        self.eventArgs = {
            "MOUSE_LEFT_BUTTON_UP" : None, 
            "MOUSE_LEFT_BUTTON_DOWN" : None, 
            "MOUSE_RIGHT_BUTTON_UP" : None, 
            "MOUSE_RIGHT_BUTTON_DOWN" : 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 SetColor(self, r, g, b, a):
        wndMgr.SetDiffuseColor(self.hWnd, r, g, b, a)    
    def GetWidth(self):
        return wndMgr.GetWidth(self.hWnd)
    def GetHeight(self):
        return wndMgr.GetHeight(self.hWnd)
        
    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 SAFE_SetEvent(self, func, *args):
        result = self.eventFunc.has_key(args[0])        
        if result :
            self.eventFunc[args[0]] = __mem_func__(func)
            self.eventArgs[args[0]] = args
        else :
            print "[ERROR] ui.py SAFE_SetEvent, Can`t Find has_key : %s" % args[0]
        
    def OnMouseLeftButtonUp(self):
        if self.eventFunc["MOUSE_LEFT_BUTTON_UP"] :
            apply(self.eventFunc["MOUSE_LEFT_BUTTON_UP"], self.eventArgs["MOUSE_LEFT_BUTTON_UP"])
            
    def OnMouseLeftButtonDown(self):
        if self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"] :
            apply(self.eventFunc["MOUSE_LEFT_BUTTON_DOWN"], self.eventArgs["MOUSE_LEFT_BUTTON_DOWN"])
    def OnMouseRightButtonUp(self):
        if self.eventFunc["MOUSE_RIGHT_BUTTON_UP"] :
            apply(self.eventFunc["MOUSE_RIGHT_BUTTON_UP"], self.eventArgs["MOUSE_RIGHT_BUTTON_UP"])
            
    def OnMouseRightButtonDown(self):
        if self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"] :
            apply(self.eventFunc["MOUSE_RIGHT_BUTTON_DOWN"], self.eventArgs["MOUSE_RIGHT_BUTTON_DOWN"])
            
    def OnMouseOverIn(self) :
        if self.eventFunc["MOUSE_OVER_IN"] :
            apply(self.eventFunc["MOUSE_OVER_IN"], self.eventArgs["MOUSE_OVER_IN"])
    def OnMouseOverOut(self) :
        if self.eventFunc["MOUSE_OVER_OUT"] :
            apply(self.eventFunc["MOUSE_OVER_OUT"], self.eventArgs["MOUSE_OVER_OUT"])
            
    def SAFE_SetStringEvent(self, event, func,isa=FALSE):
        if not isa:
            self.eventDict[event]=__mem_func__(func)
        else:
            self.eventDict[event]=func
    
    def SetOnMouseLeftButtonUpEvent(self, event, *args):
        self.eventFunc["MOUSE_LEFT_BUTTON_UP"] = event
        self.eventArgs["MOUSE_LEFT_BUTTON_UP"] = args

 

Hey there! my problem is that the window does not appear.. Can you please help why it doesn't appear?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.


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.