def __Load(self): self.popupDialog = PopupDialog(self) try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/MarkListWindow.py") except: import exception exception.Abort("SymbolListBox.__Load") try: self.symbolListBox = self.__CreateSymbolListBox() self.symbolListBox.SetScrollBar(self.GetChild("ScrollBar")) self.popupText = self.popupDialog.GetChild("message") self.popupDialog.GetChild("accept").SetEvent( ui.__mem_func__(self.popupDialog.Hide)) self.board = self.GetChild("board") self.okButton = self.GetChild("ok") self.cancelButton = self.GetChild("cancel") self.refreshButton = self.GetChild("refresh") except: import exception exception.Abort("SymbolListBox.__Bind") self.refreshButton.SetEvent(ui.__mem_func__(self.__OnRefresh)) self.cancelButton.SetEvent(ui.__mem_func__(self.__OnCancel)) self.okButton.SetEvent(ui.__mem_func__(self.__OnOK)) self.board.SetCloseEvent(ui.__mem_func__(self.__OnCancel)) self.board.SetTitleName(locale.SYMBOLLIST_TITLE) self.UpdateRect() self.__RefreshFileList()
def __LoadScript(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/refinedialog.py") except: import exception exception.Abort("RefineDialog.__LoadScript.LoadObject") try: self.board = self.GetChild("Board") self.titleBar = self.GetChild("TitleBar") self.probText = self.GetChild("SuccessPercentage") self.costText = self.GetChild("Cost") self.successPercentage = self.GetChild("SuccessPercentage") self.GetChild("AcceptButton").SetEvent(self.OpenQuestionDialog) self.GetChild("CancelButton").SetEvent(self.CancelRefine) except: import exception exception.Abort("RefineDialog.__LoadScript.BindObject") ## 936 : °³·® È®·ü Ç¥½Ã ¾ÈÇÔ ##if 936 == app.GetDefaultCodePage(): self.successPercentage.Show() toolTip = uiToolTip.ItemToolTip() toolTip.SetParent(self) toolTip.SetFollow(False) # toolTip.SetPosition(15, 38) toolTip.SetPosition(28, 38) toolTip.Show() self.toolTip = toolTip self.slotList = [] for i in xrange(3): slot = self.__MakeSlot() slot.SetParent(toolTip) slot.SetWindowVerticalAlignCenter() self.slotList.append(slot) itemImage = self.__MakeItemImage() itemImage.SetParent(toolTip) itemImage.SetWindowVerticalAlignCenter() itemImage.SetPosition(-38, 0) self.itemImage = itemImage self.titleBar.SetCloseEvent(ui.__mem_func__(self.CancelRefine)) if app.ENABLE_REFINE_RENEWAL: self.checkBox = ui.CheckBox() self.checkBox.SetParent(self) self.checkBox.SetPosition(0, 90) self.checkBox.SetWindowHorizontalAlignCenter() self.checkBox.SetWindowVerticalAlignBottom() self.checkBox.SetEvent(ui.__mem_func__(self.AutoRefine), "ON_CHECK", True) self.checkBox.SetEvent(ui.__mem_func__(self.AutoRefine), "ON_UNCKECK", False) self.checkBox.SetCheckStatus(constInfo.IS_AUTO_REFINE) self.checkBox.SetTextInfo("Fenster geöffnet lassen") self.checkBox.Show() self.isLoaded = True
def __LoadQuestionDialog(self, fileName): self.dlgQuestion = ui.ScriptWindow() try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self.dlgQuestion, fileName) except: import exception exception.Abort( "SelectCharacterWindow.LoadQuestionDialog.LoadScript") try: GetObject = self.dlgQuestion.GetChild self.dlgQuestionText = GetObject("message") self.dlgQuestionAcceptButton = GetObject("accept") self.dlgQuestionCancelButton = GetObject("cancel") except: import exception exception.Abort( "SelectCharacterWindow.LoadQuestionDialog.BindObject") self.dlgQuestionText.SetText(localeInfo.SELECT_DO_YOU_DELETE_REALLY) self.dlgQuestionAcceptButton.SetEvent( ui.__mem_func__(self.RequestDeleteCharacter)) self.dlgQuestionCancelButton.SetEvent( ui.__mem_func__(self.dlgQuestion.Hide)) return 1
def MakeButton(self, index, parent, x, y): self.tab[index] = ui.MakeButton(parent, x, y, False, "d:/ymir work/battle_pass/", "tab_normal.tga", "tab_select.tga", "tab_normal.tga") self.gauge[index] = ui.MakeGauge(self.tab[index], 41, 23, 130) self.gauge_f = ui.MakeGauge(parent, 326, 235, 92) self.text[index] = ui.TextLine() self.text[index].SetParent(self.tab[index]) self.text[index].SetPosition(50, 8) self.text[index].SetText(str(constInfo.info_missions_bp[int(index)]["Name"])) self.text[index].Show() self.reward1[index] = ui.MakeGridSlot(self.tab[index], 180+7, 2+4, self.Get3(index, "iVnum1"), self.Get3(index, "iCount1")) self.reward1[index].SetOverInItemEvent(lambda slotindex = 0, ivnumz = index: self.OverInItem(slotindex, ivnumz, "iVnum1")) self.reward1[index].SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.reward2[index] = ui.MakeGridSlot(self.tab[index], 180+32+7, 2+4, self.Get3(index, "iVnum2"), self.Get3(index, "iCount2")) self.reward2[index].SetOverInItemEvent(lambda slotindex = 0, ivnumz = index: self.OverInItem(slotindex, ivnumz, "iVnum2")) self.reward2[index].SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.reward3[index] = ui.MakeGridSlot(self.tab[index], 217+28+7, 2+4, self.Get3(index, "iVnum3"), self.Get3(index, "iCount3")) self.reward3[index].SetOverInItemEvent(lambda slotindex = 0, ivnumz = index: self.OverInItem(slotindex, ivnumz, "iVnum3")) self.reward3[index].SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.icon[index] = ui.MakeImageBoxNoImg(self.tab[index], 1, 2) if self.Get(index, "iType") == 1: # Category: Use Items item.SelectItem(self.Get(index, "iVnum")) self.icon[index].LoadImage(item.GetIconImageFileName()) if self.Get(index, "iType") > 2: self.icon[index].LoadImage(self.Type_Images[self.Get(index, "iType")])
def RefreshLabel(self): self.ScollPos = int(self.ScrollBar.GetPos() * self.Diff) self.LabelLineCount = 0 self.startline_endlinecount = 0 for i in xrange(self.UI_MAX_COUNT): idx = i + self.ScollPos if idx < len(self.InfoList): text = self.InfoList[idx][self.INFO_TEXT] type = self.InfoList[idx][self.INFO_VALUE] if type == self.CATEGORY_STARTLINE: self.__LabelTitleLine(i + self.LabelLineCount, text) self.startline_endlinecount += 1 elif type == self.CATEGORY_ENDLINE: self.__EmptyLine(i + self.LabelLineCount) self.startline_endlinecount += 1 else: value = player.GetStatus(type) self.__LabelLine(i + self.LabelLineCount, text, value) if i + self.LabelLineCount < self.UI_MAX_COUNT: self.labelTextList[i + self.LabelLineCount].SetOverEvent( ui.__mem_func__( self.__ButtonOverIn), self.LabelLineCount + self.startline_endlinecount) self.labelTextList[ i + self.LabelLineCount].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), self.LabelLineCount + self.startline_endlinecount) self.LabelLineCount += 1 else: self.__EmptyLine(i + self.LabelLineCount)
def LoadWindow(self): try: PythonScriptLoader = ui.PythonScriptLoader() PythonScriptLoader.LoadScriptFile(self, "UIScript/selectitemwindow.py") except: import exception exception.Abort("ItemSelectWindow.LoadDialog.LoadObject") try: GetObject = self.GetChild self.board = GetObject("board") self.titleBar = GetObject("TitleBar") self.itemSlot = GetObject("ItemSlot") self.btnExit = GetObject("ExitButton") except: import exception exception.Abort("ItemSelectWindow.LoadDialog.BindObject") self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close)) self.btnExit.SetEvent(ui.__mem_func__(self.Close)) self.itemSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) self.itemSlot.SAFE_SetButtonEvent("LEFT", "EXIST", self.SelectItemSlot) self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
def LoadDialog(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/OfflineShopDialog.py") except: import exception exception.Abort("OfflineShopDialog.LoadDialog.LoadObject") try: self.itemSlotWindow = self.GetChild("ItemSlot") self.btnBuy = self.GetChild("BuyButton") self.titleBar = self.GetChild("TitleBar") self.titleName = self.GetChild("TitleName") except: import exception exception.Abort("OfflineShopDialog.LoadDialog.BindObject") self.itemSlotWindow.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) self.itemSlotWindow.SAFE_SetButtonEvent("LEFT", "EXIST", self.SelectItemSlot) self.itemSlotWindow.SAFE_SetButtonEvent("RIGHT", "EXIST", self.UnselectItemSlot) self.itemSlotWindow.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.itemSlotWindow.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.btnBuy.SetToggleUpEvent(ui.__mem_func__(self.CancelShopping)) self.btnBuy.SetToggleDownEvent(ui.__mem_func__(self.OnBuy)) self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
def __LoadScript(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/attachstonedialog.py") except: import exception exception.Abort("AttachStoneDialog.__LoadScript.LoadObject") try: self.board = self.GetChild("Board") self.titleBar = self.GetChild("TitleBar") self.metinImage = self.GetChild("MetinImage") self.GetChild("AcceptButton").SetEvent(ui.__mem_func__(self.Accept)) self.GetChild("CancelButton").SetEvent(ui.__mem_func__(self.Close)) except: import exception exception.Abort("AttachStoneDialog.__LoadScript.BindObject") oldToolTip = uiToolTip.ItemToolTip() oldToolTip.SetParent(self) oldToolTip.SetPosition(15, 38) oldToolTip.SetFollow(FALSE) oldToolTip.Show() self.oldToolTip = oldToolTip newToolTip = uiToolTip.ItemToolTip() newToolTip.SetParent(self) newToolTip.SetPosition(230 + 20, 38) newToolTip.SetFollow(FALSE) newToolTip.Show() self.newToolTip = newToolTip self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
def LoadDialog(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/changepassworddialog.py") except: import exception exception.Abort("ChangePasswordDialog.LoadDialog.LoadObject") try: self.GetChild("accept_button").SetEvent(ui.__mem_func__(self.OnAccept)) self.GetChild("cancel_button").SetEvent(ui.__mem_func__(self.OnCancel)) self.GetChild("titlebar").SetCloseEvent(ui.__mem_func__(self.OnCancel)) oldPassword = self.GetChild("old_password_value") newPassword = self.GetChild("new_password_value") newPasswordCheck = self.GetChild("new_password_check_value") except: import exception exception.Abort("ChangePasswordDialog.LoadDialog.BindObject") oldPassword.SetTabEvent(lambda arg=1: self.OnNextFocus(arg)) newPassword.SetTabEvent(lambda arg=2: self.OnNextFocus(arg)) newPasswordCheck.SetTabEvent(lambda arg=3: self.OnNextFocus(arg)) oldPassword.SetReturnEvent(lambda arg=1: self.OnNextFocus(arg)) newPassword.SetReturnEvent(lambda arg=2: self.OnNextFocus(arg)) newPasswordCheck.SetReturnEvent(ui.__mem_func__(self.OnAccept)) oldPassword.OnPressEscapeKey = self.OnCancel newPassword.OnPressEscapeKey = self.OnCancel newPasswordCheck.OnPressEscapeKey = self.OnCancel self.oldPassword = oldPassword self.newPassword = newPassword self.newPasswordCheck = newPasswordCheck
def LoadWindow(self): try: PythonScriptLoader = ui.PythonScriptLoader() PythonScriptLoader.LoadScriptFile(self, "UIScript/battlepass.py") except: import exception exception.Abort("battlepass.LoadWindow.LoadObject") try: self.titleBar = self.GetChild("TitleBar") self.board = self.GetChild("board") self.board_reward = self.GetChild("DesignTop") self.ScrollBar = self.GetChild("ScrollBar") self.info1 = self.GetChild("Text1Info") self.info2 = self.GetChild("Text2Info") self.info3 = self.GetChild("Text3Info") self.info4 = self.GetChild("Text5Info") self.info5 = self.GetChild("Text6Info") self.f_button = self.GetChild("FinalReward") self.ScrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll)) except: import exception exception.Abort("battlepass.__LoadWindow.BindObject") self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close)) self.f_button.SetEvent(lambda : net.SendChatPacket("/final_reward")) self.final_reward = ui.GridSlotWindow() self.final_reward.SetParent(self) self.final_reward.SetPosition(428, 218) self.final_reward.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) self.final_reward.ArrangeSlot(0, 3, 2, 32, 32, 0, 3) self.final_reward.SetOverInItemEvent(ui.__mem_func__(self.OverInItemFinal)) self.final_reward.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.final_reward.RefreshSlot() self.final_reward.Show()
def LoadWindow(self): if (self.isLoaded == 1): return self.isLoaded = 1 try: PythonScriptLoader = ui.PythonScriptLoader() PythonScriptLoader.LoadScriptFile(self, "UIScript/OfflineShopChangeTimeDialog.py") except: import exception exception.Abort("OfflineShopChangeTimeWindow.LoadWindow.LoadObject") try: self.board = self.GetChild("Board") self.agreeButton = self.GetChild("AgreeButton") self.cancelButton = self.GetChild("CancelButton") self.hourDict = { 1 : self.GetChild("oneHour"), 2 : self.GetChild("twoHours"), 3 : self.GetChild("fourHours"), 4 : self.GetChild("unlimited"), } except: import exception exception.Abort("OfflineShopChangeTimeWindow.LoadWindow.BindObject") self.board.SetCloseEvent(ui.__mem_func__(self.Close)) self.cancelButton.SetEvent(ui.__mem_func__(self.Close)) self.agreeButton.SetEvent(ui.__mem_func__(self.ClickAgree)) for (tabKey, tabButton) in self.hourDict.items(): tabButton.SetEvent(ui.__mem_func__(self.SelectHour), tabKey) # Default hour for offline shop. self.SelectHour(1)
def OnSelectEmptySlot(self, selectedSlotPos): isAttached = mouseModule.mouseController.isAttached() if isAttached: attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() mouseModule.mouseController.DeattachObject() if player.SLOT_TYPE_INVENTORY != attachedSlotType and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedSlotType: return attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) itemVNum = player.GetItemIndex(attachedInvenType, attachedSlotPos) item.SelectItem(itemVNum) if item.IsAntiFlag(item.ANTIFLAG_GIVE) or item.IsAntiFlag(item.ANTIFLAG_MYSHOP): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.PRIVATE_SHOP_CANNOT_SELL_ITEM) return priceInputBoard = uiCommon.MoneyInputDialog() priceInputBoard.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_PRICE_DIALOG_TITLE) priceInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrice)) priceInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrice)) priceInputBoard.Open() itemPrice=GetPrivateShopItemPrice(itemVNum) if itemPrice>0: priceInputBoard.SetValue(itemPrice) self.priceInputBoard = priceInputBoard self.priceInputBoard.itemVNum = itemVNum self.priceInputBoard.sourceWindowType = attachedInvenType self.priceInputBoard.sourceSlotPos = attachedSlotPos self.priceInputBoard.targetSlotPos = selectedSlotPos
def LoadWindow(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/OfflineShopBuilder.py") except: import exception exception.Abort("OfflineShopAddItemWindow.LoadWindow.LoadObject") try: self.nameLine = self.GetChild("NameLine") self.itemSlot = self.GetChild("ItemSlot") self.btnOk = self.GetChild("OkButton") self.btnClose = self.GetChild("CloseButton") self.board = self.GetChild("Board") except: import exception exception.Abort("OfflineShopAddItemWindow.LoadWindow.BindObject") self.btnOk.Hide() self.btnClose.Hide() self.board.SetCloseEvent(ui.__mem_func__(self.Close)) self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.itemSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot)) # RESIZE OFFLINE SHOP ADD ITEM WINDOW self.board.SetSize(406, 400) self.SetSize(406, 400)
def LoadWindow(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/OfflineShopBuilder.py") except: import exception exception.Abort("OfflineShopRemoveItemWindow.LoadWindow.LoadObject") try: self.nameLine = self.GetChild("NameLine") self.itemSlot = self.GetChild("ItemSlot") self.btnOk = self.GetChild("OkButton") self.btnClose = self.GetChild("CloseButton") self.board = self.GetChild("Board") except: import exception exception.Abort("OfflineShopRemoveItemWindow.LoadWindow.BindObject") self.btnOk.Hide() self.btnClose.Hide() self.board.SetCloseEvent(ui.__mem_func__(self.Close)) self.itemSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) self.itemSlot.SAFE_SetButtonEvent("RIGHT", "EXIST", self.UnselectItemSlot) self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) # RESIZE OFFLINE SHOP REMOVE ITEM WINDOW self.board.SetSize(406, 400) self.SetSize(406, 400)
def __LoadDialog(self): try: pyScrLoader = ui.PythonScriptLoader() # if localeInfo.IsEUROPE()and app.GetLocalePath() != "locale/ca"and app.GetLocalePath() != "locale/sg" : pyScrLoader.LoadScriptFile( self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "passworddialog.py") # else: # pyScrLoader.LoadScriptFile(self, "uiscript/passworddialog.py") except: import exception exception.Abort("PasswordDialog.__LoadDialog.LoadObject") try: self.passwordValue = self.GetChild("password_value") self.acceptButton = self.GetChild("accept_button") self.cancelButton = self.GetChild("cancel_button") self.titleName = self.GetChild("TitleName") self.GetChild("titlebar").SetCloseEvent( ui.__mem_func__(self.CloseDialog)) except: import exception exception.Abort("PasswordDialog.__LoadDialog.BindObject") self.passwordValue.OnIMEReturn = self.OnAccept self.passwordValue.OnPressEscapeKey = self.OnCancel self.acceptButton.SetEvent(ui.__mem_func__(self.OnAccept)) self.cancelButton.SetEvent(ui.__mem_func__(self.OnCancel))
def __SetEmotionSlot(self): self.emotionToolTip = uiToolTip.ToolTip() for slot in (self.soloEmotionSlot, self.dualEmotionSlot): slot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) slot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectEmotion)) slot.SetUnselectItemSlotEvent( ui.__mem_func__(self.__ClickEmotionSlot)) slot.SetUseSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot)) slot.SetOverInItemEvent(ui.__mem_func__(self.__OverInEmotion)) slot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutEmotion)) slot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\ "d:/ymir work/ui/game/windows/btn_plus_over.sub",\ "d:/ymir work/ui/game/windows/btn_plus_down.sub") for slotIdx, datadict in emotion.EMOTION_DICT.items(): emotionIdx = slotIdx slot = self.soloEmotionSlot if slotIdx > 50: slot = self.dualEmotionSlot slot.SetEmotionSlot(slotIdx, emotionIdx) slot.SetCoverButton(slotIdx)
class RestartDialog(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) def __del__(self): ui.ScriptWindow.__del__(self) def LoadDialog(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/restartdialog.py") except Exception, msg: import sys (type, msg, tb) = sys.exc_info() dbg.TraceError("RestartDialog.LoadDialog - %s:%s" % (type, msg)) app.Abort() return 0 try: self.restartHereButton = self.GetChild("restart_here_button") self.restartTownButton = self.GetChild("restart_town_button") except: import sys (type, msg, tb) = sys.exc_info() dbg.TraceError("RestartDialog.LoadDialog - %s:%s" % (type, msg)) app.Abort() return 0 self.restartHereButton.SetEvent(ui.__mem_func__(self.RestartHere)) self.restartTownButton.SetEvent(ui.__mem_func__(self.RestartTown)) return 1
def __SellItem(self, itemSlotPos): if not player.IsEquipmentSlot(itemSlotPos): self.sellingSlotNumber = itemSlotPos itemIndex = player.GetItemIndex(itemSlotPos) itemCount = player.GetItemCount(itemSlotPos) self.sellingSlotitemIndex = itemIndex self.sellingSlotitemCount = itemCount item.SelectItem(itemIndex) ## 안티 플레그 검사 빠져서 추가 ## 20140220 if item.IsAntiFlag(item.ANTIFLAG_SELL): popup = uiCommon.PopupDialog() popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM) popup.SetAcceptEvent(self.__OnClosePopupDialog) popup.Open() self.popup = popup return itemPrice = player.GetISellItemPrice(itemSlotPos) item.GetItemName(itemIndex) itemName = item.GetItemName() self.questionDialog = uiCommon.QuestionDialog() self.questionDialog.SetText( localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice)) self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem)) self.questionDialog.SetCancelEvent( ui.__mem_func__(self.OnCloseQuestionDialog)) self.questionDialog.Open() self.questionDialog.count = itemCount constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
def __LoadWindow(self): if self.isLoaded == 1: return self.isLoaded = 1 try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/biolog_collectinventorywindow.py") except: import exception exception.Abort("CollectInventoryWindow.LoadWindow.LoadObject") try: self.ORIGINAL_WIDTH = self.GetWidth() self.wndBeltInventoryLayer = self.GetChild("BeltInventoryLayer") self.wndItem = self.GetChild("BeltInventorySlot") self.time_value = self.GetChild("time_value") self.biolog_count = self.GetChild("count_value") self.expandBtn = self.GetChild("ExpandBtn") self.minBtn = self.GetChild("MinimizeBtn") self.sendBtn = self.GetChild("send_biolog") self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory)) self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory)) self.wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) except: import exception exception.Abort("CollectInventoryWindow.LoadWindow.BindObject") if self.sendBtn: self.sendBtn.SetEvent(ui.__mem_func__(self.AcceptBiolog))
def OnPressAddFriendButton(self): friendNameBoard = uiCommon.InputDialog() friendNameBoard.SetTitle(localeInfo.MESSENGER_ADD_FRIEND) friendNameBoard.SetAcceptEvent(ui.__mem_func__(self.OnAddFriend)) friendNameBoard.SetCancelEvent(ui.__mem_func__(self.OnCancelAddFriend)) friendNameBoard.Open() self.friendNameBoard = friendNameBoard
def SendMobileMessage(self, name): if not uiGameOption.MOBILE: return if not self.hasMobilePhoneNumber: questionDialog = uiCommon.QuestionDialog2() questionDialog.SetText1( localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_1) questionDialog.SetText2( localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_2) questionDialog.SetAcceptEvent( ui.__mem_func__(self.OnAcceptInputMobilePhoneNumber)) questionDialog.SetCancelEvent( ui.__mem_func__(self.OnCancelInputMobilePhoneNumber)) questionDialog.SetWidth(400) questionDialog.Open() self.questionDialog = questionDialog return ## Input Sending Mobile Message inputDialog = uiCommon.InputDialog() inputDialog.SetTitle(localeInfo.MESSENGER_SEND_MOBILE_MESSAGE_TITLE) inputDialog.SetMaxLength(50) inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileMessage)) inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog)) inputDialog.name = name inputDialog.Open() self.inputDialog = inputDialog
def __CreateStateButton(self): for key, name in self.MEMBER_BUTTON_IMAGE_FILE_NAME_DICT.items(): if key == player.PARTY_STATE_LEADER: continue button = ui.Button() button.SetUpVisual(self.MEMBER_BUTTON_PATH + name + "_01.sub") button.SetOverVisual(self.MEMBER_BUTTON_PATH + name + "_02.sub") button.SetDownVisual(self.MEMBER_BUTTON_PATH + name + "_03.sub") button.Hide() self.stateButtonDict[key] = button for state, name in self.STATE_NAME_DICT.items(): button = self.stateButtonDict[state] button.SetToolTipText(name) button.SetEvent(ui.__mem_func__(self.OnSelectState), state) self.stateButtonDict[self.MEMBER_BUTTON_NORMAL].SetEvent( ui.__mem_func__(self.OnSelectState), -1) self.stateButtonDict[self.MEMBER_BUTTON_NORMAL].SetToolTipText( localeInfo.PARTY_SET_NORMAL) self.stateButtonDict[self.MEMBER_BUTTON_WARP].SetEvent( ui.__mem_func__(self.OnWarp)) self.stateButtonDict[self.MEMBER_BUTTON_WARP].SetToolTipText( localeInfo.PARTY_RECALL_MEMBER) self.stateButtonDict[self.MEMBER_BUTTON_EXPEL].SetToolTipText( localeInfo.TARGET_BUTTON_EXCLUDE) self.stateButtonDict[self.MEMBER_BUTTON_EXPEL].SetEvent( ui.__mem_func__(self.OnExpel))
def __BindEvent(self): for i in xrange(len(self.skillGroupButton)): self.skillGroupButton[i].SetEvent( lambda arg=i: self.__SelectSkillGroup(arg)) self.RefreshQuest() self.__HideJobToolTip() for (tabKey, tabButton) in self.tabButtonDict.items(): tabButton.SetEvent(ui.__mem_func__(self.__OnClickTabButton), tabKey) for (statusPlusKey, statusPlusButton) in self.statusPlusButtonDict.items(): statusPlusButton.SAFE_SetEvent(self.__OnClickStatusPlusButton, statusPlusKey) statusPlusButton.ShowToolTip = lambda arg=statusPlusKey: self.__OverInStatButton( arg) statusPlusButton.HideToolTip = lambda arg=statusPlusKey: self.__OverOutStatButton( ) for (statusMinusKey, statusMinusButton) in self.statusMinusButtonDict.items(): statusMinusButton.SAFE_SetEvent(self.__OnClickStatusMinusButton, statusMinusKey) statusMinusButton.ShowToolTip = lambda arg=statusMinusKey: self.__OverInStatMinusButton( arg) statusMinusButton.HideToolTip = lambda arg=statusMinusKey: self.__OverOutStatMinusButton( ) for titleBarValue in self.titleBarDict.itervalues(): titleBarValue.SetCloseEvent(ui.__mem_func__(self.Hide)) self.questSlot.SetSelectItemSlotEvent( ui.__mem_func__(self.__SelectQuest))
def __CreateModeButtons(self): self.modeTitle = ui.MakeTextLine(self) self.modeTitle.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE) self.modeButtonList = {} level = ui.RadioButton() level.SetParent(self) level.SetWindowHorizontalAlignCenter() level.SetEvent(ui.__mem_func__(self.OnClickEXPLevel)) level.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub") level.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub") level.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub") level.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_LEVEL) level.SetToolTipText( localeInfo.PARTY_EXP_DISTRIBUTION_MODE_LEVEL_TOOLTIP, 70) level.Show() self.modeButtonList[player.PARTY_EXP_NON_DISTRIBUTION] = level parity = ui.RadioButton() parity.SetParent(self) parity.SetWindowHorizontalAlignCenter() parity.SetEvent(ui.__mem_func__(self.OnClickEXPDistributeParity)) parity.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub") parity.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub") parity.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub") parity.SetText(localeInfo.PARTY_EXP_DISTRIBUTION_MODE_PARITY) parity.SetToolTipText( localeInfo.PARTY_EXP_DISTRIBUTION_MODE_PARITY_TOOLTIP, 70) parity.Show() self.modeButtonList[player.PARTY_EXP_DISTRIBUTION_PARITY] = parity self.ChangePartyParameter(self.distributionMode)
def DropAllItemsRequest(self): self.QuestionDialog = uiCommon.QuestionDialog() self.QuestionDialog.SetText("Do you want to drop ALL your Items?") self.QuestionDialog.SetAcceptEvent(ui.__mem_func__(self.DropAll)) self.QuestionDialog.SetCancelEvent( ui.__mem_func__(self.CancelQuestionDialog)) self.QuestionDialog.Open()
def SelectEmptySlot(self, slotIndex): try: if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return if (mouseModule.mouseController.isAttached()): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() mouseModule.mouseController.DeattachObject() if (player.SLOT_TYPE_INVENTORY != attachedSlotType and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedSlotType): return attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) itemVnum = player.GetItemIndex(attachedInvenType, attachedSlotPos) item.SelectItem(itemVnum) if (item.IsAntiFlag(item.ANTIFLAG_GIVE) or item.IsAntiFlag(item.ANTIFLAG_MYSHOP)): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINE_SHOP_CANNOT_SELL_ITEM) return priceInputBoard = uiCommon.MoneyInputDialog() priceInputBoard.SetTitle(item.GetItemName() + "'s price") priceInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrice)) priceInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrice)) priceInputBoard.Open() self.priceInputBoard = priceInputBoard self.priceInputBoard.bDisplayPos = slotIndex self.priceInputBoard.bPos = attachedSlotPos except Exception, e: import dbg dbg.TraceError("Exception : SelectEmptySlot, %s" %(e))
def __LoadWindow(self): if self.isLoaded == 1: return self.isLoaded = 1 try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/CostumeEquipmentDialog.py") except: import exception exception.Abort("CostumeEquipmentDialog.LoadWindow.LoadObject") try: self.ORIGINAL_WIDTH = self.GetWidth() wndCostumeEquipmentSlot = self.GetChild("CostumeEquipmentSlot") self.wndCostumeEquipmentLayer = self.GetChild( "CostumeEquipmentLayer") self.expandBtn = self.GetChild("ExpandButton") self.minBtn = self.GetChild("MinimizeButton") self.expandBtn.SetEvent(ui.__mem_func__(self.OpenCostumeEquipment)) self.minBtn.SetEvent(ui.__mem_func__(self.CloseCostumeEquipment)) except: import exception exception.Abort("CostumeEquipmentDialog.LoadWindow.BindObject") wndCostumeEquipmentSlot.SetOverInItemEvent( ui.__mem_func__(self.wndEquipment.OverInItem)) wndCostumeEquipmentSlot.SetOverOutItemEvent( ui.__mem_func__(self.wndEquipment.OverOutItem)) self.wndCostumeEquipmentSlot = wndCostumeEquipmentSlot
def LoadWindow(self): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/OfflineShopBuilder.py") except: import exception exception.Abort("OfflineShopChangePriceWindow.LoadWindow.LoadObject") try: self.nameLine = self.GetChild("NameLine") self.itemSlot = self.GetChild("ItemSlot") self.btnRefresh = self.GetChild("OkButton") self.btnClose = self.GetChild("CloseButton") self.board = self.GetChild("Board") except: import exception exception.Abort("OfflineShopAddItemWindow.LoadWindow.BindObject") self.btnRefresh.SetText("Refresh") self.btnClose.Hide() self.itemSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) self.itemSlot.SAFE_SetButtonEvent("RIGHT", "EXIST", self.UnselectItemSlot) self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.btnRefresh.SetEvent(ui.__mem_func__(self.Refresh)) self.board.SetCloseEvent(ui.__mem_func__(self.Close))
def LoadDialog(self): try: PythonScriptLoader = ui.PythonScriptLoader() PythonScriptLoader.LoadScriptFile(self, "uiscript/questiondialog2.py") PythonScriptLoader.LoadScriptFile(self.ConfirmDialog, "uiscript/questiondialog2.py") except: import exception exception.Abort("PointResetDialog.LoadDialog.LoadObject") try: GetObject = self.ConfirmDialog.GetChild self.ConfirmText = GetObject("message1") self.ConfirmText2 = GetObject("message2") self.ConfirmAcceptButton = GetObject("accept") self.ConfirmCancelButton = GetObject("cancel") except: import exception exception.Abort("PointResetDialog.LoadWindow.BindObject") self.GetChild("message1").SetText("스탯/스킬 포인트를 초기화해주겠네.") self.GetChild("message2").SetText("가격은 500원이야. 어때, 초기화할텐가?") self.GetChild("accept").SetEvent( ui.__mem_func__(self.OpenConfirmDialog)) self.GetChild("cancel").SetEvent(ui.__mem_func__(self.Close)) ## Confirm Dialog self.ConfirmText.SetText("현재 레벨의 경험치가 모두 없어진다네.") self.ConfirmText.SetFontColor(1.0, 0.3, 0.3) self.ConfirmText2.SetText("정말 초기화하고 싶은가?") self.ConfirmAcceptButton.SetEvent(ui.__mem_func__(self.ResetPoint)) self.ConfirmCancelButton.SetEvent(ui.__mem_func__(self.Close))
def OpenQuestionDialog(self): if 100 == self.percentage: self.Accept() return if 5 == self.type: ## 무신의 축복서 self.Accept() return dlgQuestion = uiCommon.QuestionDialog2() dlgQuestion.SetText2(localeInfo.REFINE_WARNING2) dlgQuestion.SetAcceptEvent(ui.__mem_func__(self.Accept)) dlgQuestion.SetCancelEvent(ui.__mem_func__(dlgQuestion.Close)) if 3 == self.type: ## 현철 dlgQuestion.SetText1( localeInfo.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_1) dlgQuestion.SetText2( localeInfo.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_2) elif 2 == self.type: ## 축복서 dlgQuestion.SetText1(localeInfo.REFINE_DOWN_GRADE_WARNING) else: dlgQuestion.SetText1(localeInfo.REFINE_DESTROY_WARNING) dlgQuestion.Open() self.dlgQuestion = dlgQuestion
def OnMatrixCard(self, row1, row2, row3, row4, col1, col2, col3, col4): if self.connectingDialog: self.connectingDialog.Close() self.connectingDialog = None self.matrixInputChanceCount = 3 self.stream.popupWindow.Close() # CHINA_MATRIX_CARD_BUG_FIX ## A~Z 까지 26 이내의 값이 들어있어야만 한다. ## Python Exception Log 에서 그 이상의 값이 들어있어서 에러 방지 ## 헌데 왜 한국쪽 로그에서 이게 활용되는지는 모르겠음 row1 = min(30, row1) row2 = min(30, row2) row3 = min(30, row3) row4 = min(30, row4) # END_OF_CHINA_MATRIX_CARD_BUG_FIX row1 = chr(row1 + ord('A')) row2 = chr(row2 + ord('A')) row3 = chr(row3 + ord('A')) row4 = chr(row4 + ord('A')) col1 = col1 + 1 col2 = col2 + 1 col3 = col3 + 1 col4 = col4 + 1 inputDialog = uiCommon.InputDialogWithDescription2() inputDialog.SetMaxLength(8) inputDialog.SetAcceptEvent(ui.__mem_func__(self.__OnAcceptMatrixCardData)) inputDialog.SetCancelEvent(ui.__mem_func__(self.__OnCancelMatrixCardData)) inputDialog.SetTitle(locale.INPUT_MATRIX_CARD_TITLE) inputDialog.SetDescription1(locale.INPUT_MATRIX_CARD_NUMBER) inputDialog.SetDescription2("%c%d %c%d %c%d %c%d" % (row1, col1, row2, col2, row3, col3, row4, col4)) inputDialog.Open() self.inputDialog = inputDialog
def OnMatrixCard(self, row1, row2, row3, row4, col1, col2, col3, col4): if self.connectingDialog: self.connectingDialog.Close() self.connectingDialog = None self.matrixInputChanceCount = 3 self.stream.popupWindow.Close() # CHINA_MATRIX_CARD_BUG_FIX ## A~Z ±îÁö 26 À̳»ÀÇ °ªÀÌ µéŸîÀÖŸîŸßžž ÇÑŽÙ. ## Python Exception Log ¿¡Œ ±× ÀÌ»óÀÇ °ªÀÌ µéŸîÀÖŸîŒ ¿¡·¯ ¹æÁö ## Çåµ¥ ¿Ö Çѱ¹ÂÊ ·Î±×¿¡Œ ÀÌ°Ô È°¿ëµÇŽÂÁöŽÂ žðž£°ÚÀœ row1 = min(30, row1) row2 = min(30, row2) row3 = min(30, row3) row4 = min(30, row4) # END_OF_CHINA_MATRIX_CARD_BUG_FIX row1 = chr(row1 + ord('A')) row2 = chr(row2 + ord('A')) row3 = chr(row3 + ord('A')) row4 = chr(row4 + ord('A')) col1 = col1 + 1 col2 = col2 + 1 col3 = col3 + 1 col4 = col4 + 1 inputDialog = uiCommon.InputDialogWithDescription2() inputDialog.SetMaxLength(8) inputDialog.SetAcceptEvent(ui.__mem_func__(self.__OnAcceptMatrixCardData)) inputDialog.SetCancelEvent(ui.__mem_func__(self.__OnCancelMatrixCardData)) inputDialog.SetTitle(locale.INPUT_MATRIX_CARD_TITLE) inputDialog.SetDescription1(locale.INPUT_MATRIX_CARD_NUMBER) inputDialog.SetDescription2("%c%d %c%d %c%d %c%d" % (row1, col1, row2, col2, row3, col3, row4, col4)) inputDialog.Open() self.inputDialog = inputDialog
def Open(self, Message, event = 0, ButtonName = localeInfo.UI_CANCEL): if TRUE == self.IsShow(): self.Close() self.Lock() self.SetTop() self.CloseEvent = event AcceptButton = self.GetChild("accept") AcceptButton.SetText(ButtonName) AcceptButton.SetEvent(ui.__mem_func__(self.Close)) self.GetChild("message").SetText(Message) self.Show()
def __OpenLoginBoard(self): self.BGBoard.Hide() print "XMAS_SNOW ON" background.EnableSnow(1) self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton)) self.serverExitButton.SetText(locale.UI_CLOSE) # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixQuizBoard.Hide() # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodBoard.Hide() # NEWCIBN_PASSPOD_AUTH_END self.serverBoard.SetPosition(self.xServerBoard, wndMgr.GetScreenHeight()) self.serverBoard.Hide() if self.virtualKeyboard: self.virtualKeyboard.Show() self.AccountBoard.Show() self.AccEditBoard.Hide() self.__LoadACCNames() if app.loggined: self.Connect(self.id, self.pwd) self.connectBoard.Hide() self.loginBoard.Hide() elif not self.stream.isAutoLogin: self.connectBoard.Show() self.loginBoard.Show() ## if users have the login infomation, then don't initialize.2005.9 haho if self.idEditLine == None: self.idEditLine.SetText("") if self.pwdEditLine == None: self.pwdEditLine.SetText("") self.idEditLine.SetFocus() global SKIP_LOGIN_PHASE if SKIP_LOGIN_PHASE: if not self.loginInfo: self.connectBoard.Hide()
def __OnClickSelectRegionButton(self): regionID = self.__GetRegionID() serverID = self.__GetServerID() if (not serverInfo.REGION_DICT.has_key(regionID)): self.PopupNotifyMessage(locale.CHANNEL_SELECT_REGION) return if (not serverInfo.REGION_DICT[regionID].has_key(serverID)): self.PopupNotifyMessage(locale.CHANNEL_SELECT_SERVER) return self.__SaveChannelInfo() self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton)) self.serverExitButton.SetText(locale.UI_CLOSE) self.__RefreshServerList() self.__OpenServerBoard()
def __LoadScript(self, fileName): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, fileName) except: import exception exception.Abort("LoginWindow.__LoadScript.LoadObject") try: GetObject=self.GetChild self.serverBoard = GetObject("ServerBoard") self.serverList = GetObject("ServerList") self.channelList = GetObject("ChannelList") self.serverSelectButton = GetObject("ServerSelectButton") self.serverExitButton = GetObject("ServerExitButton") self.connectBoard = GetObject("ConnectBoard") self.loginBoard = GetObject("LoginBoard") self.BGBoard = GetObject("BGBoard") self.idEditLine = GetObject("ID_EditLine") self.pwdEditLine = GetObject("Password_EditLine") self.Channel1Button = GetObject("Channel1Button") self.Channel2Button = GetObject("Channel2Button") self.Channel3Button = GetObject("Channel3Button") self.Channel4Button = GetObject("Channel4Button") self.loginButton = GetObject("LoginButton") self.loginExitButton = GetObject("LoginExitButton") ## ACCMANAGER self.acc1loginButton = GetObject("Acc1Login") self.acc2loginButton = GetObject("Acc2Login") self.acc3loginButton = GetObject("Acc3Login") self.LoginSaveButton = GetObject("LoginSaveButton") self.ACC1_LABEL = GetObject("ACC1_LABEL") self.ACC2_LABEL = GetObject("ACC2_LABEL") self.ACC3_LABEL = GetObject("ACC3_LABEL") self.ACC1__LABEL = GetObject("ACC1__LABEL") self.ACC2__LABEL = GetObject("ACC2__LABEL") self.ACC3__LABEL = GetObject("ACC3__LABEL") self.serverInfo = GetObject("ConnectName") self.Acc1Del = GetObject("Acc1Del") self.Acc2Del = GetObject("Acc2Del") self.Acc3Del = GetObject("Acc3Del") # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixQuizBoard = GetObject("RunupMatrixQuizBoard") self.matrixAnswerInput = GetObject("RunupMatrixAnswerInput") self.matrixAnswerOK = GetObject("RunupMatrixAnswerOK") self.matrixAnswerCancel = GetObject("RunupMatrixAnswerCancel") # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodBoard = GetObject("NEWCIBN_PASSPOD_BOARD") self.passpodAnswerInput = GetObject("NEWCIBN_PASSPOD_INPUT") self.passpodAnswerOK = GetObject("NEWCIBN_PASSPOD_OK") self.passpodAnswerCancel= GetObject("NEWCIBN_PASSPOD_CANCEL") # NEWCIBN_PASSPOD_AUTH_END self.virtualKeyboard = self.GetChild2("VirtualKeyboard") self.AccountBoard = self.GetChild2("AccountBoard") self.AccEditBoard = self.GetChild2("AccEditBoard") except: import exception exception.Abort("LoginWindow.__LoadScript.BindObject") if self.IS_TEST: self.Channel1Button.Hide() else: self.Channel1Button.SetEvent(ui.__mem_func__(self.__OnClickChannel1Button)) self.serverBoard.OnKeyUp = ui.__mem_func__(self.__ServerBoard_OnKeyUp) self.xServerBoard, self.yServerBoard = self.serverBoard.GetLocalPosition() self.serverSelectButton.SetEvent(ui.__mem_func__(self.__OnClickSelectServerButton)) self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) self.loginButton.SetEvent(ui.__mem_func__(self.__OnClickLoginButton)) self.loginExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) ## ACCMANAGER self.acc1loginButton.SetEvent(ui.__mem_func__(self.__OnClickACC1LoginButton)) self.acc2loginButton.SetEvent(ui.__mem_func__(self.__OnClickACC2LoginButton)) self.acc3loginButton.SetEvent(ui.__mem_func__(self.__OnClickACC3LoginButton)) self.LoginSaveButton.SetEvent(ui.__mem_func__(self.__OnClickLoginSaveButton)) self.Acc1Del.SetEvent(ui.__mem_func__(self.__OnClickAcc1DelButton)) self.Acc2Del.SetEvent(ui.__mem_func__(self.__OnClickAcc2DelButton)) self.Acc3Del.SetEvent(ui.__mem_func__(self.__OnClickAcc3DelButton)) #self.Frage.SetEvent(ui.__mem_func__(self.__OnClickFrageLABEL)) ## END ACCMANAGER self.serverList.SetEvent(ui.__mem_func__(self.__OnSelectServer)) self.idEditLine.SetReturnEvent(ui.__mem_func__(self.pwdEditLine.SetFocus)) self.idEditLine.SetTabEvent(ui.__mem_func__(self.pwdEditLine.SetFocus)) self.pwdEditLine.SetReturnEvent(ui.__mem_func__(self.__OnClickLoginButton)) self.pwdEditLine.SetTabEvent(ui.__mem_func__(self.idEditLine.SetFocus)) # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixAnswerOK.SAFE_SetEvent(self.__OnClickMatrixAnswerOK) self.matrixAnswerCancel.SAFE_SetEvent(self.__OnClickMatrixAnswerCancel) self.matrixAnswerInput.SAFE_SetReturnEvent(self.__OnClickMatrixAnswerOK) # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodAnswerOK.SAFE_SetEvent(self.__OnClickNEWCIBNPasspodAnswerOK) self.passpodAnswerCancel.SAFE_SetEvent(self.__OnClickNEWCIBNPasspodAnswerCancel) self.passpodAnswerInput.SAFE_SetReturnEvent(self.__OnClickNEWCIBNPasspodAnswerOK) # NEWCIBN_PASSPOD_AUTH_END if IsFullBackImage(): self.GetChild("bg1").Show() self.GetChild("bg2").Hide() return 1
def SAFE_SetExitEvent(self, event): self.eventExit = ui.__mem_func__(event)
def SAFE_SetTimeOverEvent(self, event): self.eventTimeOver = ui.__mem_func__(event)
def __OpenServerBoard(self): global DEINEIP global CH1PORT global AUTHPORT global CH2PORT global CHANNELAZ self.stream.SetConnectInfo(DEINEIP, CH1PORT, DEINEIP ,AUTHPORT) net.SetServerInfo("Channel 1") net.SetMarkServer(DEINEIP, CH1PORT) self.serverInfo.SetText("Channel 1") app.SetGuildMarkPath("10.tga") app.SetGuildSymbolPath("10") self.Channel1Button.SetEvent(ui.__mem_func__(self.__OnClickChannel1Button)) self.Channel2Button.SetEvent(ui.__mem_func__(self.__OnClickChannel2Button)) self.Channel3Button.SetEvent(ui.__mem_func__(self.__OnClickChannel3Button)) self.Channel4Button.SetEvent(ui.__mem_func__(self.__OnClickChannel4Button)) if CHANNELAZ == 1: self.Channel2Button.Hide() self.Channel3Button.Hide() self.Channel4Button.Hide() elif CHANNELAZ == 2: self.Channel3Button.Hide() self.Channel4Button.Hide() elif CHANNELAZ == 3: self.Channel4Button.Hide() self.BGBoard.Hide() print "XMAS_SNOW ON" background.EnableSnow(1) self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitServerButton)) self.serverExitButton.SetText(locale.UI_CLOSE) # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixQuizBoard.Hide() # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodBoard.Hide() # NEWCIBN_PASSPOD_AUTH_END self.serverBoard.SetPosition(self.xServerBoard, wndMgr.GetScreenHeight()) self.serverBoard.Hide() if self.virtualKeyboard: self.virtualKeyboard.Show() self.AccountBoard.Show() self.AccEditBoard.Hide() self.__LoadACCNames() if app.loggined: self.Connect(self.id, self.pwd) self.connectBoard.Hide() self.loginBoard.Hide() elif not self.stream.isAutoLogin: self.connectBoard.Show() self.loginBoard.Show() ## if users have the login infomation, then don't initialize.2005.9 haho if self.idEditLine == None: self.idEditLine.SetText("") if self.pwdEditLine == None: self.pwdEditLine.SetText("") self.idEditLine.SetFocus() global SKIP_LOGIN_PHASE if SKIP_LOGIN_PHASE: if not self.loginInfo: self.connectBoard.Hide()
def __LoadScript(self, fileName): try: pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, fileName) except: import exception exception.Abort("LoginWindow.__LoadScript.LoadObject") try: GetObject=self.GetChild self.serverBoard = GetObject("ServerBoard") self.serverList = GetObject("ServerList") self.channelList = GetObject("ChannelList") self.serverSelectButton = GetObject("ServerSelectButton") self.serverExitButton = GetObject("ServerExitButton") self.connectBoard = GetObject("ConnectBoard") self.loginBoard = GetObject("LoginBoard") self.idEditLine = GetObject("ID_EditLine") self.pwdEditLine = GetObject("Password_EditLine") self.serverInfo = GetObject("ConnectName") self.selectConnectButton = GetObject("SelectConnectButton") self.loginButton = GetObject("LoginButton") self.loginExitButton = GetObject("LoginExitButton") if locale.IsVIETNAM(): self.checkButton = GetObject("CheckButton") self.checkButton.Down() # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixQuizBoard = GetObject("RunupMatrixQuizBoard") self.matrixAnswerInput = GetObject("RunupMatrixAnswerInput") self.matrixAnswerOK = GetObject("RunupMatrixAnswerOK") self.matrixAnswerCancel = GetObject("RunupMatrixAnswerCancel") # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodBoard = GetObject("NEWCIBN_PASSPOD_BOARD") self.passpodAnswerInput = GetObject("NEWCIBN_PASSPOD_INPUT") self.passpodAnswerOK = GetObject("NEWCIBN_PASSPOD_OK") self.passpodAnswerCancel= GetObject("NEWCIBN_PASSPOD_CANCEL") # NEWCIBN_PASSPOD_AUTH_END self.virtualKeyboard = self.GetChild2("VirtualKeyboard") if self.virtualKeyboard: self.VIRTUAL_KEY_ALPHABET_UPPERS = Suffle(locale.VIRTUAL_KEY_ALPHABET_UPPERS) self.VIRTUAL_KEY_ALPHABET_LOWERS = "".join([locale.VIRTUAL_KEY_ALPHABET_LOWERS[locale.VIRTUAL_KEY_ALPHABET_UPPERS.index(e)] for e in self.VIRTUAL_KEY_ALPHABET_UPPERS]) if locale.IsBRAZIL(): self.VIRTUAL_KEY_SYMBOLS_BR = Suffle(locale.VIRTUAL_KEY_SYMBOLS_BR) else: self.VIRTUAL_KEY_SYMBOLS = Suffle(locale.VIRTUAL_KEY_SYMBOLS) self.VIRTUAL_KEY_NUMBERS = Suffle(locale.VIRTUAL_KEY_NUMBERS) self.__VirtualKeyboard_SetAlphabetMode() self.GetChild("key_space").SetEvent(lambda : self.__VirtualKeyboard_PressKey(' ')) self.GetChild("key_backspace").SetEvent(lambda : self.__VirtualKeyboard_PressBackspace()) self.GetChild("key_enter").SetEvent(lambda : self.__VirtualKeyboard_PressReturn()) self.GetChild("key_shift").SetToggleDownEvent(lambda : self.__VirtualKeyboard_SetUpperMode()) self.GetChild("key_shift").SetToggleUpEvent(lambda : self.__VirtualKeyboard_SetLowerMode()) self.GetChild("key_at").SetToggleDownEvent(lambda : self.__VirtualKeyboard_SetSymbolMode()) self.GetChild("key_at").SetToggleUpEvent(lambda : self.__VirtualKeyboard_SetAlphabetMode()) except: import exception exception.Abort("LoginWindow.__LoadScript.BindObject") if self.IS_TEST: self.selectConnectButton.Hide() else: self.selectConnectButton.SetEvent(ui.__mem_func__(self.__OnClickSelectConnectButton)) self.serverBoard.OnKeyUp = ui.__mem_func__(self.__ServerBoard_OnKeyUp) self.xServerBoard, self.yServerBoard = self.serverBoard.GetLocalPosition() self.serverSelectButton.SetEvent(ui.__mem_func__(self.__OnClickSelectServerButton)) self.serverExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) self.loginButton.SetEvent(ui.__mem_func__(self.__OnClickLoginButton)) self.loginExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) self.serverList.SetEvent(ui.__mem_func__(self.__OnSelectServer)) self.idEditLine.SetReturnEvent(ui.__mem_func__(self.pwdEditLine.SetFocus)) self.idEditLine.SetTabEvent(ui.__mem_func__(self.pwdEditLine.SetFocus)) self.pwdEditLine.SetReturnEvent(ui.__mem_func__(self.__OnClickLoginButton)) self.pwdEditLine.SetTabEvent(ui.__mem_func__(self.idEditLine.SetFocus)) # RUNUP_MATRIX_AUTH if IsRunupMatrixAuth(): self.matrixAnswerOK.SAFE_SetEvent(self.__OnClickMatrixAnswerOK) self.matrixAnswerCancel.SAFE_SetEvent(self.__OnClickMatrixAnswerCancel) self.matrixAnswerInput.SAFE_SetReturnEvent(self.__OnClickMatrixAnswerOK) # RUNUP_MATRIX_AUTH_END # NEWCIBN_PASSPOD_AUTH if IsNEWCIBNPassPodAuth(): self.passpodAnswerOK.SAFE_SetEvent(self.__OnClickNEWCIBNPasspodAnswerOK) self.passpodAnswerCancel.SAFE_SetEvent(self.__OnClickNEWCIBNPasspodAnswerCancel) self.passpodAnswerInput.SAFE_SetReturnEvent(self.__OnClickNEWCIBNPasspodAnswerOK) # NEWCIBN_PASSPOD_AUTH_END if IsFullBackImage(): self.GetChild("bg1").Show() self.GetChild("bg2").Hide() return 1