- Mesaj
- 381
- Çözümler
- 7
- Beğeni
- 128
- Puan
- 529
- Ticaret Puanı
- 0
Aldığım syser hatası
İşlem yaptığım dosyalar ekte Sistem ise @hasanmacit beyefendinin paylaştığı haritaya mini eklenti, portal npc gorunumu gızleme gosterme
Aldığım Syser hatası:
0920 12:35:11868 :: UISCRIPT_LOAD_ERROR: can only concatenate tuple (not "list") to tuple [filename UIScript/AtlasWindow.py]
0920 12:35:11869 ::
uiMiniMap.py(line:101) LoadWindow
ui.py(line:4303) GetChild
AtlasWindow.LoadWindow.BindObject - <type 'exceptions.KeyError'>:'boardtype'
0920 12:35:11869 :: ============================================================================================================
0920 12:35:11869 :: Abort!!!!
İşlem yaptığım dosyalar ekte Sistem ise @hasanmacit beyefendinin paylaştığı haritaya mini eklenti, portal npc gorunumu gızleme gosterme
Uiminimap.py:
import ui
import uiScriptLocale
import wndMgr
import player
import miniMap
import localeInfo
import net
import app
import colorInfo
import constInfo
import background
import systemSetting
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
if app.ENABLE_REDIX_MAP_NPCSHOW:
self.ButtonList = []
self.boardtype = None
self.boardtype2 = None
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")
if app.ENABLE_REDIX_MAP_NPCSHOW:
self.boardtype = self.GetChild("boardtype")
self.boardtype2 = self.GetChild("boardtype2")
self.ButtonList.append(self.GetChild("show_npc_view"))
self.ButtonList.append(self.GetChild("show_warp_view"))
self.ButtonList.append(self.GetChild("show_guild_view"))
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)
if app.ENABLE_REDIX_MAP_NPCSHOW:
self.ButtonList[0].SetToggleUpEvent(self.OnClickShowNpc)
self.ButtonList[0].SetToggleDownEvent(self.OnClickShowNpc)
self.ButtonList[1].SetToggleUpEvent(self.OnClickShowWarp)
self.ButtonList[1].SetToggleDownEvent(self.OnClickShowWarp)
self.ButtonList[2].SetToggleUpEvent(self.OnClickShowGuild)
self.ButtonList[2].SetToggleDownEvent(self.OnClickShowGuild)
self.RefreshNpcWarpGuildButton()
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
if app.ENABLE_REDIX_MAP_NPCSHOW:
self.ButtonList = []
self.boardtype = None
self.boardtype2 = 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:
if app.ENABLE_REDIX_MAP_NPCSHOW:
self.SetSize(iSizeX + 15, iSizeY + 38+80)
self.boardtype.SetSize(iSizeX + 15, 85+10 )
self.boardtype2.SetSize(iSizeX - 5, 75 )
else:
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)
if app.ENABLE_REDIX_MAP_NPCSHOW:
def OnClickShowNpc(self):
systemSetting.SetSnowAtlasNpc(not systemSetting.GetSnowAtlasNpc())
self.RefreshNpcWarpGuildButton()
def OnClickShowWarp(self):
systemSetting.SetSnowAtlasWarp(not systemSetting.GetSnowAtlasWarp())
self.RefreshNpcWarpGuildButton()
def OnClickShowGuild(self):
systemSetting.SetSnowAtlasGuild(not systemSetting.GetSnowAtlasGuild())
self.RefreshNpcWarpGuildButton()
def RefreshNpcWarpGuildButton(self):
if systemSetting.GetSnowAtlasNpc():
self.ButtonList[0].Down()
else:
self.ButtonList[0].SetUp()
if systemSetting.GetSnowAtlasWarp():
self.ButtonList[1].Down()
else:
self.ButtonList[1].SetUp()
if systemSetting.GetSnowAtlasGuild():
self.ButtonList[2].Down()
else:
self.ButtonList[2].SetUp()
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,
}
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.FPSBilgi = 0
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, 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")
#DevRedixNewMiniMap
self.mapNameText = self.GetChild("MapName")
#DevRedixNewMiniMap
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.serverInfo = self.GetChild("ServerInfo")
self.FPSBilgi = self.GetChild("FPSBilgi")
except:
import exception
exception.Abort("MiniMap.LoadWindow.Bind")
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))
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 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):
(x, y, z) = player.GetMainCharacterPosition()
miniMap.Update(x, y)
self.positionInfo.SetText("(%.0f, %.0f)" % (x/100, y/100))
nRenderFPS=app.GetRenderFPS()
fps="%3d"%(nRenderFPS)
self.FPSBilgi.SetText(uiScriptLocale.FPS_PERFORMANS+ " " + str(fps))
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()
##DevRedixNewMiniMap
import locale
import datetime
locale.setlocale(locale.LC_ALL, 'turkish')
# mydate = datetime.datetime.now()
# gun = time.strftime("%d ")
# ay = mydate.strftime("%B ")
# yil = time.strftime("%Y")
# gun2 = mydate.strftime(" %A")
# self.GetChild("Tarih").SetText(time.strftime(gun+ay+yil+gun2))
# self.GetChild("Tarih").Show()
##DevRedixNewMiniMap
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()
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()
##DevRedixNewMiniMap
def UpdateMapName(self, mapName, isHide = False):
self.mapNameText.SetText(mapName)
self.mapNameText.Show()
##DevRedixNewMiniMap
def ToggleAtlasWindow(self):
if not miniMap.IsAtlas():
return
if self.AtlasWindow.IsShow():
self.AtlasWindow.Hide()
else:
self.AtlasWindow.Show()
Atlaswindow.py:
import app
import uiScriptLocale
ROOT = "d:/ymir work/ui/minimap/"
window = {
"name" : "AtlasWindow",
"style" : ("movable", "float",),
"x" : SCREEN_WIDTH - 136 - 256 - 10,
"y" : 0,
"width" : 256 + 15,
"height" : 256 + 38,
"children" :
(
## BOARD
{
"name" : "board",
"type" : "board_with_titlebar",
"x" : 0,
"y" : 0,
"width" : 256 + 15,
"height" : 256 + 38,
"title" : uiScriptLocale.ZONE_MAP,
},
),
}
if app.ENABLE_REDIX_MAP_NPCSHOW:
window["children"] = window["children"] +[
{
"name" : "boardtype",
"type" : "board",
"x" : 0,
"y" : 256 + 38,
"width" : 256 + 15,
"height" : 64,
"children" :
[
{
"name" : "boardtype2",
"type" : "thinboard",
"x" : 10,
"y" : 10,
"width" : 256-57,
"height" : 64,
"children" :
(
{
"name" : "show_npc_view",
"type" : "toggle_button",
"x" : 9,
"y" : 10,
"default_image" : "d:/ymir work/devredix/atlas/button_01.tga",
"over_image" : "d:/ymir work/devredix/atlas/button_01.tga",
"down_image" : "d:/ymir work/devredix/atlas/button_02.tga",
"children" :
(
{
"name" : "show_npc_view_text", "type" : "text",
"x" : 10*2, "y" : 0,
"text" : "Npc görünümü",
},
),
},
{
"name" : "show_warp_view",
"type" : "toggle_button",
"x" : 9,
"y" : 10*3,
"default_image" : "d:/ymir work/devredix/atlas/button_01.tga",
"over_image" : "d:/ymir work/devredix/atlas/button_01.tga",
"down_image" : "d:/ymir work/devredix/atlas/button_02.tga",
"children" :
(
{
"name" : "show_warp_view_text", "type" : "text",
"x" : 10*2, "y" : 0,
"text" : "Portal görünümü",
},
),
},
{
"name" : "show_guild_view",
"type" : "toggle_button",
"x" : 9,
"y" : 10*5,
"default_image" : "d:/ymir work/devredix/atlas/button_01.tga",
"over_image" : "d:/ymir work/devredix/atlas/button_01.tga",
"down_image" : "d:/ymir work/devredix/atlas/button_02.tga",
"children" :
(
{
"name" : "show_guild_view_text", "type" : "text",
"x" : 10*2, "y" : 0,
"text" : "Lonca görünümü",
},
),
},
),
},
],
},
]