Jump to content

Recommended Posts

  • 3 weeks later...
  • 1 month later...

i have 1 problem :

system.py(line:273) RunMainScript
system.py(line:192) execfile
system.py(line:163) Run
prototype.py(line:61)?

prototyple.py(line:47) RunApp
networkModule.py(line:122) Create
networkModule.py(line:34) LoadDialog
ui.py (line:2870) LoadScriptFile
ui.py (line:2979 LoadChildren
ui.py (line:1726) _init_
 

Run - exceptions.NameError:global name 'False' is not defined
 

Print: https://metin2.download/picture/OONeQil4k5BF6S6zE2A2p544zhZn142R/.png

 

help plz

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
https://metin2.dev/topic/21657-cool-notify-friends/page/2/#findComment-131762
Share on other sites

2 hours ago, d1s0rd3rx123 said:

i have 1 problem :

system.py(line:273) RunMainScript
system.py(line:192) execfile
system.py(line:163) Run
prototype.py(line:61)?

prototyple.py(line:47) RunApp
networkModule.py(line:122) Create
networkModule.py(line:34) LoadDialog
ui.py (line:2870) LoadScriptFile
ui.py (line:2979 LoadChildren
ui.py (line:1726) _init_
 

Run - exceptions.NameError:global name 'False' is not defined
 

Print: https://metin2.download/picture/OONeQil4k5BF6S6zE2A2p544zhZn142R/.png

 

help plz

Run - exceptions.NameError:global name 'False' is not defined
 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/21657-cool-notify-friends/page/2/#findComment-131768
Share on other sites

  • 3 months later...
  • 4 months later...
  • 1 year later...

1203 08:59:00971 :: Traceback (most recent call last):

1203 08:59:00971 ::   File "introLogo.py", line 60, in OnUpdate

1203 08:59:00971 ::   File "networkModule.py", line 177, in SetLoginPhase

1203 08:59:00972 ::   File "system.py", line 130, in __pack_import

1203 08:59:00972 ::   File "system.py", line 110, in _process_result

1203 08:59:00972 ::   File "introLogin.py", line 14, in <module>

1203 08:59:00973 ::   File "system.py", line 130, in __pack_import

1203 08:59:00973 ::   File "system.py", line 110, in _process_result

1203 08:59:00973 ::   File "uiCommon.py", line 422, in <module>

1203 08:59:00974 :: AttributeError
1203 08:59:00974 :: :
1203 08:59:00974 :: 'module' object has no attribute 'BorderB'
 

i add end of file this

class OnlinePopup(ui.BorderB):
    def __init__(self):
        ui.BorderB.__init__(self)
        
        self.isActiveSlide = False
        self.isActiveSlideOut = False
        self.endTime = 0
        self.wndWidth = 0

        self.textLine = ui.TextLine()
        self.textLine.SetParent(self)
        self.textLine.SetWindowHorizontalAlignCenter()
        self.textLine.SetWindowVerticalAlignCenter()
        self.textLine.SetHorizontalAlignCenter()
        self.textLine.SetVerticalAlignCenter()
        self.textLine.SetPosition(13, 0)
        self.textLine.Show()
        
        self.onlineImage = ui.ImageBox()
        self.onlineImage.SetParent(self)
        self.onlineImage.SetPosition(8,
        self.onlineImage.LoadImage("d:/ymir work/ui/game/windows/messenger_list_online.sub")
        self.onlineImage.Show()
        
    def __del__(self):
        ui.BorderB.__del__(self)

    def SlideIn(self):
        self.SetTop()
        self.Show()
        
        self.isActiveSlide = True
        self.endTime = app.GetGlobalTimeStamp() + 5

    def Close(self):
        self.Hide()

    def Destroy(self):
        self.Close()

    def SetUserName(self, name):
        self.textLine.SetText("Player %s is online." % str(name))
        
        self.wndWidth = self.textLine.GetTextSize()[0] + 40
        self.SetSize(self.wndWidth, 25)
        self.SetPosition(-self.wndWidth, wndMgr.GetScreenHeight() - 200)
        
    def OnUpdate(self):
        if self.isActiveSlide and self.isActiveSlide == True:
            x, y = self.GetLocalPosition()
            if x < 0:
                self.SetPosition(x + 4, y)
                
        if self.endTime - app.GetGlobalTimeStamp() <= 0 and self.isActiveSlideOut == False and self.isActiveSlide == True:
            self.isActiveSlide = False
            self.isActiveSlideOut = True
                
        if self.isActiveSlideOut and self.isActiveSlideOut == True:
            x, y = self.GetLocalPosition()
            if x > -(self.wndWidth):
                self.SetPosition(x - 4, y)
                
            if x <= -(self.wndWidth):
                self.isActiveSlideOut = False
                self.Close()

 

 

IMAGE: https://metin2.download/picture/5sJ2GR90PoJQXjxQfulR6X0O0xu1q7R9/.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/21657-cool-notify-friends/page/2/#findComment-153448
Share on other sites

  • 6 months later...
  • Active+ Member

It is working perfectly. I used border a instead of border b and it looks even better. I also used locale text to make it multi language compatible. 

This is the hidden content, please

  • Metin2 Dev 36
  • Good 4
  • Love 1
  • Love 16
Link to comment
https://metin2.dev/topic/21657-cool-notify-friends/page/2/#findComment-157950
Share on other sites

  • 1 year later...
  • Active Member

  

On 7/22/2020 at 12:13 PM, Ciucciamelo said:

Excuse me, it works.

The only thing is that when I login, I get notifications of players that are online. how do I fix this thing?

thx

On 5/17/2021 at 1:17 AM, ByLost said:

fix?

After doing the tutorial, modify/add this changes:
in constinfo.py after

    ALREADY_NOTIFY_LIST = []

add:

    ONLINE_NOTIFICATION_START_TIME = 0

 

in uimessenger.py in class MessengerWindow(ui.ScriptWindow):
find 

		self.pageIdx = 0

add:

		constInfo.ONLINE_NOTIFICATION_START_TIME = app.GetGlobalTimeStamp() + 2


In uimessenger.py in def OnLogin, replace what you already added:
this:

        if not name in constInfo.ALREADY_NOTIFY_LIST:
            self.onlinePopup = uiCommon.OnlinePopup()
            self.onlinePopup.SetUserName(name)
            self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name)
            self.onlinePopup.SlideIn()
        
            constInfo.ALREADY_NOTIFY_LIST.append(name)    

with this:

        currentTime = app.GetGlobalTimeStamp()
        startTime = constInfo.ONLINE_NOTIFICATION_START_TIME
        
        if not name in constInfo.ALREADY_NOTIFY_LIST and currentTime > startTime:
            self.onlinePopup = uiCommon.OnlinePopup()
            self.onlinePopup.SetUserName(name)
            self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name)
            self.onlinePopup.SlideIn()
            constInfo.ALREADY_NOTIFY_LIST.append(name)



and for the animation to be smoother, in uicommon.py in class OnlinePopup, replace whole OnUpdate definition with this:

		def OnUpdate(self):
			x, y = self.GetLocalPosition()
	
			# Handle the slide-in animation
			if self.isActiveSlide:
				target_x = 10  # Final visible X position (how far it slides in)
				distance = target_x - x
				step = max(1, int(abs(distance) * 0.15))  # Smooth easing: fast at first, slower as it reaches target
	
				if x < target_x:
					self.SetPosition(x + step, y)
				else:
					# Snap to final position and stop sliding in
					self.SetPosition(target_x, y)
					self.isActiveSlide = False
	
			# Handle the slide-out animation
			elif self.isActiveSlideOut:
				target_x = -self.wndWidth  # Fully hidden to the left
				distance = target_x - x
				step = max(1, int(abs(distance) * 0.15))  # Same easing as slide-in
	
				if x > target_x:
					self.SetPosition(x - step, y)
				else:
					# Snap to hidden position and close the popup
					self.SetPosition(target_x, y)
					self.isActiveSlideOut = False
					self.Close()
	
			# Check if the popup should start sliding out (after 5 seconds)
			elif self.endTime - app.GetGlobalTimeStamp() <= 0:
				if not self.isActiveSlideOut:
					self.isActiveSlideOut = True

 

And don't forget to add import constInfo where is required, such as uimessenger.py or in uicommon.py

dc89f04252640e7b05dae795e0357bb3.gif
https://metin2.download/video/493CP6NmHej06oQsO391yLkJ5FoxHa0N/.mp4

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Good 1
  • Love 1
Link to comment
https://metin2.dev/topic/21657-cool-notify-friends/page/2/#findComment-170800
Share on other sites

  • 1 month later...
On 5/16/2025 at 11:10 PM, Anielle Noir said:

  

After doing the tutorial, modify/add this changes:
in constinfo.py after

    ALREADY_NOTIFY_LIST = []

add:

    ONLINE_NOTIFICATION_START_TIME = 0

 

in uimessenger.py in class MessengerWindow(ui.ScriptWindow):
find 

		self.pageIdx = 0

add:

		constInfo.ONLINE_NOTIFICATION_START_TIME = app.GetGlobalTimeStamp() + 2


In uimessenger.py in def OnLogin, replace what you already added:
this:

        if not name in constInfo.ALREADY_NOTIFY_LIST:
            self.onlinePopup = uiCommon.OnlinePopup()
            self.onlinePopup.SetUserName(name)
            self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name)
            self.onlinePopup.SlideIn()
        
            constInfo.ALREADY_NOTIFY_LIST.append(name)    

with this:

        currentTime = app.GetGlobalTimeStamp()
        startTime = constInfo.ONLINE_NOTIFICATION_START_TIME
        
        if not name in constInfo.ALREADY_NOTIFY_LIST and currentTime > startTime:
            self.onlinePopup = uiCommon.OnlinePopup()
            self.onlinePopup.SetUserName(name)
            self.onlinePopup.SetEvent(ui.__mem_func__(self.OpenWhisper), "MOUSE_LEFT_BUTTON_UP", name)
            self.onlinePopup.SlideIn()
            constInfo.ALREADY_NOTIFY_LIST.append(name)



and for the animation to be smoother, in uicommon.py in class OnlinePopup, replace whole OnUpdate definition with this:

		def OnUpdate(self):
			x, y = self.GetLocalPosition()
	
			# Handle the slide-in animation
			if self.isActiveSlide:
				target_x = 10  # Final visible X position (how far it slides in)
				distance = target_x - x
				step = max(1, int(abs(distance) * 0.15))  # Smooth easing: fast at first, slower as it reaches target
	
				if x < target_x:
					self.SetPosition(x + step, y)
				else:
					# Snap to final position and stop sliding in
					self.SetPosition(target_x, y)
					self.isActiveSlide = False
	
			# Handle the slide-out animation
			elif self.isActiveSlideOut:
				target_x = -self.wndWidth  # Fully hidden to the left
				distance = target_x - x
				step = max(1, int(abs(distance) * 0.15))  # Same easing as slide-in
	
				if x > target_x:
					self.SetPosition(x - step, y)
				else:
					# Snap to hidden position and close the popup
					self.SetPosition(target_x, y)
					self.isActiveSlideOut = False
					self.Close()
	
			# Check if the popup should start sliding out (after 5 seconds)
			elif self.endTime - app.GetGlobalTimeStamp() <= 0:
				if not self.isActiveSlideOut:
					self.isActiveSlideOut = True

 

And don't forget to add import constInfo where is required, such as uimessenger.py or in uicommon.py

dc89f04252640e7b05dae795e0357bb3.gif
https://metin2.download/video/493CP6NmHej06oQsO391yLkJ5FoxHa0N/.mp4

 

Thank you!
How do I get it transparent and colored like in your video? The standard is completely black.

Link to comment
https://metin2.dev/topic/21657-cool-notify-friends/page/2/#findComment-171368
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.