.Stefan 1 Posted January 17, 2018 Share Posted January 17, 2018 (edited) Hey, i got a double Map shown after a teleport. I don't really know what it could be. Any Tips where to search ? Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
TRBizeps 49 Posted January 17, 2018 Share Posted January 17, 2018 Show us your uiminimap.py Link to comment Share on other sites More sharing options...
.Stefan 1 Posted January 17, 2018 Author Share Posted January 17, 2018 Sure, but i checked it already. PS: I'm willing to give some money for a solution Spoiler import ui import uiScriptLocale import wndMgr import player import miniMap import localeInfo import net import app import colorInfo import constInfo import background import apollo_interface # import time 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(13, 38) 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 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 + 25, iSizeY + 50) if localeInfo.IsARABIC(): self.board.SetPosition(iSizeX+20, 0) self.board.SetSize(iSizeX + 25, iSizeY + 50) #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_miniera" : 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.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 self.OpenWindow = 0 self.CloseWindow = 0 self.ScaleUpButton = 0 self.ScaleDownButton = 0 self.MiniMapHideButton = 0 self.MiniMapShowButton = 0 self.AtlasShowButton = 0 self.tooltipMiniMapOpen = 0 self.tooltipMiniMapClose = 0 self.tooltipScaleUp = 0 self.tooltipScaleDown = 0 self.tooltipAtlasOpen = 0 self.tooltipInfo = None self.serverInfo = None # self.toggleButtonDict = {} def SetMapName(self, mapName): self.mapName=mapName self.AtlasWindow.SetMapName(mapName) 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, "apollo_scripts/Minimap.py") else: pyScrLoader.LoadScriptFile(self, "apollo_scripts/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.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.achievement = self.GetChild("Achievement") self.achievement.SetEvent(lambda : self.OpenAchievementsystemWindow()) # self.serverInfo = self.GetChild("ServerInfo") # self.Time = self.GetChild("Time") # self.online = self.GetChild("online") except: import exception exception.Abort("MiniMap.LoadWindow.Bind") # if constInfo.MINIMAP_POSITIONINFO_ENABLE==0: # self.positionInfo.Hide() self.serverInfo = ui.TextLine() self.serverInfo.SetParent(self.observerCount) self.serverInfo.SetPosition(-170,-180+3) self.serverInfo.SetFontName('Tahoma:15') self.serverInfo.SetText(net.GetServerInfo()) self.serverInfo.SetPackedFontColor(0xffa07970) self.serverInfo.Show() self.Time = ui.TextLine() self.Time.SetParent(self.observerCount) self.Time.SetPosition(-135,-167+4) self.Time.SetFontName('Tahoma:15') self.Time.SetText('0') self.Time.SetPackedFontColor(0xffd8af75) self.Time.Show() self.Time2 = ui.TextLine() self.Time2.SetParent(self.observerCount) self.Time2.SetPosition(-152,-154+4) self.Time2.SetFontName('Tahoma:14') self.Time2.SetText('0') self.Time2.SetPackedFontColor(0xffa33437) self.Time2.Show() 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)) 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.AtlasShowButton.GetGlobalPosition() # self.tooltipAtlasOpen.SetTooltipPosition(ButtonPosX, ButtonPosY) self.ShowMiniMap() def OpenAchievementsystemWindow(self): import uiachievementsystem uiachievementsystem.wnd.OpenRequest() def Destroy(self): self.HideMiniMap() 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) def OnUpdate(self): import time (x, y, z) = player.GetMainCharacterPosition() miniMap.Update(x, y) self.Time.SetText(time.strftime("%H:%M")) self.Time2.SetText(time.strftime("%d-%m-%Y")) # self.positionInfo.SetText("[" + time.strftime("%H:%M:%S") + " " + time.strftime("%Y-%m-%d") + "]") # self.online.SetText("[Liczba on-line: %s" % (str(constInfo.ONLINE)) + "]") 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.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 + 1.0, fy + 8.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() def ScaleUp(self): miniMap.ScaleUp() def ScaleDown(self): miniMap.ScaleDown() def ShowAtlas(self): if not miniMap.IsAtlas(): return if not self.AtlasWindow.IsShow(): self.AtlasWindow.Show() def ToggleAtlasWindow(self): if not miniMap.IsAtlas(): return if self.AtlasWindow.IsShow(): self.AtlasWindow.Hide() else: self.AtlasWindow.Show() Link to comment Share on other sites More sharing options...
Premium Python27 5 Posted January 18, 2018 Premium Share Posted January 18, 2018 send me your skype in private message Link to comment Share on other sites More sharing options...
.Stefan 1 Posted January 18, 2018 Author Share Posted January 18, 2018 I sent you a message @r0bertt69 Link to comment Share on other sites More sharing options...
Detro 7 Posted January 10, 2019 Share Posted January 10, 2019 f5 Link to comment Share on other sites More sharing options...
Detro 7 Posted January 10, 2019 Share Posted January 10, 2019 HELP PLEASE Link to comment Share on other sites More sharing options...
Detro 7 Posted January 12, 2019 Share Posted January 12, 2019 f5 Link to comment Share on other sites More sharing options...
zsoltiabeka10 17 Posted August 24, 2020 Share Posted August 24, 2020 How did u guys solve it? Link to comment Share on other sites More sharing options...
Catalin2o14 142 Posted August 24, 2020 Share Posted August 24, 2020 (edited) check if you have this in interfacemodule: https://metin2.download/picture/g02PepgoISiv8CKNNH7w4usvmbaj6jiA/.png https://metin2.download/picture/rm1OLdyXW5fd8Q7Yc6rvTT7z0OiOlF04/.png Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
zsoltiabeka10 17 Posted August 25, 2020 Share Posted August 25, 2020 (edited) On 8/25/2020 at 2:21 AM, Catalin2o14 said: check if you have this in interfacemodule: https://metin2.download/picture/00At026cyNN5k9VW33zuFZQ3F915Q4Zn/.png https://metin2.download/picture/Q5tvY7ZS454OX7cUFW2AA3z10V2Nw7lF/.png I do have these. uiminimap: Spoiler 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 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 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 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.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() 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() def ToggleAtlasWindow(self): if not miniMap.IsAtlas(): return if self.AtlasWindow.IsShow(): self.AtlasWindow.Hide() else: self.AtlasWindow.Show() 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) interfacemodule: Spoiler import constInfo import systemSetting import wndMgr import chat import app import player import snd import translate import uiTaskBar import uiCharacter import uiInventory import uiDragonSoul import uiChat import uiMessenger import guild import ui import uiHelp import os import uiWhisper import uiPointReset import uiShop import uiExchange import uiSystem import uiRestart import uiToolTip import uiMiniMap import uiParty import uiSafebox import uiGuild import uiQuest import uiPrivateShopBuilder import uiCommon import uiRefine import uiEquipmentDialog import time import uiGameButton import uiTip import uiCube if app.ENABLE_OKAY_CARD: import uiCards import miniMap import uiyoutuber import uiyoutube if app.ENABLE_SHOW_CHEST_DROP: import uiChestDrop if app.WJ_ITEM_COMBINATION_SYSTEM: import uiitemcombination if app.ENABLE_SASH_SYSTEM: import uisash # ACCESSORY_REFINE_ADD_METIN_STONE import uiSelectItem # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE import uiScriptLocale if app.TOURNAMENT_PVP_SYSTEM: import uitournament import event import app import localeInfo if app.ENABLE_EVENT_INFORMATION_SYSTEM: import uiEvent import uiMiniGameAttendance import net if app.ENABLE_KINGDOMS_WAR: import uikingdomswar if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: import uikeyboard if app.WJ_CHANGELOOK_SYSTEM: import uichangelook if app.ENABLE_MELEY_LAIR_DUNGEON: import uidragonlairranking if app.WJ_CHANGELOOK_SYSTEM: import uichangelook if app.WJ_OFFLINESHOP_SYSTEM: import uiOfflineShop import uiOfflineShopBuilder if app.WJ_SHOP_SEARCH_SYSTEM: import uiPrivateShopSearch import uisystemgems import uiWonExchange IsQBHide = 0 statutahta1 = 0 Nesnedepomenu = 0 class Interface(object): CHARACTER_STATUS_TAB = 1 CHARACTER_SKILL_TAB = 2 def __init__(self): systemSetting.SetInterfaceHandler(self) self.windowOpenPosition = 0 if app.WJ_ENABLE_TRADABLE_ICON: self.onTopWindow = player.ON_TOP_WND_NONE self.dlgWhisperWithoutTarget = None self.inputDialog = None self.tipBoard = None self.bigBoard = None self.wndGiftBox = None # ITEM_MALL self.mallPageDlg = None # END_OF_ITEM_MALL self.wndWeb = None self.wndTaskBar = None self.wndCharacter = None self.wndInventory = None if app.WJ_SPLIT_INVENTORY_SYSTEM: self.wndExtendedInventory = None self.wndExpandedTaskBar = None self.wndDragonSoul = None self.wndDragonSoulRefine = None self.wndExpandedMoneyTaskbar = None self.wndChat = None self.wndMessenger = None self.wndMiniMap = None self.wndGuild = None self.wndGuildBuilding = None if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot = None if app.ENABLE_SHOW_CHEST_DROP: self.dlgChestDrop = None self.OpenLinkQuestionDialog = None if app.WJ_OFFLINESHOP_SYSTEM: self.wndOfflineShopManager = None self.wndOfflineShopManager2 = None self.listGMName = {} self.wndQuestWindow = {} self.wndQuestWindowNewKey = 0 self.privateShopAdvertisementBoardDict = {} self.guildScoreBoardDict = {} self.equipmentDialogDict = {} if app.WJ_OFFLINESHOP_SYSTEM: self.offlineShopAdvertisementBoardDict = {} event.SetInterfaceWindow(self) def __del__(self): systemSetting.DestroyInterfaceHandler() event.SetInterfaceWindow(None) def SetStream(self, stream): self.stream = stream def __OnClickGiftButton(self): if self.wndGameButton: if not self.wndGiftBox.IsShow(): self.wndGiftBox.Open() else: self.wndGiftBox.Close() def ClearGift(self): if self.wndGameButton: self.wndGameButton.HideGiftButton() if self.wndGiftBox: self.wndGiftBox.Clear() self.wndGiftBox.Refresh() def OpenGift(self): if self.wndGameButton: self.wndGameButton.ShowGiftButton() ################################ ## Make Windows & Dialogs def __MakeUICurtain(self): wndUICurtain = ui.Bar("TOP_MOST") wndUICurtain.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) wndUICurtain.SetColor(0x77000000) wndUICurtain.Hide() self.wndUICurtain = wndUICurtain def __MakeMessengerWindow(self): self.wndMessenger = uiMessenger.MessengerWindow() from _weakref import proxy self.wndMessenger.SetWhisperButtonEvent(lambda n,i=proxy(self):i.OpenWhisperDialog(n)) self.wndMessenger.SetGuildButtonEvent(ui.__mem_func__(self.ToggleGuildWindow)) def __MakeGuildWindow(self): self.wndGuild = uiGuild.GuildWindow() def __MakeChatWindow(self): wndChat = uiChat.ChatWindow() wndChat.SetSize(wndChat.CHAT_WINDOW_WIDTH, 0) wndChat.SetPosition(wndMgr.GetScreenWidth()/2 - wndChat.CHAT_WINDOW_WIDTH/2, wndMgr.GetScreenHeight() - wndChat.EDIT_LINE_HEIGHT - 37) wndChat.SetHeight(200) wndChat.Refresh() wndChat.Show() self.wndChat = wndChat self.wndChat.BindInterface(self) self.wndChat.SetSendWhisperEvent(ui.__mem_func__(self.OpenWhisperDialogWithoutTarget)) self.wndChat.SetOpenChatLogEvent(ui.__mem_func__(self.ToggleChatLogWindow)) def __MakeTaskBar(self): wndTaskBar = uiTaskBar.TaskBar() wndTaskBar.LoadWindow() self.wndTaskBar = wndTaskBar self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHARACTER, ui.__mem_func__(self.ToggleCharacterWindowStatusPage)) self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_INVENTORY, ui.__mem_func__(self.ToggleInventoryWindow)) self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_MESSENGER, ui.__mem_func__(self.ToggleMessenger)) self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_SYSTEM, ui.__mem_func__(self.ToggleSystemDialog)) self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_OFFLINE_SHOP, ui.__mem_func__(self.ToggleOffShopMain)) if uiTaskBar.TaskBar.IS_EXPANDED: self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_EXPAND, ui.__mem_func__(self.ToggleExpandedButton)) self.wndExpandedTaskBar = uiTaskBar.ExpandedTaskBar() self.wndExpandedTaskBar.LoadWindow() self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_PET_GUI, ui.__mem_func__(self.TogglePetMain)) #self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_OFF_SHOP, ui.__mem_func__(self.ToggleOffShopMain)) #self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_EFSUN_BOT1, ui.__mem_func__(self.ToggleBot1Main)) #self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_OTOMATIK_AV, ui.__mem_func__(self.OtomatikAv)) self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, ui.__mem_func__(self.ToggleDragonSoulWindow)) else: self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHAT, ui.__mem_func__(self.ToggleChat)) self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_EXPAND_MONEY, ui.__mem_func__(self.ToggleExpandedMoneyButton)) self.wndExpandedMoneyTaskbar = uiTaskBar.ExpandedMoneyTaskBar() self.wndExpandedMoneyTaskbar.LoadWindow() self.wndExpandedMoneyTaskbar.BindInterfaceClass(self) self.wndEnergyBar = None import app if app.ENABLE_ENERGY_SYSTEM: wndEnergyBar = uiTaskBar.EnergyBar() wndEnergyBar.LoadWindow() self.wndEnergyBar = wndEnergyBar def __MakeParty(self): wndParty = uiParty.PartyWindow() wndParty.Hide() self.wndParty = wndParty if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: def __MakeQuickSlot(self): wndQuickSlot = uikeyboard.NewQuickSlot() wndQuickSlot.LoadWindow() self.wndQuickSlot = wndQuickSlot def __MakeGameButtonWindow(self): wndGameButton = uiGameButton.GameButtonWindow() wndGameButton.SetTop() wndGameButton.Show() wndGameButton.SetButtonEvent("STATUS", ui.__mem_func__(self.__OnClickStatusPlusButton)) wndGameButton.SetButtonEvent("SKILL", ui.__mem_func__(self.__OnClickSkillPlusButton)) wndGameButton.SetButtonEvent("QUEST", ui.__mem_func__(self.__OnClickQuestButton)) wndGameButton.SetButtonEvent("HELP", ui.__mem_func__(self.__OnClickHelpButton)) wndGameButton.SetButtonEvent("BUILD", ui.__mem_func__(self.__OnClickBuildButton)) wndGameButton.SetButtonEvent("GIFT", ui.__mem_func__(self.__OnClickGiftButton)) self.wndGameButton = wndGameButton def __IsChatOpen(self): return TRUE def panel_info(self): import uistatisticspanel import net import introLogin self.wndCounter = introLogin.ConnectingDialog() self.wndCounter.Open(0.0) self.wndCounter.SetText("Birkaç dakika bekleyin ...") self.wndCounter.SAFE_SetTimeOverEvent(self.__OnClickExpandButton) self.wndCounter.SAFE_SetExitEvent(self.Close) def __OnClickExpandButton(self): import net net.SendChatPacket("/open_userpanel") def __MakeWindows(self): wndCharacter = uiCharacter.CharacterWindow() wndInventory = uiInventory.InventoryWindow() wndInventory.BindInterfaceClass(self) if app.WJ_SPLIT_INVENTORY_SYSTEM: wndExtendedInventory = uiInventory.ExtendedInventoryWindow() wndExtendedInventory.BindInterfaceClass(self) if app.ENABLE_DRAGON_SOUL_SYSTEM: wndDragonSoul = uiDragonSoul.DragonSoulWindow() wndDragonSoulRefine = uiDragonSoul.DragonSoulRefineWindow() else: wndDragonSoul = None wndDragonSoulRefine = None wndMiniMap = uiMiniMap.MiniMap() wndSafebox = uiSafebox.SafeboxWindow() if app.WJ_ENABLE_TRADABLE_ICON: wndSafebox.BindInterface(self) wndMall = uiSafebox.MallWindow() self.wndMall = wndMall wndChatLog = uiChat.ChatLogWindow() wndChatLog.BindInterface(self) if app.WJ_OFFLINESHOP_SYSTEM: wndOfflineShopManager = uiOfflineShop.OfflineShopManagerWindow() self.wndOfflineShopManager = wndOfflineShopManager wndOfflineShopManager2 = uiOfflineShop.OfflineShopManagerWindow2() self.wndOfflineShopManager2 = wndOfflineShopManager2 self.wndCharacter = wndCharacter self.wndInventory = wndInventory if app.WJ_SPLIT_INVENTORY_SYSTEM: self.wndExtendedInventory = wndExtendedInventory self.wndDragonSoul = wndDragonSoul self.wndDragonSoulRefine = wndDragonSoulRefine self.wndMiniMap = wndMiniMap self.wndSafebox = wndSafebox self.wndChatLog = wndChatLog if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.SetDragonSoulRefineWindow(self.wndDragonSoulRefine) self.wndDragonSoulRefine.SetInventoryWindows(self.wndInventory, self.wndDragonSoul) self.wndInventory.SetDragonSoulRefineWindow(self.wndDragonSoulRefine) if app.ENABLE_SHOW_CHEST_DROP: self.dlgChestDrop = uiChestDrop.ChestDropWindow() if app.ENABLE_KINGDOMS_WAR: self.wndKingdomsWar = uikingdomswar.Window() self.wndWonExchange = uiWonExchange.WonExchangeWindow() self.wndWonExchange.BindInterface(self) def __MakeDialogs(self): self.wndyoutuber = uiyoutuber.YoutubeWindow() self.wndyoutuber.Hide() self.wndyoutuber.BindInterfaceClass(self) self.wndyoutube = uiyoutube.WebWindow() self.wndyoutube.LoadWindow() self.wndyoutube.Hide() self.dlgExchange = uiExchange.ExchangeDialog() if app.WJ_ENABLE_TRADABLE_ICON: self.dlgExchange.BindInterface(self) self.dlgExchange.SetInven(self.wndInventory) self.wndInventory.BindWindow(self.dlgExchange) self.dlgExchange.LoadDialog() self.dlgExchange.SetCenterPosition() self.dlgExchange.Hide() self.dlgPointReset = uiPointReset.PointResetDialog() self.dlgPointReset.LoadDialog() self.dlgPointReset.Hide() self.dlgShop = uiShop.ShopDialog() if app.WJ_ENABLE_TRADABLE_ICON: self.dlgShop.BindInterface(self) self.dlgShop.LoadDialog() self.dlgShop.Hide() if app.WJ_OFFLINESHOP_SYSTEM: self.dlgOfflineShop = uiOfflineShop.OfflineShopDialog() self.dlgOfflineShop.LoadDialog() self.dlgOfflineShop.Hide() self.dlgRestart = uiRestart.RestartDialog() self.dlgRestart.LoadDialog() self.dlgRestart.Hide() self.dlgSystem = uiSystem.SystemDialog(self.stream) self.dlgSystem.LoadDialog() self.dlgSystem.SetOpenHelpWindowEvent(ui.__mem_func__(self.OpenHelpWindow)) self.dlgSystem.Hide() self.dlgPassword = uiSafebox.PasswordDialog() self.dlgPassword.Hide() self.hyperlinkItemTooltip = uiToolTip.HyperlinkItemToolTip() self.hyperlinkItemTooltip.Hide() self.tooltipItem = uiToolTip.ItemToolTip() self.tooltipItem.Hide() self.tooltipSkill = uiToolTip.SkillToolTip() self.tooltipSkill.Hide() self.privateShopBuilder = uiPrivateShopBuilder.PrivateShopBuilder() self.privateShopBuilder.Hide() if app.WJ_OFFLINESHOP_SYSTEM: self.offlineShopBuilder = uiOfflineShopBuilder.OfflineShopBuilder() self.offlineShopBuilder.Hide() self.dlgRefineNew = uiRefine.RefineDialogNew() if app.WJ_ENABLE_TRADABLE_ICON: self.dlgRefineNew.SetInven(self.wndInventory) self.wndInventory.BindWindow(self.dlgRefineNew) self.dlgRefineNew.Hide() def __MakeHelpWindow(self): self.wndHelp = uiHelp.HelpWindow() self.wndHelp.LoadDialog() self.wndHelp.SetCloseEvent(ui.__mem_func__(self.CloseHelpWindow)) self.wndHelp.Hide() def __MakeTipBoard(self): self.tipBoard = uiTip.TipBoard() self.tipBoard.Hide() self.bigBoard = uiTip.BigBoard() self.bigBoard.Hide() def __MakeWebWindow(self): if constInfo.IN_GAME_SHOP_ENABLE: import uiWeb self.wndWeb = uiWeb.WebWindow() self.wndWeb.LoadWindow() self.wndWeb.Hide() if app.ENABLE_MELEY_LAIR_DUNGEON: def __MakeMeleyRanking(self): self.wndMeleyRanking = uidragonlairranking.Window() self.wndMeleyRanking.LoadWindow() self.wndMeleyRanking.Hide() if app.WJ_CHANGELOOK_SYSTEM: def __MakeChangeLookWindow(self): self.wndChangeLook = uichangelook.Window() self.wndChangeLook.LoadWindow() self.wndChangeLook.Hide() if self.wndInventory: self.wndInventory.SetChangeLookWindow(self.wndChangeLook) if app.WJ_ITEM_COMBINATION_SYSTEM: def __MakeCombinationWindow(self): self.wndItemCombination = uiitemcombination.ItemCombinationWindow() self.wndItemCombination.LoadWindow() self.wndItemCombination.Hide() self.wndSkillBookCombination = uiitemcombination.SkillBookCombinationWindow() self.wndSkillBookCombination.LoadWindow() self.wndSkillBookCombination.Hide() if self.wndInventory: self.wndInventory.SetCombinationWindow(self.wndItemCombination, self.wndSkillBookCombination) if app.ENABLE_NEW_ENCHANT_ATTR: def __MakeEnchantAttrWindow(self): self.wndEnchantAttr = uiAttrDialog.AttrDialogWindow() self.wndEnchantAttr.LoadWindow() self.wndEnchantAttr.Hide() if app.WJ_SHOP_SEARCH_SYSTEM: def __MakePrivateShopSearchWindow(self): self.wndPrivateShopSearch = uiPrivateShopSearch.PrivateShopSearchDialog() self.wndPrivateShopSearch.LoadWindow() self.wndPrivateShopSearch.Hide() if app.ENABLE_EVENT_INFORMATION_SYSTEM: def __MakeEventWindow(self): self.wndEvent = uiEvent.EventWindow(self) self.wndEvent.LoadWindow() self.wndEvent.Hide() def __MakeMiniGameAttendance(self): self.wndMiniGameAttendance = uiMiniGameAttendance.MiniGameAttendance() self.wndMiniGameAttendance.Hide() if app.ENABLE_SASH_SYSTEM: def __MakeSashWindow(self): self.wndSashCombine = uisash.CombineWindow() self.wndSashCombine.LoadWindow() self.wndSashCombine.Hide() self.wndSashAbsorption = uisash.AbsorbWindow() self.wndSashAbsorption.LoadWindow() self.wndSashAbsorption.Hide() if self.wndInventory: self.wndInventory.SetSashWindow(self.wndSashCombine, self.wndSashAbsorption) def __MakeCubeWindow(self): self.wndCube = uiCube.CubeWindow() self.wndCube.LoadWindow() self.wndCube.Hide() def __MakeCubeResultWindow(self): self.wndCubeResult = uiCube.CubeResultWindow() self.wndCubeResult.LoadWindow() self.wndCubeResult.Hide() if app.TOURNAMENT_PVP_SYSTEM: def __MakeTournamentWindow(self): self.wndTournament = uitournament.Window() self.wndTournament.Initialize() self.wndTournament.Hide() def AddTournamentResultWindow(self, leftTime, membersOnline_A, membersOnline_B, membersDead_A, membersDead_B, memberLives): self.wndTournament.Append([int(leftTime), str(membersOnline_A), str(membersOnline_B), str(membersDead_A), str(membersDead_B), str(memberLives)]) if app.WJ_SECURITY_SYSTEM: def __MakeSecurityWindow(self): self.wndSecurityWindow = uiSafebox.SecurityDialog() self.wndSecurityWindow.Hide() if app.ENABLE_OKAY_CARD: def __MakeCardsInfoWindow(self): self.wndCardsInfo = uiCards.CardsInfoWindow() self.wndCardsInfo.LoadWindow() self.wndCardsInfo.Hide() def __MakeCardsWindow(self): self.wndCards = uiCards.CardsWindow() self.wndCards.LoadWindow() self.wndCards.Hide() # ACCESSORY_REFINE_ADD_METIN_STONE def __MakeItemSelectWindow(self): self.wndItemSelect = uiSelectItem.SelectItemWindow() self.wndItemSelect.Hide() # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE ################################# GAYA SYSTEM ########################## def __MakeGayaGui(self): self.wndGayaG = uisystemgems.SelectGems() self.wndGayaG.LoadWindow() self.wndGayaG.Hide() self.wndGayaM = uisystemgems.SelectGemsShop() self.wndGayaM.LoadWindow() self.wndGayaM.Hide() ######################## END GAYA SYSTEM ##################### def MakeInterface(self): self.__MakeMessengerWindow() self.__MakeGuildWindow() self.__MakeChatWindow() self.__MakeParty() self.__MakeWindows() self.__MakeDialogs() # GAYA SYSTEM self.__MakeGayaGui() ################## END GAYA SYSTEM ################# self.__MakeUICurtain() self.__MakeTaskBar() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.__MakeQuickSlot() self.__MakeGameButtonWindow() self.__MakeHelpWindow() self.__MakeTipBoard() self.__MakeWebWindow() if app.ENABLE_MELEY_LAIR_DUNGEON: self.__MakeMeleyRanking() self.__MakeCubeWindow() self.__MakeCubeResultWindow() if app.TOURNAMENT_PVP_SYSTEM: self.__MakeTournamentWindow() if app.WJ_SECURITY_SYSTEM: self.__MakeSecurityWindow() if app.ENABLE_OKAY_CARD: self.__MakeCardsInfoWindow() self.__MakeCardsWindow() #self.__MakeCardsIconWindow() if app.WJ_CHANGELOOK_SYSTEM: self.__MakeChangeLookWindow() if app.ENABLE_EVENT_INFORMATION_SYSTEM: self.__MakeEventWindow() self.__MakeMiniGameAttendance() if app.ENABLE_SASH_SYSTEM: self.__MakeSashWindow() if app.WJ_ITEM_COMBINATION_SYSTEM: self.__MakeCombinationWindow() if app.WJ_SHOP_SEARCH_SYSTEM: self.__MakePrivateShopSearchWindow() # ACCESSORY_REFINE_ADD_METIN_STONE self.__MakeItemSelectWindow() # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE self.questButtonList = [] self.whisperButtonList = [] self.whisperDialogDict = {} self.privateShopAdvertisementBoardDict = {} self.wndInventory.SetItemToolTip(self.tooltipItem) if app.WJ_SPLIT_INVENTORY_SYSTEM: self.wndExtendedInventory.SetItemToolTip(self.tooltipItem) if app.ENABLE_SASH_SYSTEM: self.wndSashCombine.SetItemToolTip(self.tooltipItem) self.wndSashAbsorption.SetItemToolTip(self.tooltipItem) if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.SetItemToolTip(self.tooltipItem) self.wndDragonSoulRefine.SetItemToolTip(self.tooltipItem) self.wndSafebox.SetItemToolTip(self.tooltipItem) if app.WJ_CHANGELOOK_SYSTEM: self.wndChangeLook.SetItemToolTip(self.tooltipItem) if app.WJ_ITEM_COMBINATION_SYSTEM: self.wndItemCombination.SetItemToolTip(self.tooltipItem) self.wndSkillBookCombination.SetItemToolTip(self.tooltipItem) self.wndCube.SetItemToolTip(self.tooltipItem) self.wndCubeResult.SetItemToolTip(self.tooltipItem) if app.WJ_SHOP_SEARCH_SYSTEM: self.wndPrivateShopSearch.SetItemToolTip(self.tooltipItem) # ITEM_MALL self.wndMall.SetItemToolTip(self.tooltipItem) # END_OF_ITEM_MALL self.wndCharacter.SetSkillToolTip(self.tooltipSkill) self.wndTaskBar.SetItemToolTip(self.tooltipItem) self.wndTaskBar.SetSkillToolTip(self.tooltipSkill) if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.SetItemToolTip(self.tooltipItem) self.wndQuickSlot.SetSkillToolTip(self.tooltipSkill) self.wndGuild.SetSkillToolTip(self.tooltipSkill) # ACCESSORY_REFINE_ADD_METIN_STONE self.wndItemSelect.SetItemToolTip(self.tooltipItem) # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE if app.ENABLE_SHOW_CHEST_DROP: self.dlgChestDrop.SetItemToolTip(self.tooltipItem) self.dlgShop.SetItemToolTip(self.tooltipItem) self.dlgExchange.SetItemToolTip(self.tooltipItem) self.privateShopBuilder.SetItemToolTip(self.tooltipItem) if app.WJ_OFFLINESHOP_SYSTEM: self.dlgOfflineShop.SetItemToolTip(self.tooltipItem) self.offlineShopBuilder.SetItemToolTip(self.tooltipItem) self.__InitWhisper() self.DRAGON_SOUL_IS_QUALIFIED = TRUE #@if app.ENABLE_HTTP_SYSTEM: def AnswerOpenLink(self, answer): if not self.OpenLinkQuestionDialog: return self.OpenLinkQuestionDialog.Close() self.OpenLinkQuestionDialog = None if not answer: return link = constInfo.link os.system(link) def MakeHyperlinkTooltip(self, hyperlink): tokens = hyperlink.split(":") if tokens and len(tokens): type = tokens[0] if "item" == type: self.hyperlinkItemTooltip.SetHyperlinkItem(tokens) elif "BESTProduction" == type: self.OpenWhisperDialog(str(tokens[1])) #if app.ENABLE_HTTP_SYSTEM: if "web" == type and tokens[1].startswith("httpXxX") or "web" == type and tokens[1].startswith("httpsXxX"): OpenLinkQuestionDialog = uiCommon.QuestionDialog2() OpenLinkQuestionDialog.SetText1(localeInfo.CHAT_OPEN_LINK_DANGER) OpenLinkQuestionDialog.SetText2(localeInfo.CHAT_OPEN_LINK) OpenLinkQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerOpenLink(arg)) OpenLinkQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerOpenLink(arg)) constInfo.link = "start " + tokens[1].replace("XxX", "://").replace("&","^&") OpenLinkQuestionDialog.Open() self.OpenLinkQuestionDialog = OpenLinkQuestionDialog elif "sysweb" == type: os.system("start " + tokens[1].replace("XxX", "://")) elif "youtube" == type: url = "https://www.youtube.com/youtube/videos.php?youtube=%s" % str(tokens[1]) self.YoutubeShow(url) elif "BESTProduction" == type: self.OpenWhisperDialog(str(tokens[1])) ## Make Windows & Dialogs ################################ def YoutubeLink(self): self.wndyoutuber.Show() def YoutubeShow(self, url): self.wndyoutube.Open(url) def Close(self): if self.dlgWhisperWithoutTarget: self.dlgWhisperWithoutTarget.Destroy() del self.dlgWhisperWithoutTarget if uiQuest.QuestDialog.__dict__.has_key("QuestCurtain"): uiQuest.QuestDialog.QuestCurtain.Close() if self.wndQuestWindow: for key, eachQuestWindow in self.wndQuestWindow.items(): eachQuestWindow.nextCurtainMode = -1 eachQuestWindow.CloseSelf() eachQuestWindow = None self.wndQuestWindow = {} if self.wndMiniMap: self.wndMiniMap.Destroy() del self.wndMiniMap if self.wndChat: self.wndChat.Destroy() if self.wndTaskBar: self.wndTaskBar.Destroy() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: if self.wndQuickSlot: self.wndQuickSlot.Destroy() if self.wndExpandedTaskBar: self.wndExpandedTaskBar.Destroy() if self.wndExpandedMoneyTaskbar: self.wndExpandedMoneyTaskbar.Destroy() if self.wndEnergyBar: self.wndEnergyBar.Destroy() if self.wndCharacter: self.wndCharacter.Destroy() if self.wndInventory: self.wndInventory.Destroy() if app.WJ_SPLIT_INVENTORY_SYSTEM: if self.wndExtendedInventory: self.wndExtendedInventory.Destroy() if self.wndDragonSoul: self.wndDragonSoul.Hide() self.wndDragonSoul.Destroy() if self.wndDragonSoulRefine: self.wndDragonSoulRefine.Destroy() if self.dlgExchange: self.dlgExchange.Destroy() if self.wndyoutuber: self.wndyoutuber.Destroy() if self.wndyoutube: self.wndyoutube.Destroy() if self.dlgPointReset: self.dlgPointReset.Destroy() if self.wndGiftBox: self.wndGiftBox.Clear() self.wndGiftBox.Hide() self.wndGiftBox.Destroy() del self.wndGiftBox if self.dlgShop: self.dlgShop.Destroy() if self.dlgRestart: self.dlgRestart.Destroy() if self.dlgSystem: self.dlgSystem.Destroy() if self.dlgPassword: self.dlgPassword.Destroy() if self.wndSafebox: self.wndSafebox.Destroy() if self.wndWeb: self.wndWeb.Destroy() self.wndWeb = None if self.wndMall: self.wndMall.Destroy() if self.wndParty: self.wndParty.Destroy() if self.wndHelp: self.wndHelp.Destroy() if app.ENABLE_MELEY_LAIR_DUNGEON: if self.wndMeleyRanking: self.wndMeleyRanking.Destroy() if app.ENABLE_SASH_SYSTEM: if self.wndSashCombine: self.wndSashCombine.Destroy() if self.wndSashAbsorption: self.wndSashAbsorption.Destroy() if app.WJ_CHANGELOOK_SYSTEM: if self.wndChangeLook: self.wndChangeLook.Destroy() if app.WJ_ITEM_COMBINATION_SYSTEM: if self.wndItemCombination: self.wndItemCombination.Destroy() if self.wndSkillBookCombination: self.wndSkillBookCombination.Destroy() if app.ENABLE_OKAY_CARD: if self.wndCardsInfo: self.wndCardsInfo.Destroy() if self.wndCards: self.wndCards.Destroy() if app.WJ_SHOP_SEARCH_SYSTEM: if self.wndPrivateShopSearch: self.wndPrivateShopSearch.Destroy() if app.ENABLE_EVENT_INFORMATION_SYSTEM: if self.wndEvent: self.wndEvent.Destroy() if self.wndMiniGameAttendance: self.wndMiniGameAttendance.Destroy() if self.wndCube: self.wndCube.Destroy() if self.wndCubeResult: self.wndCubeResult.Destroy() if app.WJ_SECURITY_SYSTEM: if self.wndSecurityWindow: self.wndSecurityWindow.Destroy() if self.wndMessenger: self.wndMessenger.Destroy() ################### GAYA SYSTEM ########### if self.wndGayaG: self.wndGayaG.Destroy() if self.wndGayaM: self.wndGayaM.Destroy() ####################### END GAYA SYSTEM ################# if self.wndGuild: self.wndGuild.Destroy() if self.privateShopBuilder: self.privateShopBuilder.Destroy() if self.dlgRefineNew: self.dlgRefineNew.Destroy() if self.wndGuildBuilding: self.wndGuildBuilding.Destroy() if self.wndGameButton: self.wndGameButton.Destroy() # ITEM_MALL if self.mallPageDlg: self.mallPageDlg.Destroy() # END_OF_ITEM_MALL if app.ENABLE_SHOW_CHEST_DROP: if self.dlgChestDrop: self.dlgChestDrop.Destroy() # ACCESSORY_REFINE_ADD_METIN_STONE if self.wndItemSelect: self.wndItemSelect.Destroy() # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE if app.WJ_OFFLINESHOP_SYSTEM: if (self.dlgOfflineShop): self.dlgOfflineShop.Destroy() if (self.offlineShopBuilder): self.offlineShopBuilder.Destroy() if (self.wndOfflineShopManager): self.wndOfflineShopManager.Destroy() if (self.wndOfflineShopManager2): self.wndOfflineShopManager2.Destroy() if self.wndWonExchange: self.wndWonExchange.Destroy() self.wndChatLog.Destroy() for btn in self.questButtonList: btn.SetEvent(0) for btn in self.whisperButtonList: btn.SetEvent(0) for dlg in self.whisperDialogDict.itervalues(): dlg.Destroy() for brd in self.guildScoreBoardDict.itervalues(): brd.Destroy() for dlg in self.equipmentDialogDict.itervalues(): dlg.Destroy() # ITEM_MALL del self.mallPageDlg # END_OF_ITEM_MALL del self.wndGuild del self.wndMessenger del self.wndUICurtain del self.wndChat del self.wndTaskBar if app.TOURNAMENT_PVP_SYSTEM: del self.wndTournament if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: del self.wndQuickSlot if self.wndExpandedTaskBar: del self.wndExpandedTaskBar del self.wndEnergyBar del self.wndCharacter del self.wndInventory if app.WJ_SPLIT_INVENTORY_SYSTEM: if self.wndExtendedInventory: del self.wndExtendedInventory if self.wndDragonSoul: del self.wndDragonSoul if self.wndDragonSoulRefine: del self.wndDragonSoulRefine del self.wndyoutuber del self.wndyoutube del self.dlgExchange del self.dlgPointReset del self.dlgShop del self.dlgRestart del self.dlgSystem del self.dlgPassword del self.hyperlinkItemTooltip del self.tooltipItem del self.tooltipSkill del self.wndSafebox del self.wndMall del self.wndParty del self.wndHelp if app.ENABLE_MELEY_LAIR_DUNGEON: del self.wndMeleyRanking if app.ENABLE_SASH_SYSTEM: del self.wndSashCombine del self.wndSashAbsorption if app.WJ_CHANGELOOK_SYSTEM: del self.wndChangeLook if app.WJ_ITEM_COMBINATION_SYSTEM: del self.wndItemCombination del self.wndSkillBookCombination if app.WJ_SHOP_SEARCH_SYSTEM: del self.wndPrivateShopSearch if app.ENABLE_EVENT_INFORMATION_SYSTEM: del self.wndEvent del self.wndMiniGameAttendance del self.wndCube del self.wndCubeResult if app.WJ_SECURITY_SYSTEM: del self.wndSecurityWindow ################## GAYA SYSTEM ##################### del self.wndGayaG del self.wndGayaM ##################### END GAYA SYSTEM ##################### if app.ENABLE_OKAY_CARD: del self.wndCardsInfo del self.wndCards del self.privateShopBuilder del self.inputDialog del self.wndChatLog del self.dlgRefineNew del self.wndGuildBuilding del self.wndGameButton del self.tipBoard del self.bigBoard del self.wndItemSelect if app.WJ_OFFLINESHOP_SYSTEM: del self.dlgOfflineShop del self.wndOfflineShopManager del self.wndOfflineShopManager2 del self.wndWonExchange if app.ENABLE_SHOW_CHEST_DROP: if self.dlgChestDrop: del self.dlgChestDrop self.questButtonList = [] self.whisperButtonList = [] self.whisperDialogDict = {} self.privateShopAdvertisementBoardDict = {} self.guildScoreBoardDict = {} self.equipmentDialogDict = {} if app.WJ_OFFLINESHOP_SYSTEM: self.offlineShopAdvertisementBoardDict = {} uiChat.DestroyChatInputSetWindow() if app.ENABLE_KINGDOMS_WAR: if self.wndKingdomsWar: self.wndKingdomsWar.Destroy() del self.wndKingdomsWar ## Self def SetOpenBoniSwitcherEvent(self, event): self.wndInventory.SetOpenBoniSwitcherEvent(event) ## Skill def OnUseSkill(self, slotIndex, coolTime): self.wndCharacter.OnUseSkill(slotIndex, coolTime) self.wndTaskBar.OnUseSkill(slotIndex, coolTime) if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.OnUseSkill(slotIndex, coolTime) self.wndGuild.OnUseSkill(slotIndex, coolTime) def OnActivateSkill(self, slotIndex): self.wndCharacter.OnActivateSkill(slotIndex) self.wndTaskBar.OnActivateSkill(slotIndex) if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.OnActivateSkill(slotIndex) def OnDeactivateSkill(self, slotIndex): self.wndCharacter.OnDeactivateSkill(slotIndex) self.wndTaskBar.OnDeactivateSkill(slotIndex) if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.OnDeactivateSkill(slotIndex) def OnChangeCurrentSkill(self, skillSlotNumber): self.wndTaskBar.OnChangeCurrentSkill(skillSlotNumber) if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.OnChangeCurrentSkill(skillSlotNumber) def SelectMouseButtonEvent(self, dir, event): self.wndTaskBar.SelectMouseButtonEvent(dir, event) ## Refresh def RefreshAlignment(self): self.wndCharacter.RefreshAlignment() def RefreshStatus(self): self.wndTaskBar.RefreshStatus() self.wndCharacter.RefreshStatus() self.wndInventory.RefreshStatus() if app.WJ_SPLIT_INVENTORY_SYSTEM: self.wndExtendedInventory.RefreshStatus() if self.wndEnergyBar: self.wndEnergyBar.RefreshStatus() if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.RefreshStatus() if self.wndExpandedMoneyTaskbar: self.wndExpandedMoneyTaskbar.RefreshStatus() def RefreshStamina(self): self.wndTaskBar.RefreshStamina() def costume_hide_clear(self): self.wndInventory.costume_hide_clear() def costume_hide_list(self,slot,index): self.wndInventory.costume_hide_list(slot,index) def costume_hide_load(self): self.wndInventory.costume_hide_load() def RefreshSkill(self): self.wndCharacter.RefreshSkill() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.RefreshSkill() self.wndTaskBar.RefreshSkill() def RefreshInventory(self): self.wndTaskBar.RefreshQuickSlot() self.wndInventory.RefreshItemSlot() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.RefreshQuickSlot() if app.WJ_SPLIT_INVENTORY_SYSTEM: self.wndExtendedInventory.RefreshItemSlot() if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.RefreshItemSlot() def RefreshCharacter(self): self.wndCharacter.RefreshCharacter() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.RefreshQuickSlot() self.wndTaskBar.RefreshQuickSlot() def RefreshQuest(self): self.wndCharacter.RefreshQuest() def RefreshSafebox(self): self.wndSafebox.RefreshSafebox() # ITEM_MALL def RefreshMall(self): self.wndMall.RefreshMall() def OpenItemMall(self): if not self.mallPageDlg: self.mallPageDlg = uiShop.MallPageDialog() self.mallPageDlg.Open() # END_OF_ITEM_MALL def RefreshMessenger(self): self.wndMessenger.RefreshMessenger() def RefreshGuildInfoPage(self): self.wndGuild.RefreshGuildInfoPage() def RefreshGuildBoardPage(self): self.wndGuild.RefreshGuildBoardPage() def RefreshGuildMemberPage(self): self.wndGuild.RefreshGuildMemberPage() def RefreshGuildMemberPageGradeComboBox(self): self.wndGuild.RefreshGuildMemberPageGradeComboBox() def RefreshGuildSkillPage(self): self.wndGuild.RefreshGuildSkillPage() def RefreshGuildGradePage(self): self.wndGuild.RefreshGuildGradePage() def DeleteGuild(self): self.wndMessenger.ClearGuildMember() self.wndGuild.DeleteGuild() def RefreshMobile(self): self.dlgSystem.RefreshMobile() def OnMobileAuthority(self): self.dlgSystem.OnMobileAuthority() def OnBlockMode(self, mode): self.dlgSystem.OnBlockMode(mode) ## Calling Functions # PointReset def OpenPointResetDialog(self): self.dlgPointReset.Show() self.dlgPointReset.SetTop() def ClosePointResetDialog(self): self.dlgPointReset.Close() # Shop if (app.WJ_COMBAT_ZONE): def OpenShopDialog(self, vid, points, curLimit, maxLimit): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.wndInventory.Show() self.wndInventory.SetTop() self.dlgShop.Open(vid, points, curLimit, maxLimit) self.dlgShop.SetTop() else: def OpenShopDialog(self, vid): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.wndInventory.Show() self.wndInventory.SetTop() self.dlgShop.Open(vid) self.dlgShop.SetTop() def CloseShopDialog(self): self.dlgShop.Close() def RefreshShopDialog(self): self.dlgShop.Refresh() if app.ENABLE_SHOW_CHEST_DROP: def AddChestDropInfo(self, chestVnum, pageIndex, slotIndex, itemVnum, itemCount): self.dlgChestDrop.AddChestDropItem(int(chestVnum), int(pageIndex), int(slotIndex), int(itemVnum), int(itemCount)) def RefreshChestDropInfo(self, chestVnum): self.dlgChestDrop.RefreshItems(chestVnum) if app.WJ_OFFLINESHOP_SYSTEM: def OpenOfflineShopDialog(self, vid): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.wndInventory.Show() self.wndInventory.SetTop() self.dlgOfflineShop.Open(vid) self.dlgOfflineShop.SetTop() def CloseOfflineShopDialog(self): self.dlgOfflineShop.Close() def RefreshOfflineShopDialog(self): self.dlgOfflineShop.Refresh() ## Quest def OpenCharacterWindowQuestPage(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.wndCharacter.Show() self.wndCharacter.SetState("QUEST") def OpenQuestWindow(self, skin, idx): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return wnds = () q = uiQuest.QuestDialog(skin, idx) q.SetWindowName("QuestWindow" + str(idx)) q.Show() if skin: q.Lock() wnds = self.__HideWindows() # UNKNOWN_UPDATE q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args)) # END_OF_UNKNOWN_UPDATE if skin: q.AddOnCloseEvent(q.Unlock) q.AddOnCloseEvent(lambda key = self.wndQuestWindowNewKey:ui.__mem_func__(self.RemoveQuestDialog)(key)) self.wndQuestWindow[self.wndQuestWindowNewKey] = q self.wndQuestWindowNewKey = self.wndQuestWindowNewKey + 1 # END_OF_UNKNOWN_UPDATE def RemoveQuestDialog(self, key): del self.wndQuestWindow[key] ## reload q crash fix def HideAllQuestWindow(self): tempList = [] for i,v in self.wndQuestWindow.iteritems(): tempList.append(v) for i in tempList: i.OnCancel() ## Exchange def StartExchange(self): self.dlgExchange.OpenDialog() self.dlgExchange.Refresh() def EndExchange(self): self.dlgExchange.CloseDialog() def RefreshExchange(self): self.dlgExchange.Refresh() if app.WJ_ENABLE_TRADABLE_ICON: def CantTradableItemExchange(self, dstSlotIndex, srcSlotIndex): self.dlgExchange.CantTradableItem(dstSlotIndex, srcSlotIndex) ## Party def AddPartyMember(self, pid, name): self.wndParty.AddPartyMember(pid, name) self.__ArrangeQuestButton() def UpdatePartyMemberInfo(self, pid): self.wndParty.UpdatePartyMemberInfo(pid) def RemovePartyMember(self, pid): self.wndParty.RemovePartyMember(pid) ##!! 20061026.levites.Äů˝şĆ®_Ŕ§Äˇ_ş¸Á¤ self.__ArrangeQuestButton() def LinkPartyMember(self, pid, vid): self.wndParty.LinkPartyMember(pid, vid) def UnlinkPartyMember(self, pid): self.wndParty.UnlinkPartyMember(pid) def UnlinkAllPartyMember(self): self.wndParty.UnlinkAllPartyMember() def ExitParty(self): self.wndParty.ExitParty() ##!! 20061026.levites.Äů˝şĆ®_Ŕ§Äˇ_ş¸Á¤ self.__ArrangeQuestButton() def PartyHealReady(self): self.wndParty.PartyHealReady() def ChangePartyParameter(self, distributionMode): self.wndParty.ChangePartyParameter(distributionMode) ## Safebox def AskSafeboxPassword(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if self.wndSafebox.IsShow(): return # SAFEBOX_PASSWORD self.dlgPassword.SetTitle(localeInfo.PASSWORD_TITLE) self.dlgPassword.SetSendMessage("/safebox_password ") # END_OF_SAFEBOX_PASSWORD self.dlgPassword.ShowDialog() def OpenSafeboxWindow(self, size): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.dlgPassword.CloseDialog() self.wndSafebox.ShowWindow(size) def RefreshSafeboxMoney(self): self.wndSafebox.RefreshSafeboxMoney() def CommandCloseSafebox(self): self.wndSafebox.CommandCloseSafebox() # ITEM_MALL def AskMallPassword(self): if self.wndMall.IsShow(): return self.dlgPassword.SetTitle(localeInfo.MALL_PASSWORD_TITLE) self.dlgPassword.SetSendMessage("/mall_password ") self.dlgPassword.ShowDialog() def OpenMallWindow(self, size): self.dlgPassword.CloseDialog() self.wndMall.ShowWindow(size) def CommandCloseMall(self): self.wndMall.CommandCloseMall() # END_OF_ITEM_MALL ## Guild def OnStartGuildWar(self, guildSelf, guildOpp): self.wndGuild.OnStartGuildWar(guildSelf, guildOpp) guildWarScoreBoard = uiGuild.GuildWarScoreBoard() guildWarScoreBoard.Open(guildSelf, guildOpp) guildWarScoreBoard.Show() self.guildScoreBoardDict[uiGuild.GetGVGKey(guildSelf, guildOpp)] = guildWarScoreBoard def OnEndGuildWar(self, guildSelf, guildOpp): self.wndGuild.OnEndGuildWar(guildSelf, guildOpp) key = uiGuild.GetGVGKey(guildSelf, guildOpp) if not self.guildScoreBoardDict.has_key(key): return self.guildScoreBoardDict[key].Destroy() del self.guildScoreBoardDict[key] # GUILDWAR_MEMBER_COUNT def UpdateMemberCount(self, gulidID1, memberCount1, guildID2, memberCount2): key = uiGuild.GetGVGKey(gulidID1, guildID2) if not self.guildScoreBoardDict.has_key(key): return self.guildScoreBoardDict[key].UpdateMemberCount(gulidID1, memberCount1, guildID2, memberCount2) # END_OF_GUILDWAR_MEMBER_COUNT def OnRecvGuildWarPoint(self, gainGuildID, opponentGuildID, point): key = uiGuild.GetGVGKey(gainGuildID, opponentGuildID) if not self.guildScoreBoardDict.has_key(key): return guildBoard = self.guildScoreBoardDict[key] guildBoard.SetScore(gainGuildID, opponentGuildID, point) ## PK Mode def OnChangePKMode(self): self.wndCharacter.RefreshAlignment() self.dlgSystem.OnChangePKMode() ## Refine def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type): self.dlgRefineNew.Open(targetItemPos, nextGradeItemVnum, cost, prob, type) def AppendMaterialToRefineDialog(self, vnum, count): self.dlgRefineNew.AppendMaterial(vnum, count) ## Show & Hide def ShowDefaultWindows(self): self.wndTaskBar.Show() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.Show() self.wndMiniMap.Show() self.wndMiniMap.ShowMiniMap() if self.wndEnergyBar: self.wndEnergyBar.Show() def ShowAllWindows(self): self.wndTaskBar.Show() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: self.wndQuickSlot.Show() self.wndCharacter.Show() self.wndInventory.Show() if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.Show() self.wndDragonSoulRefine.Show() self.wndChat.Show() self.wndMiniMap.Show() if self.wndEnergyBar: self.wndEnergyBar.Show() if self.wndExpandedTaskBar: self.wndExpandedTaskBar.Show() self.wndExpandedTaskBar.SetTop() if self.wndExpandedMoneyTaskbar: self.wndExpandedMoneyTaskbar.Show() self.wndExpandedMoneyTaskbar.SetTop() if self.wndWonExchange: self.wndWonExchange.Show() def HideAllWindows(self): if self.wndTaskBar: self.wndTaskBar.Hide() if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: if self.wndQuickSlot: self.wndQuickSlot.Hide() if self.wndEnergyBar: self.wndEnergyBar.Hide() if app.ENABLE_DETAILS_UI: if self.wndCharacter: self.wndCharacter.Close() else: if self.wndCharacter: self.wndCharacter.Hide() if self.wndInventory: self.wndInventory.Hide() if app.WJ_SPLIT_INVENTORY_SYSTEM: if self.wndExtendedInventory: self.wndExtendedInventory.Hide() if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.Hide() self.wndDragonSoulRefine.Hide() if self.wndChat: self.wndChat.Hide() if self.wndMiniMap: self.wndMiniMap.Hide() if self.wndMessenger: self.wndMessenger.Hide() if self.wndGuild: self.wndGuild.Hide() if self.wndExpandedTaskBar: self.wndExpandedTaskBar.Hide() if self.wndExpandedMoneyTaskbar: self.wndExpandedMoneyTaskbar.Hide() if self.wndWonExchange: self.wndWonExchange.Hide() def ShowMouseImage(self): self.wndTaskBar.ShowMouseImage() def IsShowDlgQuestionWindow(self): if self.wndInventory.IsDlgQuestionShow(): return True elif self.wndDragonSoul.IsDlgQuestionShow(): return True elif self.dlgShop.IsDlgQuestionShow(): return True elif self.wndWonExchange.IsDlgQuestionShow(): return True else: return False def CloseDlgQuestionWindow(self): if self.wndInventory.IsDlgQuestionShow(): self.wndInventory.ExternQuestionDialog_Close() if self.wndDragonSoul.IsDlgQuestionShow(): self.wndDragonSoul.ExternQuestionDialog_Close() if self.dlgShop.IsDlgQuestionShow(): self.dlgShop.ExternQuestionDialog_Close() if self.wndWonExchange.IsDlgQuestionShow(): self.wndWonExchange.ExternQuestionDialog_Close() def YeniLink(self): if FALSE == self.wndChat.IsEditMode(): self.wndChat.OpenChat() self.wndChat.SetChatFocus() def HideMouseImage(self): self.wndTaskBar.HideMouseImage() def ToggleChat(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if TRUE == self.wndChat.IsEditMode(): self.wndChat.CloseChat() else: # ŔĄĆäŔĚÁö°ˇ ż·ČŔ»¶§´Â äĆĂ ŔÔ·ÂŔĚ ľČµĘ if self.wndWeb and self.wndWeb.IsShow(): pass else: self.wndChat.OpenChat() def IsOpenChat(self): return self.wndChat.IsEditMode() def SetChatFocus(self): self.wndChat.SetChatFocus() def OpenRestartDialog(self): self.dlgRestart.OpenDialog() self.dlgRestart.SetTop() def CloseRestartDialog(self): self.dlgRestart.Close() def ToggleSystemDialog(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == self.dlgSystem.IsShow(): self.dlgSystem.OpenDialog() self.dlgSystem.SetTop() else: self.dlgSystem.Close() def OpenSystemDialog(self): self.dlgSystem.OpenDialog() self.dlgSystem.SetTop() def ToggleMessenger(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if self.wndMessenger.IsShow(): self.wndMessenger.Hide() else: self.wndMessenger.SetTop() self.wndMessenger.Show() def ToggleMiniMap(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if app.IsPressed(app.DIK_LSHIFT) or app.IsPressed(app.DIK_RSHIFT): if FALSE == self.wndMiniMap.isShowMiniMap(): self.wndMiniMap.ShowMiniMap() self.wndMiniMap.SetTop() else: self.wndMiniMap.HideMiniMap() else: self.wndMiniMap.ToggleAtlasWindow() def PressMKey(self): if app.IsPressed(app.DIK_LALT) or app.IsPressed(app.DIK_RALT): self.ToggleMessenger() else: self.ToggleMiniMap() def SetMapName(self, mapName): self.wndMiniMap.SetMapName(mapName) def MiniMapScaleUp(self): self.wndMiniMap.ScaleUp() def MiniMapScaleDown(self): self.wndMiniMap.ScaleDown() def ToggleCharacterWindow(self, state): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): if FALSE == self.wndCharacter.IsShow(): self.OpenCharacterWindowWithState(state) else: if state == self.wndCharacter.GetState(): self.wndCharacter.OverOutItem() if app.ENABLE_DETAILS_UI: self.wndCharacter.Close() else: self.wndCharacter.Hide() else: self.wndCharacter.SetState(state) def OpenCharacterWindowWithState(self, state): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): self.wndCharacter.SetState(state) self.wndCharacter.Show() self.wndCharacter.SetTop() def ToggleCharacterWindowStatusPage(self): self.ToggleCharacterWindow("STATUS") def OtomatikAv(self): import uiotomatikav self.otomatikav = uiotomatikav.otomatikav() self.otomatikav.Show() def ToggleInventoryWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): if FALSE == self.wndInventory.IsShow(): self.wndInventory.Show() self.wndInventory.SetTop() if not self.wndExpandedMoneyTaskbar.IsShow(): self.wndExpandedMoneyTaskbar.Show() else: self.wndInventory.OverOutItem() self.wndInventory.Close() if self.wndExpandedMoneyTaskbar.IsShow(): self.wndExpandedMoneyTaskbar.Hide() if app.ENABLE_GROWTH_PET_SYSTEM: def TogglePetMain(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): if FALSE == self.wndExpandedTaskBar.IsShow(): self.wndExpandedTaskBar.Show() self.wndExpandedTaskBar.SetTop() else: self.wndExpandedTaskBar.Close() net.SendChatPacket("/gift") def ToggleOffShopMain(self): print "click_offline_shop_button" net.SendChatPacket("/open_offlineshop") if app.WJ_SPLIT_INVENTORY_SYSTEM: def ToggleExtendedInventoryWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): if self.wndExtendedInventory.IsShow(): self.wndExtendedInventory.OverOutItem() self.wndExtendedInventory.Close() else: self.wndExtendedInventory.Show() def ToggleBot1Main(self): if FALSE == player.IsObserverMode(): if FALSE == self.wndExpandedTaskBar.IsShow(): self.wndExpandedTaskBar.Show() self.wndExpandedTaskBar.SetTop() else: self.wndExpandedTaskBar.Close() import uiefsunlar self.ToggleBot1Main = uiefsunlar.OptionDialog() self.ToggleBot1Main.Show() def ToggleExpandedButton(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): if FALSE == self.wndExpandedTaskBar.IsShow(): self.wndExpandedTaskBar.Show() self.wndExpandedTaskBar.SetTop() else: self.wndExpandedTaskBar.Close() def ToggleExpandedMoneyButton(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == player.IsObserverMode(): if FALSE == self.wndExpandedMoneyTaskbar.IsShow(): self.wndExpandedMoneyTaskbar.Show() self.wndExpandedMoneyTaskbar.SetTop() else: self.wndExpandedMoneyTaskbar.Close() def Highlight_Item(self, inven_type, inven_pos): if not app.ENABLE_HIGHLIGHT_SYSTEM: if player.DRAGON_SOUL_INVENTORY == inven_type: if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.HighlightSlot(inven_pos) else: if inven_type == player.INVENTORY: self.wndInventory.HighlightSlot(inven_pos) elif inven_type == player.DRAGON_SOUL_INVENTORY: if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.HighlightSlot(inven_pos) elif app.ENABLE_SPECIAL_INVENTORY_SYSTEM and (inven_type == player.SKILL_BOOK_INVENTORY or inven_type == player.UPGRADE_ITEMS_INVENTORY or inven_type == player.STONE_ITEMS_INVENTORY): self.wndExtendedInventory.HighlightSlot(inven_pos) def DragonSoulActivate(self, deck): if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.ActivateDragonSoulByExtern(deck) def DragonSoulDeactivate(self): if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.DeactivateDragonSoul() def DragonSoulGiveQuilification(self): self.DRAGON_SOUL_IS_QUALIFIED = True if (self.wndExpandedTaskBar): # Just call SetToolTipText If self.wndExpandedTaskbar is not None self.wndExpandedTaskBar.SetToolTipText(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, uiScriptLocale.TASKBAR_DRAGON_SOUL) def ToggleDragonSoulWindow(self): if False == player.IsObserverMode(): if app.ENABLE_DRAGON_SOUL_SYSTEM: if False == self.wndDragonSoul.IsShow(): if self.DRAGON_SOUL_IS_QUALIFIED: self.wndDragonSoul.Show() else: try: self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED) self.wndPopupDialog.Open() except: self.wndPopupDialog = uiCommon.PopupDialog() self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED) self.wndPopupDialog.Open() else: self.wndDragonSoul.Close() def ToggleDragonSoulWindowWithNoInfo(self): if False == player.IsObserverMode(): if app.ENABLE_DRAGON_SOUL_SYSTEM: if False == self.wndDragonSoul.IsShow(): if self.DRAGON_SOUL_IS_QUALIFIED: self.wndDragonSoul.Show() else: self.wndDragonSoul.Close() def FailDragonSoulRefine(self, reason, inven_type, inven_pos): if False == player.IsObserverMode(): if app.ENABLE_DRAGON_SOUL_SYSTEM: if True == self.wndDragonSoulRefine.IsShow(): self.wndDragonSoulRefine.RefineFail(reason, inven_type, inven_pos) def SucceedDragonSoulRefine(self, inven_type, inven_pos): if False == player.IsObserverMode(): if app.ENABLE_DRAGON_SOUL_SYSTEM: if True == self.wndDragonSoulRefine.IsShow(): self.wndDragonSoulRefine.RefineSucceed(inven_type, inven_pos) def OpenDragonSoulRefineWindow(self): if False == player.IsObserverMode(): if app.ENABLE_DRAGON_SOUL_SYSTEM: if False == self.wndDragonSoulRefine.IsShow(): self.wndDragonSoulRefine.Show() if None != self.wndDragonSoul: if False == self.wndDragonSoul.IsShow(): self.wndDragonSoul.Show() def CloseDragonSoulRefineWindow(self): if False == player.IsObserverMode(): if app.ENABLE_DRAGON_SOUL_SYSTEM: if True == self.wndDragonSoulRefine.IsShow(): self.wndDragonSoulRefine.Close() def ClickTaskBarOfflineShopButton(self): net.SendChatPacket("/open_offlineshop") if app.WJ_OFFLINESHOP_SYSTEM: def ToggleOfflineShopAdminPanelWindow(self, i, time): if (self.wndOfflineShopManager.IsShow() == TRUE): self.wndOfflineShopManager.Close() else: self.wndOfflineShopManager.Open(i, time) def ToggleOfflineShopAdminPanelWindow2(self): if (self.wndOfflineShopManager2.IsShow() == TRUE): self.wndOfflineShopManager2.Close() else: self.wndOfflineShopManager2.Open() def ToggleGuildWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if not self.wndGuild.IsShow(): if self.wndGuild.CanOpen(): self.wndGuild.Open() else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GUILD_YOU_DO_NOT_JOIN) else: self.wndGuild.OverOutItem() self.wndGuild.Hide() def ToggleChatLogWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if self.wndChatLog.IsShow(): self.wndChatLog.Hide() else: self.wndChatLog.Show() def CheckGameButton(self): if self.wndGameButton: self.wndGameButton.CheckGameButton() def __OnClickStatusPlusButton(self): self.ToggleCharacterWindow("STATUS") def __OnClickSkillPlusButton(self): self.ToggleCharacterWindow("SKILL") def __OnClickQuestButton(self): self.ToggleCharacterWindow("QUEST") def __OnClickHelpButton(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return player.SetPlayTime(1) self.CheckGameButton() self.OpenHelpWindow() def __OnClickBuildButton(self): self.BUILD_OpenWindow() def OpenHelpWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.wndUICurtain.Show() self.wndHelp.Open() def CloseHelpWindow(self): self.wndUICurtain.Hide() self.wndHelp.Close() def OpenWebWindow(self, url): self.wndWeb.Open(url) self.wndChat.CloseChat() if app.ENABLE_MELEY_LAIR_DUNGEON: def OpenMeleyRanking(self): self.wndMeleyRanking.Open() def RankMeleyRanking(self, line, name, members, time): self.wndMeleyRanking.AddRank(line, name, members, time) # show GIFT def ShowGift(self): self.wndTaskBar.ShowGift() def CloseWbWindow(self): self.wndWeb.Close() ################# GAYA SYSTEM ############################ def OpenGuiGaya(self): self.wndGayaG.Open() def GayaCheck(self): self.wndGayaG.SucceedGaya() def OpenGuiGayaMarket(self): self.wndGayaM.Open() def GayaMarketItems(self,vnums,gaya,count): self.wndGayaM.Information(vnums,gaya,count) self.wndGayaM.LoadInformation() def GayaMarketSlotsDesblock(self,slot0,slot1,slot2,slot3,slot4,slot5): self.wndGayaM.SlotsDesblock(slot0,slot1,slot2,slot3,slot4,slot5) def GayaMarketClear(self): self.wndGayaM.Clear() def GayaTime(self,time): self.wndGayaM.Time(time) ################# GAYA SYSTEM ############################ if app.WJ_CHANGELOOK_SYSTEM: def ActChangeLook(self, iAct): if iAct == 1: if not self.wndChangeLook.IsOpened(): self.wndChangeLook.Open() if not self.wndInventory.IsShow(): self.wndInventory.Show() self.wndInventory.RefreshBagSlotWindow() elif iAct == 2: if self.wndChangeLook.IsOpened(): self.wndChangeLook.Close() self.wndInventory.RefreshBagSlotWindow() elif iAct == 3 or iAct == 4: if self.wndChangeLook.IsOpened(): self.wndChangeLook.Refresh() self.wndInventory.RefreshBagSlotWindow() if app.ENABLE_OKAY_CARD: def OpenCardsInfoWindow(self): if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return self.wndCardsInfo.Open() def OpenCardsWindow(self, safemode): self.wndCards.Open(safemode) def UpdateCardsInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points): self.wndCards.UpdateCardsInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points) def UpdateCardsFieldInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points): self.wndCards.UpdateCardsFieldInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points) def CardsPutReward(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points): self.wndCards.CardsPutReward(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points) if app.WJ_ITEM_COMBINATION_SYSTEM: ## Costume def OpenItemCombinationWindow(self): self.wndItemCombination.Open() if self.wndInventory.IsShow() == FALSE: self.wndInventory.Show() def SucceedItemCombinationWork(self): self.wndItemCombination.Clear() def OpenSkillBookCombinationWindow(self): self.wndSkillBookCombination.Open() if self.wndInventory.IsShow() == FALSE: self.wndInventory.Show() def SucceedSkillBookCombinationWork(self): self.wndSkillBookCombination.Clear() def CloseCombinationWindow(self): if self.wndItemCombination.IsShow() == TRUE: self.wndItemCombination.Close() elif self.wndSkillBookCombination.IsShow() == TRUE: self.wndSkillBookCombination.Close() if app.WJ_SHOP_SEARCH_SYSTEM: def OpenPrivateShopSearch(self, type): self.wndPrivateShopSearch.Open(type) def RefreshShopSearch(self): self.wndPrivateShopSearch.RefreshMe() self.wndPrivateShopSearch.RefreshList() if app.ENABLE_EVENT_INFORMATION_SYSTEM: def ShowEventWindowDialog(self): self.wndEvent.Refresh() self.wndEvent.OpenEventInfoDialog() def RefreshEventWindowDialog(self): self.wndEvent.Refresh() def BossHuntersTimeStamp(self, day): self.wndMiniGameAttendance.MiniGameAttendanceSetDay(day) def BossHuntersClearMission(self, value): self.wndMiniGameAttendance.MiniGameAttendanceSetMissionClear(value) def OpenMiniGameAttendance(self): self.wndMiniGameAttendance.MiniGameAttendanceSetShowMax(8) self.wndMiniGameAttendance.Open() if app.ENABLE_SASH_SYSTEM: def ActSash(self, iAct, bWindow): if iAct == 1: if bWindow == TRUE: if not self.wndSashCombine.IsOpened(): self.wndSashCombine.Open() if not self.wndInventory.IsShow(): self.wndInventory.Show() else: if not self.wndSashAbsorption.IsOpened(): self.wndSashAbsorption.Open() if not self.wndInventory.IsShow(): self.wndInventory.Show() self.wndInventory.RefreshBagSlotWindow() elif iAct == 2: if bWindow == TRUE: if self.wndSashCombine.IsOpened(): self.wndSashCombine.Close() else: if self.wndSashAbsorption.IsOpened(): self.wndSashAbsorption.Close() self.wndInventory.RefreshBagSlotWindow() elif iAct == 3 or iAct == 4: if bWindow == TRUE: if self.wndSashCombine.IsOpened(): self.wndSashCombine.Refresh(iAct) else: if self.wndSashAbsorption.IsOpened(): self.wndSashAbsorption.Refresh(iAct) self.wndInventory.RefreshBagSlotWindow() def OpenCubeWindow(self): self.wndCube.Open() if app.WJ_SECURITY_SYSTEM and player.IsSecurityActivate(): return if FALSE == self.wndInventory.IsShow(): self.wndInventory.Show() def UpdateCubeInfo(self, gold, itemVnum, count): self.wndCube.UpdateInfo(gold, itemVnum, count) def CloseCubeWindow(self): self.wndCube.Close() def FailedCubeWork(self): self.wndCube.Refresh() def SucceedCubeWork(self, itemVnum, count): self.wndCube.Clear() print "ĹĄşę Á¦ŔŰ Ľş°ř! [%d:%d]" % (itemVnum, count) if 0: self.wndCubeResult.SetPosition(*self.wndCube.GetGlobalPosition()) self.wndCubeResult.SetCubeResultItem(itemVnum, count) self.wndCubeResult.Open() self.wndCubeResult.SetTop() if app.WJ_SECURITY_SYSTEM: def OpenSecurityCreate(self): self.wndSecurityWindow.ShowDialog(TRUE) def OpenSecurityDialog(self): self.wndSecurityWindow.ShowDialog(FALSE) def CloseSecurityCreate(self): self.wndSecurityWindow.CloseDialog() def CloseSecurityDialog(self): self.wndSecurityWindow.CloseDialog() def __HideWindows(self): hideWindows = self.wndTaskBar,\ self.wndCharacter,\ self.wndInventory,\ self.wndMiniMap,\ self.wndGuild,\ self.wndMessenger,\ self.wndChat,\ self.wndParty,\ self.wndGameButton, if self.wndEnergyBar: hideWindows += self.wndEnergyBar, if self.wndExpandedTaskBar: hideWindows += self.wndExpandedTaskBar, if app.ENABLE_DRAGON_SOUL_SYSTEM: hideWindows += self.wndDragonSoul,\ self.wndDragonSoulRefine, if self.wndExpandedMoneyTaskbar: hideWindows += self.wndExpandedMoneyTaskbar, if app.ENABLE_NEW_QUICK_SLOT_SYSTEM: hideWindows += self.wndQuickSlot, if app.WJ_SPLIT_INVENTORY_SYSTEM: if self.wndExtendedInventory: hideWindows += self.wndExtendedInventory, hideWindows += self.wndWonExchange, hideWindows = filter(lambda x:x.IsShow(), hideWindows) map(lambda x:x.Hide(), hideWindows) import sys self.HideAllQuestButton() self.HideAllWhisperButton() if self.wndChat.IsEditMode(): self.wndChat.CloseChat() return hideWindows def ToggleWonExchangeWindow(self): if player.IsObserverMode(): return if False == self.wndWonExchange.IsShow(): self.wndWonExchange.SetPage(uiWonExchange.WonExchangeWindow.PAGE_SELL) self.wndWonExchange.Show() self.wndWonExchange.SetTop() else: self.wndWonExchange.Hide() def __ShowWindows(self, wnds): import sys map(lambda x:x.Show(), wnds) global IsQBHide if not IsQBHide: self.ShowAllQuestButton() else: self.HideAllQuestButton() self.ShowAllWhisperButton() def BINARY_OpenAtlasWindow(self): if self.wndMiniMap: self.wndMiniMap.ShowAtlas() def BINARY_SetObserverMode(self, flag): self.wndGameButton.SetObserverMode(flag) def BINARY_OpenSelectItemWindow(self): self.wndItemSelect.Open() def OpenInputNameDialogPet(self, slot): inputDialog = uiCommon.InputDialogName() inputDialog.SetTitle("Pet isim deđiţtir") inputDialog.SetAcceptEvent(ui.__mem_func__(self.ChangePetName)) inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog)) inputDialog.Open() inputDialog.slot = slot self.inputDialog = inputDialog def ChangePetName(self): net.SendChatPacket("/pet_change_name {0} {1}".format(str(self.inputDialog.slot), str(self.inputDialog.GetText()))) self.ClosePrivateShopInputNameDialog() def OpenPrivateShopInputNameDialog(self): inputDialog = uiCommon.InputDialog() inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE) inputDialog.SetMaxLength(32) inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder)) inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog)) inputDialog.Open() self.inputDialog = inputDialog def ClosePrivateShopInputNameDialog(self): self.inputDialog = None return TRUE def OpenPrivateShopBuilder(self): if not self.inputDialog: return TRUE if not len(self.inputDialog.GetText()): return TRUE self.privateShopBuilder.Open(self.inputDialog.GetText()) self.ClosePrivateShopInputNameDialog() return TRUE def AppearPrivateShop(self, vid, text): board = uiPrivateShopBuilder.PrivateShopAdvertisementBoard() board.Open(vid, text) self.privateShopAdvertisementBoardDict[vid] = board def DisappearPrivateShop(self, vid): if not self.privateShopAdvertisementBoardDict.has_key(vid): return del self.privateShopAdvertisementBoardDict[vid] uiPrivateShopBuilder.DeleteADBoard(vid) def OpenOfflineShopInputNameDialog(self): if constInfo.INPUT_DIALOG_SHOP == 1: import chat chat.AppendChat(1, "<Cevrimdisi Pazar> Aktif bir pencere mevcut.") return inputDialog = uiCommon.InputDialogShop() inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE) inputDialog.SetMaxLength(32) inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenOfflineShopBuilder)) inputDialog.SetCancelEvent(ui.__mem_func__(self.CloseOfflineShopInputNameDialog)) inputDialog.Open() self.inputDialog = inputDialog constInfo.INPUT_DIALOG_SHOP = 1 def CloseOfflineShopInputNameDialog(self): self.inputDialog.Close() self.inputDialog = None constInfo.INPUT_DIALOG_SHOP = 0 return TRUE def OpenOfflineShopBuilder(self): if (not self.inputDialog): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINE_SHOP_NOT_TITLE) return TRUE if (not len(self.inputDialog.GetText())): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINE_SHOP_NOT_TITLE) return TRUE self.offlineShopBuilder.Open(self.inputDialog.GetText(), self.inputDialog.GetStyle()) self.CloseOfflineShopInputNameDialog() return TRUE def AppearOfflineShop(self, vid, text): board = uiOfflineShopBuilder.OfflineShopAdvertisementBoard() board.Open(vid, text) self.offlineShopAdvertisementBoardDict[vid] = board def DisappearOfflineShop(self, vid): if (not self.offlineShopAdvertisementBoardDict.has_key(vid)): return del self.offlineShopAdvertisementBoardDict[vid] uiOfflineShopBuilder.DeleteADBoard(vid) ##################################################################################### ### Equipment ### def OpenEquipmentDialog(self, vid): import uiequipmentdialog if app.ENABLE_PVP_ADVANCED: if self.equipmentDialogDict.has_key(vid): self.equipmentDialogDict[vid].Destroy() self.CloseEquipmentDialog(vid) dlg = uiequipmentdialog.EquipmentDialog() dlg.SetItemToolTip(self.tooltipItem) dlg.SetCloseEvent(ui.__mem_func__(self.CloseEquipmentDialog)) dlg.Open(vid) self.equipmentDialogDict[vid] = dlg def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count): if not vid in self.equipmentDialogDict: return self.equipmentDialogDict[vid].SetEquipmentDialogItem(slotIndex, vnum, count) def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value): if not vid in self.equipmentDialogDict: return self.equipmentDialogDict[vid].SetEquipmentDialogSocket(slotIndex, socketIndex, value) def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value): if not vid in self.equipmentDialogDict: return self.equipmentDialogDict[vid].SetEquipmentDialogAttr(slotIndex, attrIndex, type, value) def CloseEquipmentDialog(self, vid): if not vid in self.equipmentDialogDict: return if app.ENABLE_PVP_ADVANCED: if self.equipmentDialogDict.has_key(vid): self.equipmentDialogDict[vid].Destroy() del self.equipmentDialogDict[vid] ##################################################################################### ### Quest ### def BINARY_ClearQuest(self, index): btn = self.__FindQuestButton(index) if 0 != btn: self.__DestroyQuestButton(btn) def RecvQuest(self, index, name): # QUEST_LETTER_IMAGE self.BINARY_RecvQuest(index, name, "file", localeInfo.GetLetterImageName()) # END_OF_QUEST_LETTER_IMAGE def BINARY_RecvQuest(self, index, name, iconType, iconName): btn = self.__FindQuestButton(index) if 0 != btn: self.__DestroyQuestButton(btn) btn = uiWhisper.WhisperButton() import item # QUEST_LETTER_IMAGE ##!! 20061026.levites.Äů˝şĆ®_ŔĚąĚÁö_±łĂĽ if "item"==iconType: item.SelectItem(int(iconName)) buttonImageFileName=item.GetIconImageFileName() else: buttonImageFileName=iconName if name[0] == '*': btn.SetUpVisual("locale/hu/icon/scroll_close_blue.tga") btn.SetOverVisual("locale/hu/icon/scroll_open_blue.tga") btn.SetDownVisual("locale/hu/icon/scroll_open_blue.tga") name = name[1:] elif name[0] == '~': btn.SetUpVisual("locale/hu/icon/scroll_close_golden.tga") btn.SetOverVisual("locale/hu/icon/scroll_open_golden.tga") btn.SetDownVisual("locale/hu/icon/scroll_open_golden.tga") name = name[1:] elif name[0] == '&': btn.SetUpVisual("locale/hu/icon/scroll_close_green.tga") btn.SetOverVisual("locale/hu/icon/scroll_open_green.tga") btn.SetDownVisual("locale/hu/icon/scroll_open_green.tga") name = name[1:] elif name[0] == '+': btn.SetUpVisual("locale/hu/icon/scroll_close_purple.tga") btn.SetOverVisual("locale/hu/icon/scroll_open_purple.tga") btn.SetDownVisual("locale/hu/icon/scroll_open_purple.tga") name = name[1:] else: btn.SetUpVisual(localeInfo.GetLetterCloseImageName()) btn.SetOverVisual(localeInfo.GetLetterOpenImageName()) btn.SetDownVisual(localeInfo.GetLetterOpenImageName()) # END_OF_QUEST_LETTER_IMAGE if localeInfo.IsARABIC(): btn.SetToolTipText(name, 0, 35) btn.ToolTipText.SetHorizontalAlignCenter() else: btn.SetToolTipText(name, -20, 35) btn.ToolTipText.SetHorizontalAlignLeft() btn.SetEvent(ui.__mem_func__(self.__StartQuest), btn) btn.Show() btn.index = index btn.name = name self.questButtonList.insert(0, btn) self.__ArrangeQuestButton() def __ArrangeQuestButton(self): screenWidth = wndMgr.GetScreenWidth() screenHeight = wndMgr.GetScreenHeight() if self.wndParty.IsShow(): xPos = 100 + 30 else: xPos = 20 if localeInfo.IsARABIC(): xPos = xPos + 15 yPos = 170 * screenHeight / 600 yCount = (screenHeight - 330) / 63 count = 0 for btn in self.questButtonList: btn.SetPosition(xPos + (int(count/yCount) * 100), yPos + (count%yCount * 63)) count += 1 global IsQBHide if IsQBHide: btn.Hide() else: btn.Show() def __StartQuest(self, btn): event.QuestButtonClick(btn.index) self.__DestroyQuestButton(btn) def __FindQuestButton(self, index): for btn in self.questButtonList: if btn.index == index: return btn return 0 def __DestroyQuestButton(self, btn): btn.SetEvent(0) self.questButtonList.remove(btn) self.__ArrangeQuestButton() def HideAllQuestButton(self): for btn in self.questButtonList: btn.Hide() def ShowAllQuestButton(self): if app.ENABLE_KINGDOMS_WAR: if self.wndKingdomsWar.IsShow(): return for btn in self.questButtonList: btn.Show() def __InitWhisper(self): chat.InitWhisper(self) def OpenWhisperDialogWithoutTarget(self): if not self.dlgWhisperWithoutTarget: dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog) dlgWhisper.BindInterface(self) dlgWhisper.LoadDialog() dlgWhisper.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog) dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30) dlgWhisper.Show() self.dlgWhisperWithoutTarget = dlgWhisper self.windowOpenPosition = (self.windowOpenPosition+1) % 5 else: self.dlgWhisperWithoutTarget.SetTop() self.dlgWhisperWithoutTarget.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog) def RegisterTemporaryWhisperDialog(self, name): if not self.dlgWhisperWithoutTarget: return btn = self.__FindWhisperButton(name) if 0 != btn: self.__DestroyWhisperButton(btn) elif self.whisperDialogDict.has_key(name): oldDialog = self.whisperDialogDict[name] oldDialog.Destroy() del self.whisperDialogDict[name] self.whisperDialogDict[name] = self.dlgWhisperWithoutTarget self.dlgWhisperWithoutTarget.OpenWithTarget(name) self.dlgWhisperWithoutTarget = None self.__CheckGameMaster(name) if app.ENABLE_LANG_AND_EMPIRE_FLAG: def OpenWhisperDialog(self, name, language = "", empire = ""): if not self.whisperDialogDict.has_key(name): dlg = self.__MakeWhisperDialog(name) dlg.OpenWithTarget(name) if language != "" and empire != "": dlg.SetFlag(language, empire) dlg.chatLine.SetFocus() dlg.Show() self.__CheckGameMaster(name) btn = self.__FindWhisperButton(name) if 0 != btn: dlg.SetFlag(btn.languageID, btn.empireID) self.__DestroyWhisperButton(btn) else: def OpenWhisperDialog(self, name): if not self.whisperDialogDict.has_key(name): dlg = self.__MakeWhisperDialog(name) dlg.OpenWithTarget(name) dlg.chatLine.SetFocus() dlg.Show() self.__CheckGameMaster(name) btn = self.__FindWhisperButton(name) if 0 != btn: self.__DestroyWhisperButton(btn) if app.ENABLE_LANG_AND_EMPIRE_FLAG: def RecvWhisper(self, name, language = "", empire = ""): if not self.whisperDialogDict.has_key(name): btn = self.__FindWhisperButton(name) if 0 == btn: btn = self.__MakeWhisperButton(name, language, empire) btn.Flash() if app.WINDOWS_PM_MESAJ: app.FlashApplication() chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name)) else: if language != "" and empire != "": btn.languageID = language btn.empireID = empire if app.WINDOWS_PM_MESAJ: btn.Flash() app.FlashApplication() elif self.IsGameMasterName(name): dlg = self.whisperDialogDict[name] dlg.SetGameMasterLook() if language != "" and empire != "": dlg.SetFlag(language, empire) else: def RecvWhisper(self, name): if not self.whisperDialogDict.has_key(name): btn = self.__FindWhisperButton(name) if 0 == btn: btn = self.__MakeWhisperButton(name) btn.Flash() chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name)) else: btn.Flash() elif self.IsGameMasterName(name): dlg = self.whisperDialogDict[name] dlg.SetGameMasterLook() def MakeWhisperButton(self, name): self.__MakeWhisperButton(name) if app.ENABLE_LANG_AND_EMPIRE_FLAG: def SetInterfaceFlag(self, name, language, empire): if self.whisperDialogDict.has_key(name): self.whisperDialogDict[name].SetFlag(language, empire) else: btn = self.__FindWhisperButton(name) if btn != 0: btn.languageID = language btn.empireID = empire if app.ENABLE_LANG_AND_EMPIRE_FLAG: def ShowWhisperDialog(self, btn): try: self.__MakeWhisperDialog(btn.name) dlgWhisper = self.whisperDialogDict[btn.name] dlgWhisper.OpenWithTarget(btn.name) if btn.languageID != "" and btn.empireID != "": dlgWhisper.SetFlag(btn.languageID, btn.empireID) dlgWhisper.Show() self.__CheckGameMaster(btn.name) except: import dbg dbg.TraceError("interface.ShowWhisperDialog - Failed to find key#11111") self.__DestroyWhisperButton(btn) else: def ShowWhisperDialog(self, btn): try: self.__MakeWhisperDialog(btn.name) dlgWhisper = self.whisperDialogDict[btn.name] dlgWhisper.OpenWithTarget(btn.name) dlgWhisper.Show() self.__CheckGameMaster(btn.name) except: import dbg dbg.TraceError("interface.ShowWhisperDialog - Failed to find key#22222") self.__DestroyWhisperButton(btn) if app.ENABLE_LANG_AND_EMPIRE_FLAG: def MinimizeWhisperDialog(self, name, languageID, empireID): if 0 != name: self.__MakeWhisperButton(name, languageID, empireID) self.CloseWhisperDialog(name) else: def MinimizeWhisperDialog(self, name): if 0 != name: self.__MakeWhisperButton(name) self.CloseWhisperDialog(name) if app.ENABLE_LANG_AND_EMPIRE_FLAG: def CloseWhisperDialog(self, name): if not isinstance(name, str): chat.AppendChat(chat.CHAT_TYPE_INFO, "Acesta nu este un nume") return if 0 == name: if self.dlgWhisperWithoutTarget: self.dlgWhisperWithoutTarget.Destroy() self.dlgWhisperWithoutTarget = None return try: if self.whisperDialogDict.has_key(name): dlgWhisper = self.whisperDialogDict[name] dlgWhisper.Destroy() del self.whisperDialogDict[name] except: import dbg dbg.TraceError("interface.CloseWhisperDialog - Failed to find key#33333") else: def CloseWhisperDialog(self, name): if 0 == name: if self.dlgWhisperWithoutTarget: self.dlgWhisperWithoutTarget.Destroy() self.dlgWhisperWithoutTarget = None return try: dlgWhisper = self.whisperDialogDict[name] dlgWhisper.Destroy() del self.whisperDialogDict[name] except: import dbg dbg.TraceError("interface.CloseWhisperDialog - Failed to find key") def __ArrangeWhisperButton(self): screenWidth = wndMgr.GetScreenWidth() screenHeight = wndMgr.GetScreenHeight() xPos = screenWidth - 70 yPos = 170 * screenHeight / 600 yCount = (screenHeight - 330) / 63 #yCount = (screenHeight - 285) / 63 count = 0 for button in self.whisperButtonList: button.SetPosition(xPos + (int(count/yCount) * -50), yPos + (count%yCount * 63)) count += 1 def __FindWhisperButton(self, name): for button in self.whisperButtonList: if button.name == name: return button return 0 def __MakeWhisperDialog(self, name): dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog) dlgWhisper.BindInterface(self) dlgWhisper.LoadDialog() dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30) self.whisperDialogDict[name] = dlgWhisper self.windowOpenPosition = (self.windowOpenPosition+1) % 5 return dlgWhisper if app.ENABLE_LANG_AND_EMPIRE_FLAG: def __MakeWhisperButton(self, name, languageID = "", empireID = ""): whisperButton = uiWhisper.WhisperButton() whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") if self.IsGameMasterName(name): whisperButton.SetToolTipTextWithColor(name, 0xffffa200) else: whisperButton.SetToolTipText(name) whisperButton.ToolTipText.SetHorizontalAlignCenter() whisperButton.SetEvent(ui.__mem_func__(self.ShowWhisperDialog), whisperButton) whisperButton.Show() whisperButton.name = name whisperButton.languageID = languageID whisperButton.empireID = empireID self.whisperButtonList.insert(0, whisperButton) self.__ArrangeWhisperButton() return whisperButton else: def __MakeWhisperButton(self, name): whisperButton = uiWhisper.WhisperButton() whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") if self.IsGameMasterName(name): whisperButton.SetToolTipTextWithColor(name, 0xffffa200) else: whisperButton.SetToolTipText(name) whisperButton.ToolTipText.SetHorizontalAlignCenter() whisperButton.SetEvent(ui.__mem_func__(self.ShowWhisperDialog), whisperButton) whisperButton.Show() whisperButton.name = name self.whisperButtonList.insert(0, whisperButton) self.__ArrangeWhisperButton() return whisperButton def __DestroyWhisperButton(self, button): button.SetEvent(0) self.whisperButtonList.remove(button) self.__ArrangeWhisperButton() def HideAllWhisperButton(self): for btn in self.whisperButtonList: btn.Hide() def ShowAllWhisperButton(self): for btn in self.whisperButtonList: btn.Show() def __CheckGameMaster(self, name): if not self.listGMName.has_key(name): return if self.whisperDialogDict.has_key(name): dlg = self.whisperDialogDict[name] dlg.SetGameMasterLook() def RegisterGameMasterName(self, name): if self.listGMName.has_key(name): return self.listGMName[name] = "GM" def IsGameMasterName(self, name): if self.listGMName.has_key(name): return TRUE else: return FALSE def BUILD_OpenWindow(self): self.wndGuildBuilding = uiGuild.BuildGuildBuildingWindow() self.wndGuildBuilding.Open() self.wndGuildBuilding.wnds = self.__HideWindows() self.wndGuildBuilding.SetCloseEvent(ui.__mem_func__(self.BUILD_CloseWindow)) def BUILD_CloseWindow(self): self.__ShowWindows(self.wndGuildBuilding.wnds) self.wndGuildBuilding = None def BUILD_OnUpdate(self): if not self.wndGuildBuilding: return if self.wndGuildBuilding.IsPositioningMode(): import background x, y, z = background.GetPickingPoint() self.wndGuildBuilding.SetBuildingPosition(x, y, z) def BUILD_OnMouseLeftButtonDown(self): if not self.wndGuildBuilding: return # GUILD_BUILDING if self.wndGuildBuilding.IsPositioningMode(): self.wndGuildBuilding.SettleCurrentPosition() return TRUE elif self.wndGuildBuilding.IsPreviewMode(): pass else: return TRUE # END_OF_GUILD_BUILDING return FALSE def BUILD_OnMouseLeftButtonUp(self): if not self.wndGuildBuilding: return if not self.wndGuildBuilding.IsPreviewMode(): return TRUE return FALSE def BULID_EnterGuildArea(self, areaID): # GUILD_BUILDING mainCharacterName = player.GetMainCharacterName() masterName = guild.GetGuildMasterName() if mainCharacterName != masterName: return if areaID != player.GetGuildID(): return # END_OF_GUILD_BUILDING self.wndGameButton.ShowBuildButton() def BULID_ExitGuildArea(self, areaID): self.wndGameButton.HideBuildButton() ##################################################################################### def IsEditLineFocus(self): if self.ChatWindow.chatLine.IsFocus(): return 1 if self.ChatWindow.chatToLine.IsFocus(): return 1 return 0 def EmptyFunction(self): pass def GetInventoryPageIndex(self): if self.wndInventory: return self.wndInventory.GetInventoryPageIndex() else: return -1 if app.WJ_ENABLE_TRADABLE_ICON: def SetOnTopWindow(self, onTopWnd): self.onTopWindow = onTopWnd def GetOnTopWindow(self): return self.onTopWindow def RefreshMarkInventoryBag(self): self.wndInventory.RefreshMarkSlots() if app.ENABLE_KINGDOMS_WAR: def ActKingdomsWar(self, act, score1, score2, score3, limitKills, deads, limiDeads, timeRemained): if self.wndKingdomsWar: if act == 1: self.wndKingdomsWar.ShowWindow(score1, score2, score3, limitKills, deads, limiDeads, timeRemained) global IsQBHide IsQBHide = 1 for btn in self.questButtonList: btn.Hide() elif act == 2: self.wndKingdomsWar.RefreshScore(score1, score2, score3, limitKills) elif act == 3: self.wndKingdomsWar.RefreshDeads(deads, limiDeads) if app.ENABLE_FISH_EVENT_SYSTEM: def MiniGameFishUse(self, shape, useCount): if self.wndEvent: self.wndEvent.MiniGameFishUse(shape, useCount) def MiniGameFishAdd(self, pos, shape): if self.wndEvent: self.wndEvent.MiniGameFishAdd(pos, shape) def MiniGameFishReward(self, vnum): if self.wndEvent: self.wndEvent.MiniGameFishReward(vnum) def MiniGameFishCount(self, count): if self.wndEvent: self.wndEvent.MiniGameFishCount(count) def SetFishEventStatus(self, isEnable): if isEnable: if not self.wndEvent: self.wndEvent = uiMiniGame.MiniGameWindow() if self.tooltipItem: if self.wndEvent: self.wndEvent.SetItemToolTip(self.tooltipItem) if app.WJ_ENABLE_TRADABLE_ICON: if self.wndEvent: self.wndEvent.BindInterface(self) if self.wndInventory: if self.wndEvent: self.wndEvent.BindInventory(self.wndInventory) self.wndEvent.IntegrationMiniGame(True) else: if self.wndEvent: self.wndEvent.IntegrationMiniGame(False) if __name__ == "__main__": import app import wndMgr import systemSetting import mouseModule import grp import ui import localeInfo app.SetMouseHandler(mouseModule.mouseController) app.SetHairColorEnable(TRUE) wndMgr.SetMouseHandler(mouseModule.mouseController) wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight()) app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1) mouseModule.mouseController.Create() class TestGame(ui.Window): def __init__(self): ui.Window.__init__(self) localeInfo.LoadLocaleData() player.SetItemData(0, 27001, 10) player.SetItemData(1, 27004, 10) self.interface = Interface() self.interface.MakeInterface() self.interface.ShowDefaultWindows() self.interface.RefreshInventory() #self.interface.OpenCubeWindow() def __del__(self): ui.Window.__del__(self) def OnUpdate(self): app.UpdateGame() def OnRender(self): app.RenderGame() grp.PopState() grp.SetInterfaceRenderState() game = TestGame() game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight()) game.Show() app.Loop() Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
doxiddos 2 Posted March 31, 2021 Share Posted March 31, 2021 Does anybody have the fix, i don't see the point why somebody opens a thread and asks for help but does not give the fix ... 1 Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 12, 2022 Share Posted March 12, 2022 I'm also having the same problem, did anyone find a solution please? Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2428 Posted March 16, 2022 Developer Share Posted March 16, 2022 (edited) On 1/17/2018 at 11:14 PM, .Stefan said: Hey, i got a double Map shown after a teleport. I don't really know what it could be. Any Tips where to search ? Memory leak. All references instantiated in the class must be set to None before deleting the object. Check your class AtlasWindow inside uiminimap.py and search for def Destroy, inside this function you have to move to None all the reference. Edited August 16, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 18, 2022 Share Posted March 18, 2022 On 16/03/2022 at 11:43, Ikarus_ said: Memory leak. All references instantiated in the class must be set to None before deleting the object. Check your class AtlasWindow inside uiminimap.py and search for def Destroy, inside this function you have to move to None all the reference. I looked at the class you referred to and everything seems to be correct, but the error persists =/ Spoiler 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 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 Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2428 Posted March 18, 2022 Developer Share Posted March 18, 2022 18 minutes ago, Marcos17 said: I looked at the class you referred to and everything seems to be correct, but the error persists =/ Reveal hidden contents 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 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 There's a easy&fast way to check if i m correct. Replace your def Destroy with mine posting here: def Destroy(self): miniMap.UnregisterAtlasWindow() self.ClearDictionary() self.AtlasMainWindow = None self.tooltipAtlasClose = 0 self.tooltipInfo = None self.infoGuildMark = None self.board = None import dbg references = vars(self) dbg.TraceError("STARTING WITH DUMPING AtlasWindow") for name, value in references.items(): dgb.TraceError("AtlasWindowReference {}={}".format(name, value)) You need to login into game and warp your character, You will find dumping inside your syserr.txt Let's hypothesize the possible scenarios: 1. The syserr looks empty : Your Destroy function is never called: You must call it 2. The syserr contains strings but all of them has value "None" or numbers/empty lists etc: My guess was wrong, the problem is something else. 3. The syserr contains strings and at least one of them is a reference to an object which makes your AtlasWindow not cleaned enough. if you need help understanding what scenario you got you can post your syserr here 1 My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 18, 2022 Share Posted March 18, 2022 (edited) 2 hours ago, Ikarus_ said: There's a easy&fast way to check if i m correct. Replace your def Destroy with mine posting here: def Destroy(self): miniMap.UnregisterAtlasWindow() self.ClearDictionary() self.AtlasMainWindow = None self.tooltipAtlasClose = 0 self.tooltipInfo = None self.infoGuildMark = None self.board = None import dbg references = vars(self) dbg.TraceError("STARTING WITH DUMPING AtlasWindow") for name, value in references.items(): dgb.TraceError("AtlasWindowReference {}={}".format(name, value)) You need to login into game and warp your character, You will find dumping inside your syserr.txt Let's hypothesize the possible scenarios: 1. The syserr looks empty : Your Destroy function is never called: You must call it 2. The syserr contains strings but all of them has value "None" or numbers/empty lists etc: My guess was wrong, the problem is something else. 3. The syserr contains strings and at least one of them is a reference to an object which makes your AtlasWindow not cleaned enough. if you need help understanding what scenario you got you can post your syserr here my syserr: 0318 18:02:31278 :: STARTING WITH DUMPING AtlasWindow 0318 18:02:31278 :: AtlasWindowReference mouseLeftButtonUpEvent=None 0318 18:02:31278 :: AtlasWindowReference mouseLeftButtonDownArgs=None 0318 18:02:31278 :: AtlasWindowReference hWnd=690919656 0318 18:02:31278 :: AtlasWindowReference tooltipInfo=None 0318 18:02:31278 :: AtlasWindowReference AtlasMainWindow=None 0318 18:02:31278 :: AtlasWindowReference baseX=0 0318 18:02:31278 :: AtlasWindowReference baseY=0 0318 18:02:31278 :: AtlasWindowReference moveWindowEvent=None 0318 18:02:31278 :: AtlasWindowReference overInArgs=None 0318 18:02:31278 :: AtlasWindowReference renderArgs=None 0318 18:02:31278 :: AtlasWindowReference mouseLeftButtonDoubleClickEvent=None 0318 18:02:31278 :: AtlasWindowReference mapName= 0318 18:02:31278 :: AtlasWindowReference mouseRightButtonDownArgs=None 0318 18:02:31278 :: AtlasWindowReference board=None 0318 18:02:31278 :: AtlasWindowReference infoGuildMark=None 0318 18:02:31278 :: AtlasWindowReference onMouseLeftButtonUpEvent=None 0318 18:02:31278 :: AtlasWindowReference overInEvent=None 0318 18:02:31278 :: AtlasWindowReference mouseLeftButtonDownEvent=None 0318 18:02:31278 :: AtlasWindowReference ElementDictionary={} 0318 18:02:31278 :: AtlasWindowReference parentWindow=0 0318 18:02:31278 :: AtlasWindowReference mouseLeftButtonUpArgs=None 0318 18:02:31278 :: AtlasWindowReference mouseRightButtonDownEvent=None 0318 18:02:31278 :: AtlasWindowReference overOutEvent=None 0318 18:02:31278 :: AtlasWindowReference renderEvent=None 0318 18:02:31278 :: AtlasWindowReference overOutArgs=None 0318 18:02:31278 :: AtlasWindowReference clickEvent=None 0318 18:02:31278 :: AtlasWindowReference tooltipAtlasClose=0 0318 18:02:31278 :: AtlasWindowReference Children=[] Edited March 18, 2022 by Marcos17 Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2428 Posted March 18, 2022 Developer Share Posted March 18, 2022 Can u paste your uiminimap.py in a pastebin? I would like to read it 1 My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 19, 2022 Share Posted March 19, 2022 15 hours ago, Ikarus_ said: Can u paste your uiminimap.py in a pastebin? I would like to read it https://pastebin.com/Qk4HubMc Thanks for trying to help Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2428 Posted March 19, 2022 Developer Share Posted March 19, 2022 (edited) What may not be cleaned is not necessarily AtlasWindow but its child named "board" . Let's see if you dump it what's coming out. 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 The test is obv identical to the previous one. My guess is that the close event of the "BoardWithTitleBar" isn't moved to None Edited March 19, 2022 by Ikarus_ My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 20, 2022 Share Posted March 20, 2022 19 hours ago, Ikarus_ said: What may not be cleaned is not necessarily AtlasWindow but its child named "board" . Let's see if you dump it what's coming out. 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 The test is obv identical to the previous one. My guess is that the close event of the "BoardWithTitleBar" isn't moved to None Spoiler 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: STARTING AtlasWindow.board.titleBar DUMP 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2428 Posted March 20, 2022 Developer Share Posted March 20, 2022 16 minutes ago, Marcos17 said: Hide contents 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: AtlasWindow.board.{} = {} 0320 15:56:38838 :: STARTING AtlasWindow.board.titleBar DUMP 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} 0320 15:56:38838 :: AtlasWindow.board.titleBar.{} = {} Yesterday i update the code fixing a bug, but it looks you copied it with no fix applied. Can u copy it again? My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 20, 2022 Share Posted March 20, 2022 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) Link to comment Share on other sites More sharing options...
Developer Ikarus_ 2428 Posted March 20, 2022 Developer Share Posted March 20, 2022 34 minutes ago, Marcos17 said: Reveal hidden contents #<----------------------------------------------------------- ># # _ +----------------------------------------------+ _ # # /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) I meant the code posted by me. The last Destroy My youtube channel on which you can see my works here Link to comment Share on other sites More sharing options...
Marcos17 19 Posted March 20, 2022 Share Posted March 20, 2022 4 minutes ago, Ikarus_ said: I meant the code posted by me. The last Destroy First Spoiler def Destroy(self): miniMap.UnregisterAtlasWindow() self.ClearDictionary() self.AtlasMainWindow = None self.tooltipAtlasClose = 0 self.tooltipInfo = None self.infoGuildMark = None self.board = None import dbg references = vars(self) dbg.TraceError("STARTING WITH DUMPING AtlasWindow") for name, value in references.items(): dbg.TraceError("AtlasWindowReference {}={}".format(name, value)) 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