^titel
kommt sobald wenn ich 2x auf das bündel klicke
ansonsten funktioniert das
weiß jemand weiter ?
syserr:
Code
- 1230 19:01:17735 :: Traceback (most recent call last):
- 1230 19:01:17735 :: File "ui.py", line 1371, in CallEvent
- 1230 19:01:17736 :: File "ui.py", line 88, in __call__
- 1230 19:01:17736 :: File "ui.py", line 70, in __call__
- 1230 19:01:17736 :: File "interfaceModule.py", line 1389, in OpenPrivateShopBuilder
- 1230 19:01:17736 :: File "uiCommon.py", line 262, in GetText
- 1230 19:01:17736 :: AttributeError
- 1230 19:01:17736 :: :
- 1230 19:01:17736 :: 'NoneType' object has no attribute 'GetText'
- 1230 19:01:17736 ::
uicommon.py
Code
- import ui
- import localeInfo
- import app
- import ime
- import uiScriptLocale
- class PopupDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__LoadDialog()
- self.acceptEvent = lambda *arg: None
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __LoadDialog(self):
- try:
- PythonScriptLoader = ui.PythonScriptLoader()
- PythonScriptLoader.LoadScriptFile(self, "UIScript/PopupDialog.py")
- self.board = self.GetChild("board")
- self.message = self.GetChild("message")
- self.accceptButton = self.GetChild("accept")
- self.accceptButton.SetEvent(ui.__mem_func__(self.Close))
- except:
- import exception
- exception.Abort("PopupDialog.LoadDialog.BindObject")
- def Open(self):
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- def Close(self):
- self.Hide()
- self.acceptEvent()
- def Destroy(self):
- self.Close()
- self.ClearDictionary()
- def SetWidth(self, width):
- height = self.GetHeight()
- self.SetSize(width, height)
- self.board.SetSize(width, height)
- self.SetCenterPosition()
- self.UpdateRect()
- def SetText(self, text):
- self.message.SetText(text)
- def SetAcceptEvent(self, event):
- self.acceptEvent = event
- def SetButtonName(self, name):
- self.accceptButton.SetText(ButtonName)
- def OnPressEscapeKey(self):
- self.Close()
- return TRUE
- def OnIMEReturn(self):
- self.Close()
- return TRUE
- class InputDialogShop(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- self.type = 0
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/inputdialogshop.py")
- getObject = self.GetChild
- self.board = getObject("Board")
- self.acceptButton = getObject("AcceptButton")
- self.cancelButton = getObject("CancelButton")
- self.inputSlot = getObject("InputSlot")
- self.inputValue = getObject("InputValue")
- self.inputType0 = getObject("InputType0")
- self.inputType1 = getObject("InputType1")
- self.inputType2 = getObject("InputType2")
- self.inputType3 = getObject("InputType3")
- self.inputType4 = getObject("InputType4")
- self.inputType5 = getObject("InputType5")
- self.inputType6 = getObject("InputType6")
- self.inputType7 = getObject("InputType7")
- self.inputType0.SetEvent(self.__ChangeInputType0)
- self.inputType1.SetEvent(self.__ChangeInputType1)
- self.inputType2.SetEvent(self.__ChangeInputType2)
- self.inputType3.SetEvent(self.__ChangeInputType3)
- self.inputType4.SetEvent(self.__ChangeInputType4)
- self.inputType5.SetEvent(self.__ChangeInputType5)
- self.inputType6.SetEvent(self.__ChangeInputType6)
- self.inputType7.SetEvent(self.__ChangeInputType7)
- def Open(self):
- self.inputValue.SetFocus()
- self.__ChangeInputType0()
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- def Close(self):
- self.ClearDictionary()
- self.board = None
- self.acceptButton = None
- self.cancelButton = None
- self.inputSlot = None
- self.inputValue = None
- self.inputType0 = None
- self.inputType1 = None
- self.inputType2 = None
- self.inputType3 = None
- self.inputType4 = None
- self.inputType5 = None
- self.inputType6 = None
- self.inputType7 = None
- self.type = None
- self.Hide()
- def SetTitle(self, name):
- self.board.SetTitleName(name)
- def SetNumberMode(self):
- self.inputValue.SetNumberMode()
- def SetSecretMode(self):
- self.inputValue.SetSecret()
- def SetFocus(self):
- self.inputValue.SetFocus()
- def SetMaxLength(self, length):
- width = length * 6 + 10
- self.SetBoardWidth(max(width + 50, 160))
- self.SetSlotWidth(width)
- self.inputValue.SetMax(length)
- def SetSlotWidth(self, width):
- self.inputSlot.SetSize(width, self.inputSlot.GetHeight())
- self.inputValue.SetSize(width, self.inputValue.GetHeight())
- if self.IsRTL():
- self.inputValue.SetPosition(self.inputValue.GetWidth(), 0)
- def SetBoardWidth(self, width):
- self.SetSize(max(width + 50, 160), self.GetHeight())
- self.board.SetSize(max(width + 50, 160), self.GetHeight())
- if self.IsRTL():
- self.board.SetPosition(self.board.GetWidth(), 0)
- self.UpdateRect()
- def SetAcceptEvent(self, event):
- self.acceptButton.SetEvent(event)
- self.inputValue.OnIMEReturn = event
- def SetCancelEvent(self, event):
- self.board.SetCloseEvent(event)
- self.cancelButton.SetEvent(event)
- self.inputValue.OnPressEscapeKey = event
- def __ChangeInputType0(self):
- self.type = 0
- self.GetChild("InputType0").Down()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType1(self):
- self.type = 1
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").Down()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType2(self):
- self.type = 2
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").Down()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType3(self):
- self.type = 3
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").Down()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType4(self):
- self.type = 4
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").Down()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType5(self):
- self.type = 5
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").Down()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType6(self):
- self.type = 6
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").Down()
- self.GetChild("InputType7").SetUp()
- def __ChangeInputType7(self):
- self.type = 7
- self.GetChild("InputType0").SetUp()
- self.GetChild("InputType1").SetUp()
- self.GetChild("InputType2").SetUp()
- self.GetChild("InputType3").SetUp()
- self.GetChild("InputType4").SetUp()
- self.GetChild("InputType5").SetUp()
- self.GetChild("InputType6").SetUp()
- self.GetChild("InputType7").Down()
- def GetText(self):
- return self.inputValue.GetText()
- def GetType(self):
- return int(self.type)
- class InputDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/inputdialog.py")
- getObject = self.GetChild
- self.board = getObject("Board")
- self.acceptButton = getObject("AcceptButton")
- self.cancelButton = getObject("CancelButton")
- self.inputSlot = getObject("InputSlot")
- self.inputValue = getObject("InputValue")
- def Open(self):
- self.inputValue.SetFocus()
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- def Close(self):
- self.ClearDictionary()
- self.board = None
- self.acceptButton = None
- self.cancelButton = None
- self.inputSlot = None
- self.inputValue = None
- self.Hide()
- def SetTitle(self, name):
- self.board.SetTitleName(name)
- def SetNumberMode(self):
- self.inputValue.SetNumberMode()
- def SetSecretMode(self):
- self.inputValue.SetSecret()
- def SetFocus(self):
- self.inputValue.SetFocus()
- def SetMaxLength(self, length):
- width = length * 6 + 10
- self.SetBoardWidth(max(width + 50, 160))
- self.SetSlotWidth(width)
- self.inputValue.SetMax(length)
- def SetSlotWidth(self, width):
- self.inputSlot.SetSize(width, self.inputSlot.GetHeight())
- self.inputValue.SetSize(width, self.inputValue.GetHeight())
- if self.IsRTL():
- self.inputValue.SetPosition(self.inputValue.GetWidth(), 0)
- def SetBoardWidth(self, width):
- self.SetSize(max(width + 50, 160), self.GetHeight())
- self.board.SetSize(max(width + 50, 160), self.GetHeight())
- if self.IsRTL():
- self.board.SetPosition(self.board.GetWidth(), 0)
- self.UpdateRect()
- def SetAcceptEvent(self, event):
- self.acceptButton.SetEvent(event)
- self.inputValue.OnIMEReturn = event
- def SetCancelEvent(self, event):
- self.board.SetCloseEvent(event)
- self.cancelButton.SetEvent(event)
- self.inputValue.OnPressEscapeKey = event
- def GetText(self):
- return self.inputValue.GetText()
- class InputDialogWithDescription(InputDialog):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- def __del__(self):
- InputDialog.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- if localeInfo.IsARABIC() :
- pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "inputdialogwithdescription.py")
- else:
- pyScrLoader.LoadScriptFile(self, "uiscript/inputdialogwithdescription.py")
- try:
- getObject = self.GetChild
- self.board = getObject("Board")
- self.acceptButton = getObject("AcceptButton")
- self.cancelButton = getObject("CancelButton")
- self.inputSlot = getObject("InputSlot")
- self.inputValue = getObject("InputValue")
- self.description = getObject("Description")
- except:
- import exception
- exception.Abort("InputDialogWithDescription.LoadBoardDialog.BindObject")
- def SetDescription(self, text):
- self.description.SetText(text)
- class InputDialogWithDescription2(InputDialog):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- def __del__(self):
- InputDialog.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/inputdialogwithdescription2.py")
- try:
- getObject = self.GetChild
- self.board = getObject("Board")
- self.acceptButton = getObject("AcceptButton")
- self.cancelButton = getObject("CancelButton")
- self.inputSlot = getObject("InputSlot")
- self.inputValue = getObject("InputValue")
- self.description1 = getObject("Description1")
- self.description2 = getObject("Description2")
- except:
- import exception
- exception.Abort("InputDialogWithDescription.LoadBoardDialog.BindObject")
- def SetDescription1(self, text):
- self.description1.SetText(text)
- def SetDescription2(self, text):
- self.description2.SetText(text)
- class QuestionDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog.py")
- self.board = self.GetChild("board")
- self.textLine = self.GetChild("message")
- self.acceptButton = self.GetChild("accept")
- self.cancelButton = self.GetChild("cancel")
- def Open(self):
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- def Close(self):
- self.Hide()
- def SetWidth(self, width):
- height = self.GetHeight()
- self.SetSize(width, height)
- self.board.SetSize(width, height)
- self.SetCenterPosition()
- self.UpdateRect()
- def SAFE_SetAcceptEvent(self, event):
- self.acceptButton.SAFE_SetEvent(event)
- def SAFE_SetCancelEvent(self, event):
- self.cancelButton.SAFE_SetEvent(event)
- def SetAcceptEvent(self, event):
- self.acceptButton.SetEvent(event)
- def SetCancelEvent(self, event):
- self.cancelButton.SetEvent(event)
- def SetText(self, text):
- self.textLine.SetText(text)
- def SetAcceptText(self, text):
- self.acceptButton.SetText(text)
- def SetCancelText(self, text):
- self.cancelButton.SetText(text)
- def OnPressEscapeKey(self):
- self.Close()
- return TRUE
- class QuestionDialogItem(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/questiondialogitem.py")
- self.board = self.GetChild("board")
- self.textLine = self.GetChild("message")
- self.acceptButton = self.GetChild("accept")
- self.destroyButton = self.GetChild("destroy")
- self.cancelButton = self.GetChild("cancel")
- def Open(self):
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- def Close(self):
- self.Hide()
- def SetWidth(self, width):
- height = self.GetHeight()
- self.SetSize(width, height)
- self.board.SetSize(width, height)
- self.SetCenterPosition()
- self.UpdateRect()
- def SAFE_SetAcceptEvent(self, event):
- self.acceptButton.SAFE_SetEvent(event)
- def SAFE_SetCancelEvent(self, event):
- self.cancelButton.SAFE_SetEvent(event)
- def SetAcceptEvent(self, event):
- self.acceptButton.SetEvent(event)
- def SetDestroyEvent(self, event):
- self.destroyButton.SetEvent(event)
- def SetCancelEvent(self, event):
- self.cancelButton.SetEvent(event)
- def SetText(self, text):
- self.textLine.SetText(text)
- def SetAcceptText(self, text):
- self.acceptButton.SetText(text)
- def SetCancelText(self, text):
- self.cancelButton.SetText(text)
- def OnPressEscapeKey(self):
- self.Close()
- return TRUE
- class QuestionDialog2(QuestionDialog):
- def __init__(self):
- QuestionDialog.__init__(self)
- self.__CreateDialog()
- def __del__(self):
- QuestionDialog.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
- self.board = self.GetChild("board")
- self.textLine1 = self.GetChild("message1")
- self.textLine2 = self.GetChild("message2")
- self.acceptButton = self.GetChild("accept")
- self.cancelButton = self.GetChild("cancel")
- def SetText1(self, text):
- self.textLine1.SetText(text)
- def SetText2(self, text):
- self.textLine2.SetText(text)
- class QuestionDialogWithTimeLimit(QuestionDialog2):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__CreateDialog()
- self.endTime = 0
- def __del__(self):
- QuestionDialog2.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
- self.board = self.GetChild("board")
- self.textLine1 = self.GetChild("message1")
- self.textLine2 = self.GetChild("message2")
- self.acceptButton = self.GetChild("accept")
- self.cancelButton = self.GetChild("cancel")
- def Open(self, msg, timeout):
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- self.SetText1(msg)
- self.endTime = app.GetTime() + timeout
- def OnUpdate(self):
- leftTime = max(0, self.endTime - app.GetTime())
- self.SetText2(localeInfo.UI_LEFT_TIME % (leftTime))
- class MoneyInputDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.moneyHeaderText = localeInfo.MONEY_INPUT_DIALOG_SELLPRICE
- self.__CreateDialog()
- self.SetMaxLength(13)
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __CreateDialog(self):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "uiscript/moneyinputdialog.py")
- getObject = self.GetChild
- self.board = self.GetChild("board")
- self.acceptButton = getObject("AcceptButton")
- self.cancelButton = getObject("CancelButton")
- self.inputValue = getObject("InputValue")
- self.inputValue.SetNumberMode()
- self.inputValue.OnIMEUpdate = ui.__mem_func__(self.__OnValueUpdate)
- self.moneyText = getObject("MoneyValue")
- def Open(self):
- self.inputValue.SetText("")
- self.inputValue.SetFocus()
- self.__OnValueUpdate()
- self.SetCenterPosition()
- self.SetTop()
- self.Show()
- def Close(self):
- self.ClearDictionary()
- self.board = None
- self.acceptButton = None
- self.cancelButton = None
- self.inputValue = None
- self.Hide()
- def SetTitle(self, name):
- self.board.SetTitleName(name)
- def SetFocus(self):
- self.inputValue.SetFocus()
- def SetMaxLength(self, length):
- length = min(13, length)
- self.inputValue.SetMax(length)
- def SetMoneyHeaderText(self, text):
- self.moneyHeaderText = text
- def SetAcceptEvent(self, event):
- self.acceptButton.SetEvent(event)
- self.inputValue.OnIMEReturn = event
- def SetCancelEvent(self, event):
- self.board.SetCloseEvent(event)
- self.cancelButton.SetEvent(event)
- self.inputValue.OnPressEscapeKey = event
- def SetValue(self, value):
- value=str(value)
- self.inputValue.SetText(value)
- self.__OnValueUpdate()
- ime.SetCursorPosition(len(value))
- def GetText(self):
- return self.inputValue.GetText()
- def __OnValueUpdate(self):
- ui.EditLine.OnIMEUpdate(self.inputValue)
- text = self.inputValue.GetText()
- money = 0
- if text and text.isdigit():
- try:
- money = long(text)
- except ValueError:
- money = 199999999
- self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))
interfacemodule.py
Code
- ##
- ## Interface
- ##
- import constInfo
- import systemSetting
- import wndMgr
- import chat
- import app
- import player
- import uiTaskBar
- import uiCharacter
- import uiInventory
- import uiDragonSoul
- import uiChat
- import uiMessenger
- import uiguildstorage
- import guild
- import ui
- import uiHelp
- 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 uiGameButton
- import uiTip
- import uiCube
- import uiCards
- import miniMap
- # ACCESSORY_REFINE_ADD_METIN_STONE
- import uiSelectItem
- # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
- import uiScriptLocale
- import event
- import localeInfo
- if app.ENABLE_MELEY_LAIR_DUNGEON:
- import uidragonlairranking
- if app.ENABLE_SASH_SYSTEM:
- import uisash
- IsQBHide = 0
- class Interface(object):
- CHARACTER_STATUS_TAB = 1
- CHARACTER_SKILL_TAB = 2
- def __init__(self):
- systemSetting.SetInterfaceHandler(self)
- self.windowOpenPosition = 0
- self.dlgWhisperWithoutTarget = None
- self.inputDialog = None
- self.tipBoard = None
- self.bigBoard = None
- # ITEM_MALL
- self.mallPageDlg = None
- # END_OF_ITEM_MALL
- self.wndWeb = None
- self.wndTaskBar = None
- self.wndCharacter = None
- self.wndInventory = None
- self.wndExpandedTaskBar = None
- self.wndDragonSoul = None
- self.wndDragonSoulRefine = None
- self.wndChat = None
- self.wndMessenger = None
- self.wndMiniMap = None
- self.wndGuild = None
- self.wndGuildBuilding = None
- self.listGMName = {}
- self.wndQuestWindow = []
- self.privateShopAdvertisementBoardDict = {}
- self.guildScoreBoardDict = {}
- self.equipmentDialogDict = {}
- event.SetInterfaceWindow(self)
- def __del__(self):
- systemSetting.DestroyInterfaceHandler()
- event.SetInterfaceWindow(None)
- ################################
- ## 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))
- 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_DRAGON_SOUL, ui.__mem_func__(self.ToggleDragonSoulWindow))
- #self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_PET_GUI, ui.__mem_func__(self.TogglePetMain))
- else:
- self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHAT, ui.__mem_func__(self.ToggleChat))
- 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
- 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))
- self.wndGameButton = wndGameButton
- def __IsChatOpen(self):
- return TRUE
- def __MakeWindows(self):
- wndCharacter = uiCharacter.CharacterWindow()
- wndInventory = uiInventory.InventoryWindow()
- wndInventory.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()
- # ITEM_MALL
- wndMall = uiSafebox.MallWindow()
- self.wndMall = wndMall
- # END_OF_ITEM_MALL
- wndChatLog = uiChat.ChatLogWindow()
- wndChatLog.BindInterface(self)
- self.wndCharacter = wndCharacter
- self.wndInventory = wndInventory
- 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)
- def __MakeDialogs(self):
- self.dlgExchange = uiExchange.ExchangeDialog()
- self.GuildStorageWindow = uiguildstorage.GuildStorage()
- self.dlgExchange.LoadDialog()
- self.dlgExchange.SetCenterPosition()
- self.dlgExchange.Hide()
- self.dlgPointReset = uiPointReset.PointResetDialog()
- self.dlgPointReset.LoadDialog()
- self.dlgPointReset.Hide()
- self.dlgShop = uiShop.ShopDialog()
- self.dlgShop.LoadDialog()
- self.dlgShop.Hide()
- self.dlgRestart = uiRestart.RestartDialog()
- self.dlgRestart.LoadDialog()
- self.dlgRestart.Hide()
- self.dlgSystem = uiSystem.SystemDialog()
- 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()
- self.dlgRefineNew = uiRefine.RefineDialogNew()
- 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.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()
- 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()
- def __MakeCardsIconWindow(self):
- self.wndCardsIcon = uiCards.IngameWindow()
- self.wndCardsIcon.LoadWindow()
- self.wndCardsIcon.Hide()
- # ACCESSORY_REFINE_ADD_METIN_STONE
- def __MakeItemSelectWindow(self):
- self.wndItemSelect = uiSelectItem.SelectItemWindow()
- self.wndItemSelect.Hide()
- # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
- def MakeInterface(self):
- self.__MakeMessengerWindow()
- self.__MakeGuildWindow()
- self.__MakeChatWindow()
- self.__MakeParty()
- self.__MakeWindows()
- self.__MakeDialogs()
- self.__MakeUICurtain()
- self.__MakeTaskBar()
- self.__MakeGameButtonWindow()
- self.__MakeHelpWindow()
- self.__MakeTipBoard()
- self.__MakeWebWindow()
- if app.ENABLE_MELEY_LAIR_DUNGEON:
- self.__MakeMeleyRanking()
- if app.ENABLE_SASH_SYSTEM:
- self.__MakeSashWindow()
- self.__MakeCubeWindow()
- self.__MakeCubeResultWindow()
- self.__MakeCardsInfoWindow()
- self.__MakeCardsWindow()
- self.__MakeCardsIconWindow()
- # 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.ENABLE_DRAGON_SOUL_SYSTEM:
- self.wndDragonSoul.SetItemToolTip(self.tooltipItem)
- self.wndDragonSoulRefine.SetItemToolTip(self.tooltipItem)
- self.wndSafebox.SetItemToolTip(self.tooltipItem)
- if app.ENABLE_SASH_SYSTEM:
- self.wndSashCombine.SetItemToolTip(self.tooltipItem)
- self.wndSashAbsorption.SetItemToolTip(self.tooltipItem)
- self.wndCube.SetItemToolTip(self.tooltipItem)
- self.wndCubeResult.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)
- self.wndGuild.SetSkillToolTip(self.tooltipSkill)
- # ACCESSORY_REFINE_ADD_METIN_STONE
- self.wndItemSelect.SetItemToolTip(self.tooltipItem)
- # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
- self.dlgShop.SetItemToolTip(self.tooltipItem)
- self.dlgExchange.SetItemToolTip(self.tooltipItem)
- self.privateShopBuilder.SetItemToolTip(self.tooltipItem)
- self.__InitWhisper()
- self.DRAGON_SOUL_IS_QUALIFIED = TRUE
- def MakeHyperlinkTooltip(self, hyperlink):
- tokens = hyperlink.split(":")
- if tokens and len(tokens):
- type = tokens[0]
- if "item" == type:
- self.hyperlinkItemTooltip.SetHyperlinkItem(tokens)
- ## Make Windows & Dialogs
- ################################
- 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 eachQuestWindow in self.wndQuestWindow:
- eachQuestWindow.nextCurtainMode = -1
- eachQuestWindow.CloseSelf()
- eachQuestWindow = None
- if self.wndChat:
- self.wndChat.Destroy()
- if self.wndTaskBar:
- self.wndTaskBar.Destroy()
- if self.wndExpandedTaskBar:
- self.wndExpandedTaskBar.Destroy()
- if self.wndEnergyBar:
- self.wndEnergyBar.Destroy()
- if self.wndCharacter:
- self.wndCharacter.Destroy()
- if self.wndInventory:
- self.wndInventory.Destroy()
- if self.wndDragonSoul:
- self.wndDragonSoul.Destroy()
- if self.wndDragonSoulRefine:
- self.wndDragonSoulRefine.Destroy()
- if self.dlgExchange:
- self.dlgExchange.Destroy()
- if self.dlgPointReset:
- self.dlgPointReset.Destroy()
- 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.wndMiniMap:
- self.wndMiniMap.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 self.wndCardsInfo:
- self.wndCardsInfo.Destroy()
- if self.wndCards:
- self.wndCards.Destroy()
- if self.wndCardsIcon:
- self.wndCardsIcon.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 self.wndCube:
- self.wndCube.Destroy()
- if self.wndCubeResult:
- self.wndCubeResult.Destroy()
- if self.wndMessenger:
- self.wndMessenger.Destroy()
- if self.wndGuild:
- self.wndGuild.Destroy()
- if self.GuildStorageWindow:
- self.GuildStorageWindow.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
- # ACCESSORY_REFINE_ADD_METIN_STONE
- if self.wndItemSelect:
- self.wndItemSelect.Destroy()
- # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
- 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.GuildStorageWindow
- del self.wndMessenger
- del self.wndUICurtain
- del self.wndChat
- del self.wndTaskBar
- if self.wndExpandedTaskBar:
- del self.wndExpandedTaskBar
- del self.wndEnergyBar
- del self.wndCharacter
- del self.wndInventory
- if self.wndDragonSoul:
- del self.wndDragonSoul
- if self.wndDragonSoulRefine:
- del self.wndDragonSoulRefine
- 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.wndMiniMap
- del self.wndSafebox
- del self.wndMall
- del self.wndParty
- del self.wndHelp
- del self.wndCardsInfo
- del self.wndCards
- del self.wndCardsIcon
- if app.ENABLE_MELEY_LAIR_DUNGEON:
- del self.wndMeleyRanking
- if app.ENABLE_SASH_SYSTEM:
- del self.wndSashCombine
- del self.wndSashAbsorption
- del self.wndCube
- del self.wndCubeResult
- 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
- self.questButtonList = []
- self.whisperButtonList = []
- self.whisperDialogDict = {}
- self.privateShopAdvertisementBoardDict = {}
- self.guildScoreBoardDict = {}
- self.equipmentDialogDict = {}
- uiChat.DestroyChatInputSetWindow()
- ## 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)
- self.wndGuild.OnUseSkill(slotIndex, coolTime)
- def OnActivateSkill(self, slotIndex):
- self.wndCharacter.OnActivateSkill(slotIndex)
- self.wndTaskBar.OnActivateSkill(slotIndex)
- def OnDeactivateSkill(self, slotIndex):
- self.wndCharacter.OnDeactivateSkill(slotIndex)
- self.wndTaskBar.OnDeactivateSkill(slotIndex)
- def OnChangeCurrentSkill(self, skillSlotNumber):
- self.wndTaskBar.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 self.wndEnergyBar:
- self.wndEnergyBar.RefreshStatus()
- if app.ENABLE_DRAGON_SOUL_SYSTEM:
- self.wndDragonSoul.RefreshStatus()
- def RefreshStamina(self):
- self.wndTaskBar.RefreshStamina()
- def RefreshSkill(self):
- self.wndCharacter.RefreshSkill()
- self.wndTaskBar.RefreshSkill()
- def RefreshInventory(self):
- self.wndTaskBar.RefreshQuickSlot()
- self.wndInventory.RefreshItemSlot()
- if app.ENABLE_DRAGON_SOUL_SYSTEM:
- self.wndDragonSoul.RefreshItemSlot()
- def RefreshCharacter(self): ## Character ÆäÀÌÁöÀÇ ¾ó±¼, Inventory ÆäÀÌÁöÀÇ Àü½Å ±×¸² µîÀÇ Refresh
- self.wndCharacter.RefreshCharacter()
- 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
- def OpenShopDialog(self, vid):
- 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()
- ## Quest
- def OpenCharacterWindowQuestPage(self):
- self.wndCharacter.Show()
- self.wndCharacter.SetState("QUEST")
- def OpenQuestWindow(self, skin, idx):
- 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 s = self, qw = q: s.__dict__.__getitem__("wndQuestWindow").remove(qw))
- # UNKNOWN_UPDATE
- self.wndQuestWindow.append(q)
- # END_OF_UNKNOWN_UPDATE
- 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()
- ## 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 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):
- 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()
- self.wndMiniMap.Show()
- self.wndMiniMap.ShowMiniMap()
- if self.wndEnergyBar:
- self.wndEnergyBar.Show()
- def ShowAllWindows(self):
- self.wndTaskBar.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()
- def HideAllWindows(self):
- if self.wndTaskBar:
- self.wndTaskBar.Hide()
- if self.wndEnergyBar:
- self.wndEnergyBar.Hide()
- if self.wndCharacter:
- self.wndCharacter.Hide()
- if self.wndInventory:
- self.wndInventory.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()
- def ShowMouseImage(self):
- self.wndTaskBar.ShowMouseImage()
- def HideMouseImage(self):
- self.wndTaskBar.HideMouseImage()
- def ToggleChat(self):
- 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 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 self.wndMessenger.IsShow():
- self.wndMessenger.Hide()
- else:
- self.wndMessenger.SetTop()
- self.wndMessenger.Show()
- def ToggleMiniMap(self):
- 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 FALSE == player.IsObserverMode():
- if FALSE == self.wndCharacter.IsShow():
- self.OpenCharacterWindowWithState(state)
- else:
- if state == self.wndCharacter.GetState():
- self.wndCharacter.OverOutItem()
- self.wndCharacter.Hide()
- else:
- self.wndCharacter.SetState(state)
- def OpenCharacterWindowWithState(self, state):
- if FALSE == player.IsObserverMode():
- self.wndCharacter.SetState(state)
- self.wndCharacter.Show()
- self.wndCharacter.SetTop()
- def ToggleCharacterWindowStatusPage(self):
- self.ToggleCharacterWindow("STATUS")
- def ToggleInventoryWindow(self):
- if FALSE == player.IsObserverMode():
- if FALSE == self.wndInventory.IsShow():
- self.wndInventory.Show()
- self.wndInventory.SetTop()
- else:
- self.wndInventory.OverOutItem()
- self.wndInventory.Close()
- def TogglePetMain(self):
- if FALSE == player.IsObserverMode():
- if FALSE == self.wndExpandedTaskBar.IsShow():
- self.wndExpandedTaskBar.Show()
- self.wndExpandedTaskBar.SetTop()
- else:
- self.wndExpandedTaskBar.Close()
- net.SendChatPacket("/gift")
- def ToggleExpandedButton(self):
- if FALSE == player.IsObserverMode():
- if FALSE == self.wndExpandedTaskBar.IsShow():
- self.wndExpandedTaskBar.Show()
- self.wndExpandedTaskBar.SetTop()
- else:
- self.wndExpandedTaskBar.Close()
- # ¿ëÈ¥¼®
- 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 Highligt_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)
- def DragonSoulGiveQuilification(self):
- self.DRAGON_SOUL_IS_QUALIFIED = TRUE
- 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 ToggleGuildWindow(self):
- 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 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):
- player.SetPlayTime(1)
- self.CheckGameButton()
- self.OpenHelpWindow()
- def __OnClickBuildButton(self):
- self.BUILD_OpenWindow()
- def OpenHelpWindow(self):
- 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()
- def OpenCardsInfoWindow(self):
- 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)
- def CardsShowIcon(self):
- self.wndCardsIcon.Show()
- 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 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()
- 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,
- 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 __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)
- # ACCESSORY_REFINE_ADD_METIN_STONE
- def BINARY_OpenSelectItemWindow(self):
- self.wndItemSelect.Open()
- # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
- #####################################################################################
- ### Private Shop ###
- def OpenPrivateShopInputNameDialog(self):
- #if player.IsInSafeArea():
- # chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_OPEN_PRIVATE_SHOP_IN_SAFE_AREA)
- # return
- inputDialog = uiCommon.InputDialogShop()
- inputDialog.SetTitle(localeInfo.CHOIX_DES_SKIN)
- 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.Close()
- 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.inputDialog.GetType())
- 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)
- #####################################################################################
- ### Equipment ###
- def OpenEquipmentDialog(self, 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
- 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()
- # QUEST_LETTER_IMAGE
- ##!! 20061026.levites.Äù½ºÆ®_À̹ÌÁö_±³Ã¼
- import item
- if "item"==iconType:
- item.SelectItem(int(iconName))
- buttonImageFileName=item.GetIconImageFileName()
- else:
- buttonImageFileName=iconName
- if localeInfo.IsEUROPE():
- if "highlight" == iconType:
- btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga")
- btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga")
- btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga")
- else:
- btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
- btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
- btn.SetDownVisual(localeInfo.GetLetterOpenImageName())
- else:
- btn.SetUpVisual(buttonImageFileName)
- btn.SetOverVisual(buttonImageFileName)
- btn.SetDownVisual(buttonImageFileName)
- btn.Flash()
- # 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()
- #chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.QUEST_APPEND)
- def __ArrangeQuestButton(self):
- screenWidth = wndMgr.GetScreenWidth()
- screenHeight = wndMgr.GetScreenHeight()
- ##!! 20061026.levites.Äù½ºÆ®_À§Ä¡_º¸Á¤
- 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):
- for btn in self.questButtonList:
- btn.Show()
- #####################################################################################
- #####################################################################################
- ### Whisper ###
- def __InitWhisper(self):
- chat.InitWhisper(self)
- ## äÆÃâÀÇ "¸Þ½ÃÁö º¸³»±â"¸¦ ´·¶À»¶§ À̸§ ¾ø´Â ´ëÈâÀ» ¿©´Â ÇÔ¼ö
- ## À̸§ÀÌ ¾ø±â ¶§¹®¿¡ ±âÁ¸ÀÇ WhisperDialogDict ¿Í º°µµ·Î °ü¸®µÈ´Ù.
- 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)
- ## À̸§ ¾ø´Â ´ëÈâ¿¡¼ À̸§À» °áÁ¤ÇßÀ»¶§ WhisperDialogDict¿¡ âÀ» ³Ö¾îÁÖ´Â ÇÔ¼ö
- 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)
- ## ij¸¯ÅÍ ¸Þ´ºÀÇ 1:1 ´ëÈ Çϱ⸦ ´·¶À»¶§ À̸§À» °¡Áö°í ¹Ù·Î âÀ» ¿©´Â ÇÔ¼ö
- 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)
- ## ´Ù¸¥ ij¸¯ÅͷκÎÅÍ ¸Þ¼¼Áö¸¦ ¹Þ¾ÒÀ»¶§ ÀÏ´Ü ¹öÆ°¸¸ ¶ç¿ö µÎ´Â ÇÔ¼ö
- 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)
- ## ¹öÆ°À» ´·¶À»¶§ âÀ» ¿©´Â ÇÔ¼ö
- 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")
- ## ¹öÆ° ÃʱâÈ
- self.__DestroyWhisperButton(btn)
- ## WhisperDialog â¿¡¼ ÃÖ¼ÒÈ ¸í·ÉÀ» ¼öÇàÇßÀ»¶§ È£ÃâµÇ´Â ÇÔ¼ö
- ## âÀ» ÃÖ¼ÒÈ ÇÕ´Ï´Ù.
- def MinimizeWhisperDialog(self, name):
- if 0 != name:
- self.__MakeWhisperButton(name)
- self.CloseWhisperDialog(name)
- ## WhisperDialog â¿¡¼ ´Ý±â ¸í·ÉÀ» ¼öÇàÇßÀ»¶§ È£ÃâµÇ´Â ÇÔ¼ö
- ## âÀ» Áö¿ó´Ï´Ù.
- 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
- ## À̸§À¸·Î Whisper ¹öÆ°À» ã¾Æ ¸®ÅÏÇØ ÁÖ´Â ÇÔ¼ö
- ## ¹öÆ°Àº µñ¼Å³Ê¸®·Î ÇÏÁö ¾Ê´Â °ÍÀº Á¤·Ä µÇ¾î ¹ö·Á ¼ø¼°¡ À¯Áö µÇÁö ¾ÊÀ¸¸ç
- ## ÀÌ·Î ÀÎÇØ ToolTipµéÀÌ ´Ù¸¥ ¹öÆ°µé¿¡ ÀÇÇØ °¡·ÁÁö±â ¶§¹®ÀÌ´Ù.
- 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
- ## ¹öÆ°À» ¸¸µì´Ï´Ù.
- 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
- #####################################################################################
- #####################################################################################
- ### Guild Building ###
- 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
- 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()