avertuss 48 Posted September 13, 2021 Share Posted September 13, 2021 I have problem with GetGlobalPosition too. Link to comment Share on other sites More sharing options...
lordsas61 15 Posted September 16, 2021 Share Posted September 16, 2021 (edited) yes not work Edited September 21, 2021 by lordsas61 Link to comment Share on other sites More sharing options...
Maze 8 Posted September 16, 2021 Share Posted September 16, 2021 4 hours ago, lordsas61 said: GetGlobalPosition Problem Solution search ui.py class DragButton(Button): def SetRestrictMovementArea(self, x, y, width, height): wndMgr.SetRestrictMovementArea(self.hWnd, x, y, width, height) add under def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd) for me not work Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted September 21, 2021 Share Posted September 21, 2021 0921 21:06:29194 :: Traceback (most recent call last): 0921 21:06:29194 :: File "uiChat.py", line 1213, in OnRender 0921 21:06:29194 :: File "uiChat.py", line 1158, in Refresh 0921 21:06:29194 :: File "uiChat.py", line 1182, in RefreshBoardViewState 0921 21:06:29200 :: AttributeError 0921 21:06:29200 :: : 0921 21:06:29200 :: 'int' object has no attribute 'GetGlobalPosition' 0921 21:06:29200 :: yeah..same Link to comment Share on other sites More sharing options...
SamuraiHUN 1548 Posted September 21, 2021 Share Posted September 21, 2021 (edited) ui.py class Window(object): search this: def GetLocalPosition(self): return wndMgr.GetWindowLocalPosition(self.hWnd) add under this: def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd) I don't know why lordsas wanted to add it to the Dragbutton class. Edited September 21, 2021 by SamuraiHUN Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted September 21, 2021 Share Posted September 21, 2021 14 minutes ago, SamuraiHUN said: ui.py class Window(object): search this: def GetLocalPosition(self): return wndMgr.GetWindowLocalPosition(self.hWnd) add under this: def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd) I don't know why lordsas wanted to add it to the Dragbutton class. i already have it there.. Link to comment Share on other sites More sharing options...
zsoltiabeka10 17 Posted September 21, 2021 Share Posted September 21, 2021 1 hour ago, HaiosMotan said: i already have it there.. Same here, already have it and still buggy... Link to comment Share on other sites More sharing options...
Maze 8 Posted September 21, 2021 Share Posted September 21, 2021 2 hours ago, SamuraiHUN said: ui.py class Window(object): search this: def GetLocalPosition(self): return wndMgr.GetWindowLocalPosition(self.hWnd) add under this: def GetGlobalPosition(self): return wndMgr.GetWindowGlobalPosition(self.hWnd) I don't know why lordsas wanted to add it to the Dragbutton class. I already have this Link to comment Share on other sites More sharing options...
Contributor Veltor88 5150 Posted September 21, 2021 Contributor Share Posted September 21, 2021 (edited) Working perfectly Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Maze 8 Posted September 21, 2021 Share Posted September 21, 2021 (edited) 18 minutes ago, Veltor88 said: Working perfectly When you write in the chat and teleport quickly you will have another chat on top of this one. So it doesn't work properly. Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Contributor Veltor88 5150 Posted September 21, 2021 Contributor Share Posted September 21, 2021 18 minutes ago, Maze said: When you write in the chat and teleport quickly you will have another chat on top of this one. So it doesn't work properly. I dont have any problem. Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8174 Posted September 21, 2021 Author Honorable Member Share Posted September 21, 2021 (edited) Please, avoid spamming this topic and when you post a problem show us a screenshot or GIF / video to help us identify the problem. I have reviewed and double checked the entire system on a clean server file "40250", there is no problem with GetGlobalPosition function or the pickle functions, you don’t even need the pickle module in the library because it uses standard C. About the GetGlobalPosition issue, there is only 1 GetGlobalPosition inside the Window class since 2014 so you don’t need to add another one anywhere else and the system doesn’t even call this function inside the ChatWindow whatsoever. @Maze, when you teleport, if the setting window is open, it will close, this has been fixed 21 days ago. If you need a better guide than the tutorial guidelines I made, check the entire file I implemented the system clicking the link below. This is the hidden content, please Sign In or Sign Up Troubleshooting on older clients. Spoiler Error: <type 'exceptions.TypeError'>:__pack_import() takes at most 4 arguments (5 given) Solution: ''' 1. @ system.py ''' # Search def __pack_import(name, globals = None, locals = None, fromlist = None): # Replace with def __pack_import(name, globals = None, locals = None, fromlist = None, level = -1): Error: File "Lib\copy_reg.py", line 70, in _reduce_ex <TypeError> can't pickle file objects Solution: (This has been fixed 15 days ago, check the repository for a detailed log.) ''' 1. @ uiChat.py ''' # Search and remove cPickle.dumps(file) Here is also a preview of the system working on an older client which sources and root files are clean / basic. Preview: https://metin2.download/picture/R9TZiGfo73WdqDZ2rOLpSFJO6flaE9m2/.gif Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal 56 1 1 1 1 3 14 2 18 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted September 22, 2021 Share Posted September 22, 2021 (edited) 8 hours ago, Owsap said: Please, avoid spamming this topic and when you post a problem show us a screenshot or GIF / video to help us identify the problem. I have reviewed and double checked the entire system on a clean server file "40250", there is no problem with GetGlobalPosition function or the pickle functions, you don’t even need the pickle module in the library because it uses standard C. About the GetGlobalPosition issue, there is only 1 GetGlobalPosition inside the Window class since 2014 so you don’t need to add another one anywhere else and the system doesn’t even call this function inside the ChatWindow whatsoever. @Maze, when you teleport, if the setting window is open, it will close, this has been fixed 21 days ago. If you need a better guide than the tutorial guidelines I made, check the entire file I implemented the system clicking the link below. Hidden Content https://metin2.dev/bin/?7e843df8174975c5#GVK52jsvmEckvw2gvVbEY1g9d3wDrurG5BN5c6PkCsGy Troubleshooting on older clients. Reveal hidden contents Error: <type 'exceptions.TypeError'>:__pack_import() takes at most 4 arguments (5 given) Solution: ''' 1. @ system.py ''' # Search def __pack_import(name, globals = None, locals = None, fromlist = None): # Replace with def __pack_import(name, globals = None, locals = None, fromlist = None, level = -1): Error: File "Lib\copy_reg.py", line 70, in _reduce_ex <TypeError> can't pickle file objects Solution: (This has been fixed 15 days ago, check the repository for a detailed log.) ''' 1. @ uiChat.py ''' # Search and remove cPickle.dumps(file) Here is also a preview of the system working on an older client which sources and root files are clean / basic. Preview: https://metin2.download/picture/R9TZiGfo73WdqDZ2rOLpSFJO6flaE9m2/.gif Here is the video Here is my uiChat.py https://pastebin.com/fy5abTU7 just compared like 5 times with the uichat.py you posted above. (also re-checked the client source part) and here is the error the people get 0922 10:53:17367 :: Traceback (most recent call last): 0922 10:53:17367 :: File "uiChat.py", line 1205, in OnRender 0922 10:53:17368 :: File "uiChat.py", line 1150, in Refresh 0922 10:53:17368 :: File "uiChat.py", line 1174, in RefreshBoardViewState 0922 10:53:17368 :: AttributeError 0922 10:53:17368 :: : 0922 10:53:17368 :: 'int' object has no attribute 'GetGlobalPosition' 0922 10:53:17368 :: as i understand, when you warp Destroy will set self.btnChatSizing = 0 and will remain like that,it will not set self.btnChatSizing = btnChatSizing again commenting #define ENABLE_CHATTING_WINDOW_RENEWAL in local_inc.h (disabling the sistem) solves the problem,the error doesn't appear anymore. Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
SamuraiHUN 1548 Posted September 22, 2021 Share Posted September 22, 2021 3 hours ago, HaiosMotan said: Here is the video Here is my uiChat.py Hidden Content Give reaction to this post to see the hidden content. just compared like 5 times with the uichat.py you posted above. (also re-checked the client source part) and here is the error the people get 0922 10:53:17367 :: Traceback (most recent call last): 0922 10:53:17367 :: File "uiChat.py", line 1205, in OnRender 0922 10:53:17368 :: File "uiChat.py", line 1150, in Refresh 0922 10:53:17368 :: File "uiChat.py", line 1174, in RefreshBoardViewState 0922 10:53:17368 :: AttributeError 0922 10:53:17368 :: : 0922 10:53:17368 :: 'int' object has no attribute 'GetGlobalPosition' 0922 10:53:17368 :: as i understand, when you warp Destroy will set self.btnChatSizing = 0 and will remain like that,it will not set self.btnChatSizing = btnChatSizing again commenting #define ENABLE_CHATTING_WINDOW_RENEWAL in local_inc.h (disabling the sistem) solves the problem,the error doesn't appear anymore. Is it possible that you didn't call locale_inc.h from the Userinterface project somewhere? Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted September 22, 2021 Share Posted September 22, 2021 50 minutes ago, SamuraiHUN said: Is it possible that you didn't call locale_inc.h from the Userinterface project somewhere? nope,the system works as it should,the problem is the chat window Link to comment Share on other sites More sharing options...
Schyck 13 Posted September 22, 2021 Share Posted September 22, 2021 (edited) You guys are looking for the solution by looking at the wrong problem. The syserr may tell you something related to GetGlobalPosition, but that's not really the problem. The solution is easier than it sounds: #--1 #In the def __init__ from the class ChatSettingWindow: #Replace this: def __init__(self, parent): #With this: def __init__(self): #In the same define, search and delete: self.parent = parent #--2 #In this define def __OnClickSave(self): #Delete this: if self.parent: self.parent.RefreshChatWindow() #--3 #In this define def __QuestionPopupAccept(self): #Delete this: if self.parent: self.parent.RefreshChatWindow() # --4 #Replace this: self.wndChatSettingOption = ChatSettingWindow(self) #With this: self.wndChatSettingOption = ChatSettingWindow() Try again, and the "OnRender" after teleport will works good. Edited September 22, 2021 by Schyck Added 4th step 1 2 Link to comment Share on other sites More sharing options...
HaiosMotan 402 Posted September 22, 2021 Share Posted September 22, 2021 26 minutes ago, Schyck said: You guys are looking for the solution by looking at the wrong problem. The syserr may tell you something related to GetGlobalPosition, but that's not really the problem. The solution is easier than it sounds: #--1 #In the def __init__ from the class ChatSettingWindow: #Replace this: def __init__(self, parent): #With this: def __init__(self): #In the same define, search and delete: self.parent = parent #--2 #In this define def __OnClickSave(self): #Delete this: if self.parent: self.parent.RefreshChatWindow() #--3 #In this define def __QuestionPopupAccept(self): #Delete this: if self.parent: self.parent.RefreshChatWindow() Try again, and the "OnRender" after teleport will works good. first thing you need to change self.wndChatSettingOption = ChatSettingWindow(self) to self.wndChatSettingOption = ChatSettingWindow() but after you done this all,the system doesn't work as intended,because you just deleted the RefreshChatWindow() so,if you un-check an option and save,the chat will not refresh => the messages you want to dissapear,don't dissapear Link to comment Share on other sites More sharing options...
Schyck 13 Posted September 22, 2021 Share Posted September 22, 2021 (edited) Spoiler 10 minutes ago, HaiosMotan said: first thing you need to change self.wndChatSettingOption = ChatSettingWindow(self) to self.wndChatSettingOption = ChatSettingWindow() but after you done this all,the system doesn't work as intended,because you just deleted the RefreshChatWindow() so,if you un-check an option and save,the chat will not refresh => the messages you want to dissapear,don't dissapear Yes, I forgot to put that part in the post I made. But what I put was the solution for the problem you were having. What you comment now can be easily solved if you use your reasoning a little. Here we go: # Just delete all related with "RefreshChatWindow" (except define, obviously), and change this define like this: def OnUpdate(self): if self.boardState == chatm2g.BOARD_STATE_EDIT: if app.ENABLE_CHATTING_WINDOW_RENEWAL: self.RefreshChatWindow() chatm2g.Update(self.chatID) elif self.boardState == chatm2g.BOARD_STATE_VIEW: if systemSetting.IsViewChat(): if app.ENABLE_CHATTING_WINDOW_RENEWAL: self.RefreshChatWindow() chatm2g.Update(self.chatID) # That's all! Edited September 22, 2021 by Schyck 1 4 Link to comment Share on other sites More sharing options...
Maze 8 Posted September 22, 2021 Share Posted September 22, 2021 2 hours ago, Schyck said: Hide contents Yes, I forgot to put that part in the post I made. But what I put was the solution for the problem you were having. What you comment now can be easily solved if you use your reasoning a little. Here we go: # Just delete all related with "RefreshChatWindow" (except define, obviously), and change this define like this: def OnUpdate(self): if self.boardState == chatm2g.BOARD_STATE_EDIT: if app.ENABLE_CHATTING_WINDOW_RENEWAL: self.RefreshChatWindow() chatm2g.Update(self.chatID) elif self.boardState == chatm2g.BOARD_STATE_VIEW: if systemSetting.IsViewChat(): if app.ENABLE_CHATTING_WINDOW_RENEWAL: self.RefreshChatWindow() chatm2g.Update(self.chatID) # That's all! FIXED. Thanks 1 Link to comment Share on other sites More sharing options...
Active+ Member HFWhite 499 Posted September 25, 2021 Active+ Member Share Posted September 25, 2021 On 9/22/2021 at 7:33 PM, Schyck said: Reveal hidden contents Yes, I forgot to put that part in the post I made. But what I put was the solution for the problem you were having. What you comment now can be easily solved if you use your reasoning a little. Here we go: # Just delete all related with "RefreshChatWindow" (except define, obviously), and change this define like this: def OnUpdate(self): if self.boardState == chatm2g.BOARD_STATE_EDIT: if app.ENABLE_CHATTING_WINDOW_RENEWAL: self.RefreshChatWindow() chatm2g.Update(self.chatID) elif self.boardState == chatm2g.BOARD_STATE_VIEW: if systemSetting.IsViewChat(): if app.ENABLE_CHATTING_WINDOW_RENEWAL: self.RefreshChatWindow() chatm2g.Update(self.chatID) # That's all! It's even nicer this way because it updates in real time, thank you for the fix! Link to comment Share on other sites More sharing options...
Active Member nazox 213 Posted September 26, 2021 Active Member Share Posted September 26, 2021 (edited) Thanks. Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Active+ Member blaxis 275 Posted October 1, 2021 Active+ Member Share Posted October 1, 2021 (edited) How can I position the place I marked? (Dice's no problem. I removed.) Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Active Member nazox 213 Posted October 1, 2021 Active Member Share Posted October 1, 2021 (edited) 2 hours ago, blaxis said: How can I position the place I marked? (Dice's no problem. I removed.) In chatsettingwindow.py you need edit Quote ## Experiencia y casilla { "name" : "chatting_setting_exp_bg", "type" : "image", "x" : 18, "y" : XXX, <-Edit only this x e y "image" : CHATTING_PATH + "chattingoption_sub_large_bg.sub", "children" : ( { "name" : "chatting_setting_exp", "type" : "text", "x" : 0, "y" : 0, "text" : uiScriptLocale.CHATTING_SETTING_EXP, "all_align":"center" }, ), }, ## Items y casilla { "name" : "chatting_setting_item_bg", "type" : "image", "x" : 18, "y" : XXX, <-Edit only this x e y "image" : CHATTING_PATH + "chattingoption_sub_large_bg.sub", "children" : ( { "name" : "chatting_setting_item", "type" : "text", "x" : 0, "y" : 0, "text" : uiScriptLocale.CHATTING_SETTING_ITEM, "all_align":"center" }, ), }, ## Yang y casilla { "name" : "chatting_setting_gold_bg", "type" : "image", "x" : 18, "y" : XXX, <-Edit only this x e y "image" : CHATTING_PATH + "chattingoption_sub_large_bg.sub", "children" : ( { "name" : "chatting_setting_gold", "type" : "text", "x" : 0, "y" : 0, "text" : uiScriptLocale.CHATTING_SETTING_GOLD, "all_align":"center" }, ), }, edit only XXX, <-Edit only this x e y with numbers if don't remember bad you need add 18 i mean exp = 10 item = 10+18 =28 etc Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Active+ Member blaxis 275 Posted October 1, 2021 Active+ Member Share Posted October 1, 2021 (edited) 29 minutes ago, nazox said: In chatsettingwindow.py you need edit edit only XXX, <-Edit only this x e y with numbers if don't remember bad you need add 18 i mean exp = 10 item = 10+18 =28 etc I tried it but it didn't work. I couldn't find the location setting of the CheckBox. @nazox I solved, thank you uichat.py; if key >= OPTION_CHECKBOX_EXP_INFO: yPos = 64 + (31 * 2) I changed with; if key >= OPTION_CHECKBOX_EXP_INFO: yPos = 64 + (31 * 2.6) Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Active Member nazox 213 Posted October 1, 2021 Active Member Share Posted October 1, 2021 (edited) 20 minutes ago, blaxis said: Lo intenté pero no funcionó. No pude encontrar la configuración de ubicación de CheckBox. @nazox Lo resolví, gracias uichat.py; Me cambié con; Good! if you need help to remove dice tell me Edited August 17, 2022 by Metin2 Dev Core X - External 2 Internal 1 Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Recommended Posts