-
Posts
64 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Marcos17
-
-
On 5/11/2023 at 11:42 PM, Grzyb said:
Video:
Code:
import os import shutil source_folder = '/txt/src' target_folder = '/txt/src2' if not os.path.exists(target_folder): os.makedirs(target_folder) ifdef = '#ifdef ' ifndef = '#ifndef ' define = 'ENABLE_SWITCHBOT' def process_files(source_folder, target_folder): for entry in os.scandir(source_folder): if entry.is_file() and entry.name.endswith(('.cpp', '.h')): with open(entry.path, 'r', encoding='latin1') as file: new_file = None copy = False lines = file.readlines() line_num = 0 for line in lines: if ifdef + define in line or ifndef + define in line: copy = True if not new_file: new_file = open(os.path.join(target_folder, entry.name), 'w', encoding='latin1') for i in range(max(0, line_num - 30), line_num): new_file.write(lines[i]) if copy: new_file.write(line) if '#endif' in line: if copy: new_file.write("\n // =================== INNA FUNKCJA ================= \n \n") new_file.write("// ====== WYSZUKAJ: ") new_file.write(define) new_file.write("\n// Tutorial wygenerowany automatycznie przez Grzyb.ovh \n") new_file.write("\n \n") copy = False line_num += 1 if new_file: new_file.close() elif entry.is_dir(): new_target_folder = os.path.join(target_folder, entry.name) if not os.path.exists(new_target_folder): os.makedirs(new_target_folder) process_files(entry.path, new_target_folder) process_files(source_folder, target_folder)
Is it possible to use cmd?
- 1
-
On 9/17/2023 at 8:20 PM, Grzyb said:
apt install python3-pip
pip3 install chardet
or
pip install chardet
None of the commands work:
pip3 install chardet
pip3: Command not found.
pip install chardet
pip: Command not found.
-
On 8/22/2023 at 12:51 PM, Marcos17 said:
up
- 1
-
On 8/17/2023 at 8:42 PM, Marcos17 said:
Good night everyone, I'm implementing the Owsap system, but I'm having problems with uiCharacter.py
I already searched here in the forum I didn't get a solution, if someone can help me, thanks in advance
Error:
0817 20:24:02839 ::
uiCharacter.py(line:1132) __LoadWindow
uiCharacter.py(line:979) __BindObject
uiCharacter.py(line:637) __init__
uiCharacter.py(line:343) __init__CharacterWindow.__LoadWindow - <type 'exceptions.AttributeError'>:'Window' object has no attribute 'SetOnMouseLeftButtonUpEvent'
0817 20:24:02840 :: ============================================================================================================
0817 20:24:02840 :: Abort!!!!
0817 20:24:02840 :: filename=exception.py, name=Abort
0817 20:24:02840 :: filename=uiCharacter.py, name=__LoadWindow
0817 20:24:02840 :: filename=uiCharacter.py, name=__init__
0817 20:24:02840 :: filename=interfaceModule.py, name=__MakeWindows
0817 20:24:02840 :: filename=interfaceModule.py, name=MakeInterface
0817 20:24:02840 :: filename=game.py, name=__init__
0817 20:24:02840 :: filename=networkModule.py, name=SetGamePhase
0817 20:24:02840 :: filename=prototype.py, name=RunApp
0817 20:24:02840 :: filename=prototype.py, name=<module>
0817 20:24:02840 :: filename=system.py, name=execfile
0817 20:24:02840 :: filename=system.py, name=RunMainScript
0817 20:24:02840 :: filename=system.py, name=<module>
0817 20:24:02840 :: filename=<string>, name=<module>
up
-
Good night everyone, I'm implementing the Owsap system, but I'm having problems with uiCharacter.py
I already searched here in the forum I didn't get a solution, if someone can help me, thanks in advance
Error:
Spoiler0817 20:24:02839 ::
uiCharacter.py(line:1132) __LoadWindow
uiCharacter.py(line:979) __BindObject
uiCharacter.py(line:637) __init__
uiCharacter.py(line:343) __init__CharacterWindow.__LoadWindow - <type 'exceptions.AttributeError'>:'Window' object has no attribute 'SetOnMouseLeftButtonUpEvent'
0817 20:24:02840 :: ============================================================================================================
0817 20:24:02840 :: Abort!!!!
0817 20:24:02840 :: filename=exception.py, name=Abort
0817 20:24:02840 :: filename=uiCharacter.py, name=__LoadWindow
0817 20:24:02840 :: filename=uiCharacter.py, name=__init__
0817 20:24:02840 :: filename=interfaceModule.py, name=__MakeWindows
0817 20:24:02840 :: filename=interfaceModule.py, name=MakeInterface
0817 20:24:02840 :: filename=game.py, name=__init__
0817 20:24:02840 :: filename=networkModule.py, name=SetGamePhase
0817 20:24:02840 :: filename=prototype.py, name=RunApp
0817 20:24:02840 :: filename=prototype.py, name=<module>
0817 20:24:02840 :: filename=system.py, name=execfile
0817 20:24:02840 :: filename=system.py, name=RunMainScript
0817 20:24:02840 :: filename=system.py, name=<module>
0817 20:24:02840 :: filename=<string>, name=<module>
-
19 hours ago, Marcos17 said:
Solved, thanks a lot bro @ DemOnJR
-
Hello, I'm having the following error when compiling the Source, can anyone help me with the solution.
Thanks in advance... -
3 hours ago, Mali said:
clip masking -> experimental
@ Mali Perfecto, Thank You
- 2
-
4 hours ago, coadapute123 said:
I am also having the same problem.
@ Mali Any idea what it could be?
The sysser is clean -
25 minutes ago, Mali said:
I left that choice up to you. Trigger the open function way you want.
Here is example for F5:
###@@@game.py: #Find onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7) #Add onPressKeyDict[app.DIK_F5] = lambda : self.OpenTeleportWindow() #Add new func def OpenTeleportWindow(self): if self.interface: self.interface.OpenTeleportWindow()
Thank You
- 2
-
@ Mali Is it necessary to create a button to open the gui?
-
1 hour ago, Marcos17 said:
Good afternoon...
I'm trying to use your system, and I'm getting an error, I was wondering if you could help me...
the error is as follows:
0720 13:39:23819 ::
uiSystemOption.py(line:80) __Load_BindObject
ui.py(line:3121) GetChildOptionDialog.__Load_BindObject - <type 'exceptions.KeyError'>:'auto_hide_on'
0720 13:39:23819 :: ============================================================================================================
0720 13:39:23819 :: Abort!!!!
0720 13:39:23819 :: filename=exception.py, name=Abort
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load_BindObject
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load
0720 13:39:23819 :: filename=uiSystemOption.py, name=__init__
0720 13:39:23819 :: filename=uiSystem.py, name=__ClickSystemOptionButton
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=CallEvent
0720 13:39:23819 :: filename=prototype.py, name=RunApp
0720 13:39:23819 :: filename=prototype.py, name=<module>
0720 13:39:23819 :: filename=system.py, name=execfile
0720 13:39:23819 :: filename=system.py, name=RunMainScript
0720 13:39:23819 :: filename=system.py, name=<module>
0720 13:39:23819 :: filename=<string>, name=<module>Solved, thanks bro @ DemOnJR
- 1
- 1
-
Good afternoon...
I'm trying to use your system, and I'm getting an error, I was wondering if you could help me...
the error is as follows:
0720 13:39:23819 ::
uiSystemOption.py(line:80) __Load_BindObject
ui.py(line:3121) GetChildOptionDialog.__Load_BindObject - <type 'exceptions.KeyError'>:'auto_hide_on'
0720 13:39:23819 :: ============================================================================================================
0720 13:39:23819 :: Abort!!!!
0720 13:39:23819 :: filename=exception.py, name=Abort
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load_BindObject
0720 13:39:23819 :: filename=uiSystemOption.py, name=__Load
0720 13:39:23819 :: filename=uiSystemOption.py, name=__init__
0720 13:39:23819 :: filename=uiSystem.py, name=__ClickSystemOptionButton
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=__call__
0720 13:39:23819 :: filename=ui.py, name=CallEvent
0720 13:39:23819 :: filename=prototype.py, name=RunApp
0720 13:39:23819 :: filename=prototype.py, name=<module>
0720 13:39:23819 :: filename=system.py, name=execfile
0720 13:39:23819 :: filename=system.py, name=RunMainScript
0720 13:39:23819 :: filename=system.py, name=<module>
0720 13:39:23819 :: filename=<string>, name=<module> -
I tried using the script and got the following error...
Error:
Traceback (most recent call last):
File "/txt/converter.py", line 3, in <module>
import chardet
ModuleNotFoundError: No module named 'chardet'
-
Thanks for the contribution...
-
Good evening everyone...
I'm starting to work with Metin2, I'm still inexperienced, but I really want to learn...
I'm Brazilian and would like to know if it's possible to add the Brazilian Portuguese language, and if it's possible...
If possible, could you tell me if I need to make changes to source_game, etc...Thank you in advance for your attention and thank you for your contribution to the metin2 public
-
Help Plies...
0531 21:15:17998 ::
uiShop.py(line:73) LoadDialog
ui.py(line:2768) GetChildShopDialog.LoadDialog.BindObject - <type 'exceptions.KeyError'>:'MiddleTab1'
0531 21:15:17998 :: ============================================================================================================
0531 21:15:17998 :: Abort!!!!- 1
-
On 3/24/2022 at 5:42 AM, Cryptex said:
you just need to add more bonuses in item_attr_rare
Thank You Very Much
-
50 minutes ago, Ikarus_ said:
Using this code you can check how many references to your AtlasWindow and AtlasWindow.board are still not moved to None.
def Destroy(self): import dbg import sys self.board.SetCloseEvent(None) dbg.TraceError("AtlasWindow ref count = {}".format(sys.getrefcount(self)-1)) dbg.TraceError("AtlasWindow.board ref count = {}".format(sys.getrefcount(self.board)-1)) miniMap.UnregisterAtlasWindow() self.ClearDictionary() self.AtlasMainWindow = None self.tooltipAtlasClose = 0 self.tooltipInfo = None self.infoGuildMark = None self.board = None
syserr:
Spoiler0321 19:38:19963 :: AtlasWindow ref count = 4
0321 19:38:19963 :: AtlasWindow.board ref count = 4
0321 19:38:51768 :: AtlasWindow ref count = 4
0321 19:38:51768 :: AtlasWindow.board ref count = 4
- 1
-
2 hours ago, Ikarus_ said:
Eu postei a solução, mas ao recarregar esta página de discussão, não consigo vê-la. Estou postando mais uma vez.
Poderia resolver seu bug.
Unfortunately, it didn't solve it, and in this way the black map doesn't even close by clicking on the x
-
19 minutes ago, Ikarus_ said:
It looks the message edit wasn't applied successfully, my bad.
So here's the code with the fix applied.
def Destroy(self): import dbg references = vars(self.board) dbg.TraceError("STARTING AtlasWindow.board DUMP") for name, value in references.items(): dbg.TraceError("AtlasWindow.board.{} = {}".format(name, value)) dbg.TraceError("STARTING AtlasWindow.board.titleBar DUMP") for name, value in vars(self.board.titleBar).items(): dbg.TraceError("AtlasWindow.board.titleBar.{} = {}".format(name, value)) miniMap.UnregisterAtlasWindow() self.ClearDictionary() self.AtlasMainWindow = None self.tooltipAtlasClose = 0 self.tooltipInfo = None self.infoGuildMark = None self.board = None
Spoiler0320 21:21:40840 :: STARTING AtlasWindow.board DUMP
0320 21:21:40840 :: AtlasWindow.board.mouseLeftButtonUpEvent = None
0320 21:21:40840 :: AtlasWindow.board.mouseLeftButtonDownArgs = None
0320 21:21:40840 :: AtlasWindow.board.hWnd = 850923968
0320 21:21:40840 :: AtlasWindow.board.baseX = 0
0320 21:21:40840 :: AtlasWindow.board.baseY = 0
0320 21:21:40840 :: AtlasWindow.board.moveWindowEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar = <ui.TitleBar object at 0x12F63890>
0320 21:21:40840 :: AtlasWindow.board.overInArgs = None
0320 21:21:40840 :: AtlasWindow.board.renderArgs = None
0320 21:21:40840 :: AtlasWindow.board.mouseLeftButtonDoubleClickEvent = None
0320 21:21:40840 :: AtlasWindow.board.mouseRightButtonDownArgs = None
0320 21:21:40840 :: AtlasWindow.board.Base = <ui.ExpandedImageBox object at 0x12F63650>
0320 21:21:40840 :: AtlasWindow.board.overInEvent = None
0320 21:21:40840 :: AtlasWindow.board.onMouseLeftButtonUpEvent = None
0320 21:21:40840 :: AtlasWindow.board.Corners = [<ui.ExpandedImageBox object at 0x12F63750>, <ui.ExpandedImageBox object at 0x12F636F0>, <ui.ExpandedImageBox object at 0x12F63710>, <ui.ExpandedImageBox object at 0x12F63850>]
0320 21:21:40840 :: AtlasWindow.board.Lines = [<ui.ExpandedImageBox object at 0x12F63B30>, <ui.ExpandedImageBox object at 0x12F63930>, <ui.ExpandedImageBox object at 0x12F63790>, <ui.ExpandedImageBox object at 0x12F63AD0>]
0320 21:21:40840 :: AtlasWindow.board.mouseLeftButtonDownEvent = None
0320 21:21:40840 :: AtlasWindow.board.parentWindow = 0
0320 21:21:40840 :: AtlasWindow.board.titleName = <ui.TextLine object at 0x12F63730>
0320 21:21:40840 :: AtlasWindow.board.mouseLeftButtonUpArgs = None
0320 21:21:40840 :: AtlasWindow.board.mouseRightButtonDownEvent = None
0320 21:21:40840 :: AtlasWindow.board.overOutEvent = None
0320 21:21:40840 :: AtlasWindow.board.renderEvent = None
0320 21:21:40840 :: AtlasWindow.board.overOutArgs = None
0320 21:21:40840 :: AtlasWindow.board.clickEvent = None
0320 21:21:40840 :: STARTING AtlasWindow.board.titleBar DUMP
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseLeftButtonUpEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseLeftButtonDownArgs = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.hWnd = 850931720
0320 21:21:40840 :: AtlasWindow.board.titleBar.baseX = 0
0320 21:21:40840 :: AtlasWindow.board.titleBar.baseY = 0
0320 21:21:40840 :: AtlasWindow.board.titleBar.moveWindowEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.overInArgs = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.imgRight = <ui.ImageBox object at 0x12F637D0>
0320 21:21:40840 :: AtlasWindow.board.titleBar.renderArgs = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseLeftButtonDoubleClickEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseRightButtonDownArgs = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.overInEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.imgLeft = <ui.ImageBox object at 0x12F63910>
0320 21:21:40840 :: AtlasWindow.board.titleBar.onMouseLeftButtonUpEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseLeftButtonDownEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.parentWindow = 0
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseLeftButtonUpArgs = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.mouseRightButtonDownEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.btnClose = <ui.Button object at 0x12F63B10>
0320 21:21:40840 :: AtlasWindow.board.titleBar.imgCenter = <ui.ExpandedImageBox object at 0x12F63AB0>
0320 21:21:40840 :: AtlasWindow.board.titleBar.overOutEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.renderEvent = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.overOutArgs = None
0320 21:21:40840 :: AtlasWindow.board.titleBar.clickEvent = None -
1 hour ago, Ikarus_ said:
Look at this message, copy this code and make the test. The last test you made use an old Destroy which i corrected yesterday night (for this reason you need to copy again it)
Using the code you said to put this appears in syseer:
Spoiler0320 20:55:48182 :: STARTING AtlasWindow.board DUMP
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48182 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: AtlasWindow.board.{} = {}
0320 20:55:48183 :: STARTING AtlasWindow.board.titleBar DUMP
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {}
0320 20:55:48183 :: AtlasWindow.board.titleBar.{} = {} -
4 minutes ago, Ikarus_ said:
I meant the code posted by me. The last Destroy
First
Spoilerdef Destroy(self):
miniMap.UnregisterAtlasWindow()
self.ClearDictionary()
self.AtlasMainWindow = None
self.tooltipAtlasClose = 0
self.tooltipInfo = None
self.infoGuildMark = None
self.board = Noneimport dbg
references = vars(self)
dbg.TraceError("STARTING WITH DUMPING AtlasWindow")
for name, value in references.items():
dbg.TraceError("AtlasWindowReference {}={}".format(name, value)) -
33 minutes ago, Ikarus_ said:
Yesterday i update the code fixing a bug, but it looks you copied it with no fix applied. Can u copy it again?
Spoiler#<----------------------------------------------------------- ># # _ +----------------------------------------------+ _ # # /o)| Código by Marcos Pinheiro de Lima |(o\ # # / / | | \ \ # # ( (_ | Cliente Metin2 ImPaCtO - All Copryght _ | _) ) # # ((\ \)+-/o)--------------------------------- ----(o\-+(/ /)) # # (\\\ \_/ / \ \_/ ///) # # \ / \ / # # \____/ \____/ # # # # - Código by Marcos Lima - Cliente Metin2 ImPaCtO - # # # #<------------------------------------------------------------># import ui import uiScriptLocale import wndMgr import chr import player import miniMap import localeInfo import net import app import colorInfo import constInfo import background import time import snd import chat import bestproductiongame import background import time import re import os import serverInfo import uiToolTip import gameInfo import uiCommon import systemSetting import serverInfo class MapTextToolTip(ui.Window): def __init__(self): ui.Window.__init__(self) textLine = ui.TextLine() textLine.SetParent(self) textLine.SetHorizontalAlignCenter() textLine.SetOutline() textLine.SetHorizontalAlignRight() textLine.Show() self.textLine = textLine def __del__(self): ui.Window.__del__(self) def SetText(self, text): self.textLine.SetText(text) def SetTooltipPosition(self, PosX, PosY): if localeInfo.IsARABIC(): w, h = self.textLine.GetTextSize() self.textLine.SetPosition(PosX - w - 5, PosY) else: self.textLine.SetPosition(PosX - 5, PosY) def SetTextColor(self, TextColor): self.textLine.SetPackedFontColor(TextColor) def GetTextSize(self): return self.textLine.GetTextSize() class AtlasWindow(ui.ScriptWindow): class AtlasRenderer(ui.Window): def __init__(self): ui.Window.__init__(self) self.AddFlag("not_pick") def OnUpdate(self): miniMap.UpdateAtlas() def OnRender(self): (x, y) = self.GetGlobalPosition() fx = float(x) fy = float(y) miniMap.RenderAtlas(fx, fy) def HideAtlas(self): miniMap.HideAtlas() def ShowAtlas(self): miniMap.ShowAtlas() def __init__(self): self.tooltipInfo = MapTextToolTip() self.tooltipInfo.Hide() self.infoGuildMark = ui.MarkBox() self.infoGuildMark.Hide() self.AtlasMainWindow = None self.mapName = "" self.board = 0 ui.ScriptWindow.__init__(self) def __del__(self): ui.ScriptWindow.__del__(self) def SetMapName(self, mapName): if 949==app.GetDefaultCodePage(): try: self.board.SetTitleName(localeInfo.MINIMAP_ZONE_NAME_DICT[mapName]) except: pass def LoadWindow(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/AtlasWindow.py") except: import exception exception.Abort("AtlasWindow.LoadWindow.LoadScript") try: self.board = self.GetChild("board") except: import exception exception.Abort("AtlasWindow.LoadWindow.BindObject") self.AtlasMainWindow = self.AtlasRenderer() self.board.SetCloseEvent(self.Hide) self.AtlasMainWindow.SetParent(self.board) self.AtlasMainWindow.SetPosition(7, 30) self.tooltipInfo.SetParent(self.board) self.infoGuildMark.SetParent(self.board) self.SetPosition(wndMgr.GetScreenWidth() - 136 - 256 - 10, 0) self.Hide() miniMap.RegisterAtlasWindow(self) # def Destroy(self): # miniMap.UnregisterAtlasWindow() # self.ClearDictionary() # self.AtlasMainWindow = None # self.tooltipAtlasClose = 0 # self.tooltipInfo = None # self.infoGuildMark = None # self.board = None def Destroy(self): import dbg references = vars(self.board) dbg.TraceError("STARTING AtlasWindow.board DUMP") for name, value in references.items(): dbg.TraceError("AtlasWindow.board.{} = {}", name, value) dbg.TraceError("STARTING AtlasWindow.board.titleBar DUMP") for name, value in vars(self.board.titleBar).items(): dbg.TraceError("AtlasWindow.board.titleBar.{} = {}", name, value) miniMap.UnregisterAtlasWindow() self.ClearDictionary() self.AtlasMainWindow = None self.tooltipAtlasClose = 0 self.tooltipInfo = None self.infoGuildMark = None self.board = None def OnUpdate(self): if not self.tooltipInfo: return if not self.infoGuildMark: return self.infoGuildMark.Hide() self.tooltipInfo.Hide() if FALSE == self.board.IsIn(): return (mouseX, mouseY) = wndMgr.GetMousePosition() (bFind, sName, iPosX, iPosY, dwTextColor, dwGuildID) = miniMap.GetAtlasInfo(mouseX, mouseY) if FALSE == bFind: return if "empty_guild_area" == sName: sName = localeInfo.GUILD_EMPTY_AREA if localeInfo.IsARABIC() and sName[-1].isalnum(): self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY)) else: self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY)) (x, y) = self.GetGlobalPosition() self.tooltipInfo.SetTooltipPosition(mouseX - x, mouseY - y) self.tooltipInfo.SetTextColor(dwTextColor) self.tooltipInfo.Show() self.tooltipInfo.SetTop() if 0 != dwGuildID: textWidth, textHeight = self.tooltipInfo.GetTextSize() self.infoGuildMark.SetIndex(dwGuildID) self.infoGuildMark.SetPosition(mouseX - x - textWidth - 18 - 5, mouseY - y) self.infoGuildMark.Show() def Hide(self): if self.AtlasMainWindow: self.AtlasMainWindow.HideAtlas() self.AtlasMainWindow.Hide() ui.ScriptWindow.Hide(self) def Show(self): if self.AtlasMainWindow: (bGet, iSizeX, iSizeY) = miniMap.GetAtlasSize() if bGet: self.SetSize(iSizeX + 15, iSizeY + 38) if localeInfo.IsARABIC(): self.board.SetPosition(iSizeX+15, 0) self.board.SetSize(iSizeX + 15, iSizeY + 38) #self.AtlasMainWindow.SetSize(iSizeX, iSizeY) self.AtlasMainWindow.ShowAtlas() self.AtlasMainWindow.Show() ui.ScriptWindow.Show(self) def SetCenterPositionAdjust(self, x, y): self.SetPosition((wndMgr.GetScreenWidth() - self.GetWidth()) / 2 + x, (wndMgr.GetScreenHeight() - self.GetHeight()) / 2 + y) def OnPressEscapeKey(self): self.Hide() return TRUE def __RegisterMiniMapColor(type, rgb): miniMap.RegisterColor(type, rgb[0], rgb[1], rgb[2]) class MiniMap(ui.ScriptWindow): CANNOT_SEE_INFO_MAP_DICT = { "metin2_map_monkeydungeon" : FALSE, "metin2_map_monkeydungeon_02" : FALSE, "metin2_map_monkeydungeon_03" : FALSE, "metin2_map_devilsCatacomb" : FALSE, "metin2_map_wood_event1" : FALSE, "metin2_map_n_flame_dungeon_01" : FALSE, "metin2_map_n_snow_dungeon_01" : FALSE, } def __init__(self): ui.ScriptWindow.__init__(self) self.__Initialize() miniMap.Create() miniMap.SetScale(2.0) self.AtlasWindow = AtlasWindow() self.AtlasWindow.LoadWindow() self.AtlasWindow.Hide() self.tooltipMiniMapOpen = MapTextToolTip() self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP) self.tooltipMiniMapOpen.Show() self.tooltipMiniMapClose = MapTextToolTip() self.tooltipMiniMapClose.SetText(localeInfo.UI_CLOSE) self.tooltipMiniMapClose.Show() self.tooltipScaleUp = MapTextToolTip() self.tooltipScaleUp.SetText(localeInfo.MINIMAP_INC_SCALE) self.tooltipScaleUp.Show() self.tooltipScaleDown = MapTextToolTip() self.tooltipScaleDown.SetText(localeInfo.MINIMAP_DEC_SCALE) self.tooltipScaleDown.Show() self.tooltipAnimesfer = MapTextToolTip() self.tooltipAnimesfer.SetText(localeInfo.ANIMESFER) self.tooltipAnimesfer.Show() self.tooltipCombatZone = MapTextToolTip() self.tooltipCombatZone.SetText(localeInfo.COMBAT_ZONE) self.tooltipCombatZone.Show() self.tooltipAtlasOpen = MapTextToolTip() self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_SHOW_AREAMAP) self.tooltipAtlasOpen.Show() self.tooltipInfo = MapTextToolTip() self.tooltipInfo.Show() if miniMap.IsAtlas(): self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_SHOW_AREAMAP) else: self.tooltipAtlasOpen.SetText(localeInfo.MINIMAP_CAN_NOT_SHOW_AREAMAP) self.tooltipInfo = MapTextToolTip() self.tooltipInfo.Show() self.mapName = "" self.isLoaded = 0 self.canSeeInfo = TRUE # AUTOBAN self.imprisonmentDuration = 0 self.imprisonmentEndTime = 0 self.imprisonmentEndTimeText = "" # END_OF_AUTOBAN def __del__(self): miniMap.Destroy() ui.ScriptWindow.__del__(self) def __Initialize(self): self.positionInfo = 0 self.observerCount = 0 if constInfo.MINIMAP_MAPNAME_ENABLE: self.MapNameInfo = "" if constInfo.MINIMAP_DATETIME_ENABLE: self.DateTimeInfo = 0 self.OpenWindow = 0 self.CloseWindow = 0 self.ScaleUpButton = 0 self.ScaleDownButton = 0 self.AnimesferButton = 0 self.MiniMapHideButton = 0 self.MiniMapShowButton = 0 self.AtlasShowButton = 0 if (app.WJ_COMBAT_ZONE): self.btnCombatZone = 0 self.tooltipMiniMapOpen = 0 self.tooltipMiniMapClose = 0 self.tooltipScaleUp = 0 self.tooltipScaleDown = 0 self.tooltipAtlasOpen = 0 self.tooltipInfo = None self.serverInfo = None if app.ENABLE_DEFENSE_WAVE: self.MastHp = 0 def SetMapName(self, mapName): self.mapName=mapName self.AtlasWindow.SetMapName(mapName) if app.TOURNAMENT_PVP_SYSTEM: if player.IsTournamentMap(): self.canSeeInfo = FALSE self.HideMiniMap() ui.ScriptWindow.Hide(self) if self.CANNOT_SEE_INFO_MAP_DICT.has_key(mapName): self.canSeeInfo = FALSE self.HideMiniMap() self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP_CANNOT_SEE) else: self.canSeeInfo = TRUE self.ShowMiniMap() self.tooltipMiniMapOpen.SetText(localeInfo.MINIMAP) # AUTOBAN def SetImprisonmentDuration(self, duration): self.imprisonmentDuration = duration self.imprisonmentEndTime = app.GetGlobalTimeStamp() + duration self.__UpdateImprisonmentDurationText() def __UpdateImprisonmentDurationText(self): restTime = max(self.imprisonmentEndTime - app.GetGlobalTimeStamp(), 0) imprisonmentEndTimeText = localeInfo.SecondToDHM(restTime) if imprisonmentEndTimeText != self.imprisonmentEndTimeText: self.imprisonmentEndTimeText = imprisonmentEndTimeText self.serverInfo.SetText("%s: %s" % (uiScriptLocale.AUTOBAN_QUIZ_REST_TIME, self.imprisonmentEndTimeText)) # END_OF_AUTOBAN def Show(self): self.__LoadWindow() ui.ScriptWindow.Show(self) def __LoadWindow(self): if self.isLoaded == 1: return self.isLoaded = 1 try: pyScrLoader = ui.PythonScriptLoader() if localeInfo.IsARABIC(): pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "Minimap.py") else: pyScrLoader.LoadScriptFile(self, "UIScript/MiniMap.py") except: import exception exception.Abort("MiniMap.LoadWindow.LoadScript") try: self.OpenWindow = self.GetChild("OpenWindow") self.MiniMapWindow = self.GetChild("MiniMapWindow") self.ScaleUpButton = self.GetChild("ScaleUpButton") self.ScaleDownButton = self.GetChild("ScaleDownButton") self.AnimesferButton = self.GetChild("AnimesferButton") self.MiniMapHideButton = self.GetChild("MiniMapHideButton") self.AtlasShowButton = self.GetChild("AtlasShowButton") self.CloseWindow = self.GetChild("CloseWindow") self.MiniMapShowButton = self.GetChild("MiniMapShowButton") self.positionInfo = self.GetChild("PositionInfo") self.observerCount = self.GetChild("ObserverCount") self.serverInfo = self.GetChild("ServerInfo") if app.ENABLE_DEFENSE_WAVE: self.MastHp = self.GetChild("MastHp") self.MastWindow = self.GetChild("MastWindow") self.MastHp.OnMouseOverIn = ui.__mem_func__(self.MastHp.ShowToolTip) self.MastHp.OnMouseOverOut = ui.__mem_func__(self.MastHp.HideToolTip) self.MastHp.SetShowToolTipEvent(self.MastHp.OnMouseOverIn) self.MastHp.SetHideToolTipEvent(self.MastHp.OnMouseOverOut) if (app.WJ_COMBAT_ZONE): self.btnCombatZone = self.GetChild("BattleButton") self.wndMds = self.GetChild("Mds") if constInfo.MINIMAP_MAPNAME_ENABLE: self.MapNameInfo = self.GetChild("MapNameInfo") if constInfo.MINIMAP_DATETIME_ENABLE: self.DateTimeInfo = self.GetChild("DateTimeInfo") except: import exception exception.Abort("MiniMap.LoadWindow.Bind") self.GetChild("Mds").SetFontName("Tahoma:10.8") if constInfo.MINIMAP_MAPNAME_ENABLE==0: self.MapNameInfo.hide() if constInfo.MINIMAP_POSITIONINFO_ENABLE==0: self.positionInfo.Hide() if app.ENABLE_DEFENSE_WAVE: self.MastHp.SetPercentage(5000000, 5000000) self.MastWindow.Hide() self.serverInfo.SetText(net.GetServerInfo()) self.ScaleUpButton.SetEvent(ui.__mem_func__(self.ScaleUp)) self.ScaleDownButton.SetEvent(ui.__mem_func__(self.ScaleDown)) self.MiniMapHideButton.SetEvent(ui.__mem_func__(self.HideMiniMap)) self.MiniMapShowButton.SetEvent(ui.__mem_func__(self.ShowMiniMap)) self.wndCostume = None if (app.WJ_COMBAT_ZONE): self.btnCombatZone.SetEvent(ui.__mem_func__(self.OpenCombatZoneWindow)) self.btnCombatZone.Down() if miniMap.IsAtlas(): self.AtlasShowButton.SetEvent(ui.__mem_func__(self.ShowAtlas)) (ButtonPosX, ButtonPosY) = self.MiniMapShowButton.GetGlobalPosition() self.tooltipMiniMapOpen.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.MiniMapHideButton.GetGlobalPosition() self.tooltipMiniMapClose.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.ScaleUpButton.GetGlobalPosition() self.tooltipScaleUp.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.ScaleDownButton.GetGlobalPosition() self.tooltipScaleDown.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.AnimesferButton.GetGlobalPosition() self.tooltipAnimesfer.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.btnCombatZone.GetGlobalPosition() self.tooltipCombatZone.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.AtlasShowButton.GetGlobalPosition() self.tooltipAtlasOpen.SetTooltipPosition(ButtonPosX, ButtonPosY) self.ShowMiniMap() def Destroy(self): self.HideMiniMap() self.wndMds = 0 self.wndMdsSlot = 0 self.AtlasWindow.Destroy() self.AtlasWindow = None self.ClearDictionary() self.__Initialize() def UpdateObserverCount(self, observerCount): if observerCount>0: self.observerCount.Show() elif observerCount<=0: self.observerCount.Hide() self.observerCount.SetText(localeInfo.MINIMAP_OBSERVER_COUNT % observerCount) if constInfo.MINIMAP_MAPNAME_ENABLE: def UpdateMapName(self, MapName): self.MapNameInfo.SetText("|cfff64e3f|h" + MapName) if constInfo.MINIMAP_DATETIME_ENABLE: def UpdateDateTime(self, dateTime): self.DateTimeInfo.SetText("|cff00ffea|h" + dateTime) def OnUpdate(self): (x, y, z) = player.GetMainCharacterPosition() miniMap.Update(x, y) import constInfo self.wndMds.SetText(str(constInfo.pe)) self.positionInfo.SetText("|cff00ccff(%.0f, %.0f)" % (x/100, y/100)) if self.tooltipInfo: if TRUE == self.MiniMapWindow.IsIn(): (mouseX, mouseY) = wndMgr.GetMousePosition() (bFind, sName, iPosX, iPosY, dwTextColor) = miniMap.GetInfo(mouseX, mouseY) if bFind == 0: self.tooltipInfo.Hide() elif not self.canSeeInfo: self.tooltipInfo.SetText("%s(%s)" % (sName, localeInfo.UI_POS_UNKNOWN)) self.tooltipInfo.SetTooltipPosition(mouseX - 5, mouseY) self.tooltipInfo.SetTextColor(dwTextColor) self.tooltipInfo.Show() else: if localeInfo.IsARABIC() and sName[-1].isalnum(): self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY)) else: self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY)) self.tooltipInfo.SetTooltipPosition(mouseX - 5, mouseY) self.tooltipInfo.SetTextColor(dwTextColor) self.tooltipInfo.Show() else: self.tooltipInfo.Hide() # AUTOBAN if self.imprisonmentDuration: self.__UpdateImprisonmentDurationText() # END_OF_AUTOBAN if TRUE == self.MiniMapShowButton.IsIn(): self.tooltipMiniMapOpen.Show() else: self.tooltipMiniMapOpen.Hide() if TRUE == self.MiniMapHideButton.IsIn(): self.tooltipMiniMapClose.Show() else: self.tooltipMiniMapClose.Hide() if TRUE == self.ScaleUpButton.IsIn(): self.tooltipScaleUp.Show() else: self.tooltipScaleUp.Hide() if TRUE == self.ScaleDownButton.IsIn(): self.tooltipScaleDown.Show() else: self.tooltipScaleDown.Hide() if TRUE == self.AnimesferButton.IsIn(): self.tooltipAnimesfer.Show() else: self.tooltipAnimesfer.Hide() if TRUE == self.btnCombatZone.IsIn(): self.tooltipCombatZone.Show() else: self.tooltipCombatZone.Hide() if TRUE == self.AtlasShowButton.IsIn(): self.tooltipAtlasOpen.Show() else: self.tooltipAtlasOpen.Hide() def OnRender(self): (x, y) = self.GetGlobalPosition() fx = float(x) fy = float(y) miniMap.Render(fx + 4.0, fy + 5.0) def Close(self): self.HideMiniMap() def HideMiniMap(self): miniMap.Hide() self.OpenWindow.Hide() self.CloseWindow.Show() def ShowMiniMap(self): if not self.canSeeInfo: return miniMap.Show() self.OpenWindow.Show() self.CloseWindow.Hide() def isShowMiniMap(self): return miniMap.isShow() if (app.WJ_COMBAT_ZONE): def OnAskCombatZoneQuestionDialog(self): import uiCommon self.combatZoneLeaveQuestionDialog = uiCommon.QuestionDialog2() self.combatZoneLeaveQuestionDialog.SetText1(uiScriptLocale.EXIT_BATTLE_FIELD_COLLECTED_POINTS % (player.GetCombatZonePoints())) self.combatZoneLeaveQuestionDialog.SetText2(uiScriptLocale.EXIT_BATTLE_FIELD) self.combatZoneLeaveQuestionDialog.SetWidth(320) self.combatZoneLeaveQuestionDialog.SetAcceptEvent(lambda arg = TRUE: self.OnToggleCombatZoneQuestionDialog(arg)) self.combatZoneLeaveQuestionDialog.SetCancelEvent(lambda arg = FALSE: self.OnToggleCombatZoneQuestionDialog(arg)) self.combatZoneLeaveQuestionDialog.Open() def OnToggleCombatZoneQuestionDialog(self, answer): if not self.combatZoneLeaveQuestionDialog: return self.combatZoneLeaveQuestionDialog.Close() self.combatZoneLeaveQuestionDialog = None if not answer: return net.SendCombatZoneRequestActionPacket(net.COMBAT_ZONE_ACTION_LEAVE, net.COMBAT_ZONE_EMPTY_DATA) return TRUE def OpenCombatZoneWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if player.IsCombatZoneMap(): self.OnAskCombatZoneQuestionDialog() else: net.SendCombatZoneRequestActionPacket(net.COMBAT_ZONE_ACTION_OPEN_RANKING, net.COMBAT_ZONE_EMPTY_DATA) def ScaleUp(self): miniMap.ScaleUp() def __IsSpecialMap(self): Blocked_MAPS = [ "season1/metin2_map_oxevent", "season2/metin2_map_guild_inside01", "season2/metin2_map_empirewar01", "season2/metin2_map_empirewar02", "season2/metin2_map_empirewar03", "metin2_map_dragon_timeattack_01", "metin2_map_dragon_timeattack_02", "metin2_map_dragon_timeattack_03", "metin2_map_skipia_dungeon_boss", "metin2_map_skipia_dungeon_boss2", "metin2_map_devilsCatacomb", "metin2_map_deviltower1", "metin2_map_t1", "metin2_map_t2", "metin2_map_t3", "metin2_map_t4", "metin2_map_t5", "metin2_map_wedding_01", "metin2_map_ring", "metin2_map_gemi", "gm_guild_build", "metin2_map_duel" ] if str(background.GetCurrentMapName()) in Blocked_MAPS: return TRUE return FALSE def ScaleDown(self): miniMap.ScaleDown() def ShowAtlas(self): if not miniMap.IsAtlas(): return if not self.AtlasWindow.IsShow(): self.AtlasWindow.Show() else: self.AtlasWindow.Hide() def ToggleAtlasWindow(self): if not miniMap.IsAtlas(): return if self.AtlasWindow.IsShow(): self.AtlasWindow.Hide() else: self.AtlasWindow.Show() if app.ENABLE_DEFENSE_WAVE: def SetMastHP(self, hp): self.MastHp.SetPercentage(hp, 5000000) self.MastHp.SetToolTipText("HP: %d /5000000" % hp) def SetMastWindow(self, i): if i: self.MastWindow.Show() else: self.MastWindow.Hide() def UpdateChannelInfo(self, channel): if constInfo.SERVER_TYPE == 1: srvName = serverInfo.SERVER_1 elif constInfo.SERVER_TYPE == 2: srvName = serverInfo.SERVER_2 else: srvName = serverInfo.SERVER_1 if channel == 99: serverInfoStr = srvName + ' - Ortak Kanal' else: serverInfoStr = srvName + ' - ' + str(channel) + '. Kanal' self.serverInfo.SetText(serverInfoStr) net.SetServerInfo(serverInfoStr)
Official Mailbox
in Features & Metin2 Systems
Posted
I implemented the System, and the only problem is that due to the mailbox item it doesn't open at all, due to the NPC it is working perfectly.
Note: There is no error in any of the syssers, neither in Release or Debug