def Open(self, vid, name): if vid: if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(): if not player.IsSameEmpire(vid): self.Hide() return if vid != self.GetTargetVID(): self.ResetTargetBoard() self.SetTargetVID(vid) self.SetTargetName(name) if player.IsMainCharacterIndex(vid): self.__ShowMainCharacterMenu() elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid): self.Hide() else: self.RefreshButton() self.Show() else: self.HideAllButton() self.__ShowButton(locale.TARGET_BUTTON_WHISPER) self.__ShowButton("VOTE_BLOCK_CHAT") self.__ArrangeButtonPosition() self.SetTargetName(name) self.Show()
def Open(self, vid, name): if app.ENABLE_OFFLINE_SHOP: if chr.GetVirtualNumber(vid) >= 30005 and chr.GetVirtualNumber(vid) <= 30010 and chr.GetInstanceType(vid) != chr.INSTANCE_TYPE_PLAYER: try: name = str(name).rsplit("'", 1)[0] # rsplit is correct way but it's support 2.4+ except: name = str(name).split("'")[0] if vid: if not constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(): if not player.IsSameEmpire(vid): self.Hide() return if vid != self.GetTargetVID(): self.ResetTargetBoard() self.SetTargetVID(vid) self.SetTargetName(name) if player.IsMainCharacterIndex(vid): self.__ShowMainCharacterMenu() elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(self.vid): self.Hide() else: self.RefreshButton() self.Show() else: self.HideAllButton() self.__ShowButton(localeInfo.TARGET_BUTTON_WHISPER) self.__ShowButton("VOTE_BLOCK_CHAT") self.__ArrangeButtonPosition() self.SetTargetName(name) self.Show()
def __Load(self): global MOBILE if MOBILE: self.__Load_LoadScript("uiscript/gameoptiondialog_formobile.py") else: self.__Load_LoadScript("uiscript/gameoptiondialog.py") self.__Load_BindObject() self.SetCenterPosition() self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close)) self.nameColorModeButtonList[0].SAFE_SetEvent(self.__OnClickNameColorModeNormalButton) self.nameColorModeButtonList[1].SAFE_SetEvent(self.__OnClickNameColorModeEmpireButton) self.viewTargetBoardButtonList[0].SAFE_SetEvent(self.__OnClickTargetBoardViewButton) self.viewTargetBoardButtonList[1].SAFE_SetEvent(self.__OnClickTargetBoardNoViewButton) self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent(self.__OnClickPvPModePeaceButton) self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent(self.__OnClickPvPModeRevengeButton) self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent(self.__OnClickPvPModeGuildButton) self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent(self.__OnClickPvPModeFreeButton) self.blockButtonList[0].SetToggleUpEvent(self.__OnClickBlockExchangeButton) self.blockButtonList[1].SetToggleUpEvent(self.__OnClickBlockPartyButton) self.blockButtonList[2].SetToggleUpEvent(self.__OnClickBlockGuildButton) self.blockButtonList[3].SetToggleUpEvent(self.__OnClickBlockWhisperButton) self.blockButtonList[4].SetToggleUpEvent(self.__OnClickBlockFriendButton) self.blockButtonList[5].SetToggleUpEvent(self.__OnClickBlockPartyRequest) self.blockButtonList[0].SetToggleDownEvent(self.__OnClickBlockExchangeButton) self.blockButtonList[1].SetToggleDownEvent(self.__OnClickBlockPartyButton) self.blockButtonList[2].SetToggleDownEvent(self.__OnClickBlockGuildButton) self.blockButtonList[3].SetToggleDownEvent(self.__OnClickBlockWhisperButton) self.blockButtonList[4].SetToggleDownEvent(self.__OnClickBlockFriendButton) self.blockButtonList[5].SetToggleDownEvent(self.__OnClickBlockPartyRequest) self.viewChatButtonList[0].SAFE_SetEvent(self.__OnClickViewChatOnButton) self.viewChatButtonList[1].SAFE_SetEvent(self.__OnClickViewChatOffButton) self.alwaysShowNameButtonList[0].SAFE_SetEvent(self.__OnClickAlwaysShowNameOnButton) self.alwaysShowNameButtonList[1].SAFE_SetEvent(self.__OnClickAlwaysShowNameOffButton) self.showDamageButtonList[0].SAFE_SetEvent(self.__OnClickShowDamageOnButton) self.showDamageButtonList[1].SAFE_SetEvent(self.__OnClickShowDamageOffButton) self.showsalesTextButtonList[0].SAFE_SetEvent(self.__OnClickSalesTextOnButton) self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton) self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX()) self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD()) self.__SetPeacePKMode() #global MOBILE if MOBILE: self.inputMobileButton.SetEvent(ui.__mem_func__(self.__OnChangeMobilePhoneNumber)) self.deleteMobileButton.SetEvent(ui.__mem_func__(self.__OnDeleteMobilePhoneNumber))
def __Load(self): self.__Load_LoadScript("uiscript/gameoptiondialog.py") self.__Load_BindObject() self.SetCenterPosition() self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close)) self.nameColorModeButtonList[0].SAFE_SetEvent( self.__OnClickNameColorModeNormalButton) self.nameColorModeButtonList[1].SAFE_SetEvent( self.__OnClickNameColorModeEmpireButton) self.viewTargetBoardButtonList[0].SAFE_SetEvent( self.__OnClickTargetBoardViewButton) self.viewTargetBoardButtonList[1].SAFE_SetEvent( self.__OnClickTargetBoardNoViewButton) self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent( self.__OnClickPvPModePeaceButton) self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent( self.__OnClickPvPModeRevengeButton) self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent( self.__OnClickPvPModeGuildButton) self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent( self.__OnClickPvPModeFreeButton) self.blockButtonList[0].SetToggleUpEvent( self.__OnClickBlockExchangeButton) self.blockButtonList[1].SetToggleUpEvent( self.__OnClickBlockPartyButton) self.blockButtonList[2].SetToggleUpEvent( self.__OnClickBlockGuildButton) self.blockButtonList[3].SetToggleUpEvent( self.__OnClickBlockWhisperButton) self.blockButtonList[4].SetToggleUpEvent( self.__OnClickBlockFriendButton) self.blockButtonList[5].SetToggleUpEvent( self.__OnClickBlockPartyRequest) self.blockButtonList[0].SetToggleDownEvent( self.__OnClickBlockExchangeButton) self.blockButtonList[1].SetToggleDownEvent( self.__OnClickBlockPartyButton) self.blockButtonList[2].SetToggleDownEvent( self.__OnClickBlockGuildButton) self.blockButtonList[3].SetToggleDownEvent( self.__OnClickBlockWhisperButton) self.blockButtonList[4].SetToggleDownEvent( self.__OnClickBlockFriendButton) self.blockButtonList[5].SetToggleDownEvent( self.__OnClickBlockPartyRequest) self.viewChatButtonList[0].SAFE_SetEvent( self.__OnClickViewChatOnButton) self.viewChatButtonList[1].SAFE_SetEvent( self.__OnClickViewChatOffButton) self.alwaysShowNameButtonList[0].SAFE_SetEvent( self.__OnClickAlwaysShowNameOnButton) self.alwaysShowNameButtonList[1].SAFE_SetEvent( self.__OnClickAlwaysShowNameOffButton) self.showDamageButtonList[0].SAFE_SetEvent( self.__OnClickShowDamageOnButton) self.showDamageButtonList[1].SAFE_SetEvent( self.__OnClickShowDamageOffButton) self.showsalesTextButtonList[0].SAFE_SetEvent( self.__OnClickSalesTextOnButton) self.showsalesTextButtonList[1].SAFE_SetEvent( self.__OnClickSalesTextOffButton) self.showOfflineShopButtonList[0].SAFE_SetEvent( self.__OnClickOfflineShopOnButton) self.showOfflineShopButtonList[1].SAFE_SetEvent( self.__OnClickOfflineShopOffButton) self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX()) self.__ClickRadioButton( self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD()) self.__SetPeacePKMode() self.ctrlShopNamesRange.SetSliderPos( float(uiPrivateShopBuilder.GetShopNamesRange())) self.ctrlShopNamesRange.SetEvent( ui.__mem_func__(self.OnChangeShopNamesRange))
def __LoadDialog(self): global NO_MOBILE try: pyScriptLoader = ui.PythonScriptLoader() if MOBILE: pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog_formobile.py") else: pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog.py") except: import exception exception.Abort("OptionDialog.__LoadDialog.LoadObject") try: GetObject = self.GetChild self.titleBar = GetObject("titlebar") self.ctrlMusicVolume = GetObject("music_volume_controller") self.ctrlSoundVolume = GetObject("sound_volume_controller") self.nameColorModeButtonList.append(GetObject("name_color_normal")) self.nameColorModeButtonList.append(GetObject("name_color_empire")) self.viewTargetBoardButtonList.append(GetObject("target_board_no_view")) self.viewTargetBoardButtonList.append(GetObject("target_board_view")) self.cameraModeButtonList.append(GetObject("camera_short")) self.cameraModeButtonList.append(GetObject("camera_long")) self.fogModeButtonList.append(GetObject("fog_level0")) self.fogModeButtonList.append(GetObject("fog_level1")) self.fogModeButtonList.append(GetObject("fog_level2")) self.pvpModeButtonDict[player.PK_MODE_PEACE] = GetObject("pvp_peace") self.pvpModeButtonDict[player.PK_MODE_REVENGE] = GetObject("pvp_revenge") self.pvpModeButtonDict[player.PK_MODE_GUILD] = GetObject("pvp_guild") self.pvpModeButtonDict[player.PK_MODE_FREE] = GetObject("pvp_free") self.blockButtonList.append(GetObject("block_exchange_button")) self.blockButtonList.append(GetObject("block_party_button")) self.blockButtonList.append(GetObject("block_guild_button")) self.blockButtonList.append(GetObject("block_whisper_button")) self.blockButtonList.append(GetObject("block_friend_button")) if MOBILE: self.inputMobileButton = GetObject("input_mobile_button") self.deleteMobileButton = GetObject("delete_mobile_button") except: import exception exception.Abort("OptionDialog.__LoadDialog.BindObject") self.SetCenterPosition() self.ctrlMusicVolume.SetSliderPos(float(systemSetting.GetMusicVolume())) self.ctrlSoundVolume.SetSliderPos(float(systemSetting.GetSoundVolume()) / 5.0) self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close)) self.ctrlMusicVolume.SetEvent(ui.__mem_func__(self.OnChangeMusicVolume)) self.ctrlSoundVolume.SetEvent(ui.__mem_func__(self.OnChangeSoundVolume)) self.nameColorModeButtonList[0].SAFE_SetEvent(self.__OnClickNameColorModeNormalButton) self.nameColorModeButtonList[1].SAFE_SetEvent(self.__OnClickNameColorModeEmpireButton) self.viewTargetBoardButtonList[0].SAFE_SetEvent(self.__OnClickTargetBoardViewButton) self.viewTargetBoardButtonList[1].SAFE_SetEvent(self.__OnClickTargetBoardNoViewButton) self.cameraModeButtonList[0].SAFE_SetEvent(self.__OnClickCameraModeShortButton) self.cameraModeButtonList[1].SAFE_SetEvent(self.__OnClickCameraModeLongButton) self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent(self.__OnClickPvPModePeaceButton) self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent(self.__OnClickPvPModeRevengeButton) self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent(self.__OnClickPvPModeGuildButton) self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent(self.__OnClickPvPModeFreeButton) self.fogModeButtonList[0].SAFE_SetEvent(self.__OnClickFogModeLevel0Button) self.fogModeButtonList[1].SAFE_SetEvent(self.__OnClickFogModeLevel1Button) self.fogModeButtonList[2].SAFE_SetEvent(self.__OnClickFogModeLevel2Button) self.blockButtonList[0].SetToggleUpEvent(self.__OnClickBlockExchangeButton) self.blockButtonList[1].SetToggleUpEvent(self.__OnClickBlockPartyButton) self.blockButtonList[2].SetToggleUpEvent(self.__OnClickBlockGuildButton) self.blockButtonList[3].SetToggleUpEvent(self.__OnClickBlockWhisperButton) self.blockButtonList[4].SetToggleUpEvent(self.__OnClickBlockFriendButton) self.blockButtonList[0].SetToggleDownEvent(self.__OnClickBlockExchangeButton) self.blockButtonList[1].SetToggleDownEvent(self.__OnClickBlockPartyButton) self.blockButtonList[2].SetToggleDownEvent(self.__OnClickBlockGuildButton) self.blockButtonList[3].SetToggleDownEvent(self.__OnClickBlockWhisperButton) self.blockButtonList[4].SetToggleDownEvent(self.__OnClickBlockFriendButton) self.__ClickRadioButton(self.fogModeButtonList, constInfo.GET_FOG_LEVEL_INDEX()) self.__ClickRadioButton(self.cameraModeButtonList, constInfo.GET_CAMERA_MAX_DISTANCE_INDEX()) self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX()) self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD()) self.__SetPeacePKMode() if MOBILE: self.inputMobileButton.SetEvent(ui.__mem_func__(self.__OnChangeMobilePhoneNumber)) self.deleteMobileButton.SetEvent(ui.__mem_func__(self.__OnDeleteMobilePhoneNumber))
def __Load(self): self.__Load_LoadScript("uiscript/gameoptiondialog.py") self.__Load_BindObject() self.SetCenterPosition() self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close)) self.nameColorModeButtonList[0].SAFE_SetEvent( self.__OnClickNameColorModeNormalButton) self.nameColorModeButtonList[1].SAFE_SetEvent( self.__OnClickNameColorModeEmpireButton) self.viewTargetBoardButtonList[0].SAFE_SetEvent( self.__OnClickTargetBoardViewButton) self.viewTargetBoardButtonList[1].SAFE_SetEvent( self.__OnClickTargetBoardNoViewButton) self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent( self.__OnClickPvPModePeaceButton) self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent( self.__OnClickPvPModeRevengeButton) self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent( self.__OnClickPvPModeGuildButton) self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent( self.__OnClickPvPModeFreeButton) blockDict = { "0": "Exchange", "1": "Party", "2": "Guild", "3": "Whisper", "4": "Friend", "5": "PartyReq" } for i in range(0, 5): self.blockButtonList[i].SetToggleUpEvent( lambda: self.__OnClickBlockButton(blockDict[i])) for i in range(0, 5): self.blockButtonList[i].SetToggleDownEvent( lambda: self.__OnClickBlockButton(blockDict[i])) self.viewChatButtonList[0].SAFE_SetEvent( self.__OnClickViewChatOnButton) self.viewChatButtonList[1].SAFE_SetEvent( self.__OnClickViewChatOffButton) self.alwaysShowNameButtonList[0].SAFE_SetEvent( self.__OnClickAlwaysShowNameOnButton) self.alwaysShowNameButtonList[1].SAFE_SetEvent( self.__OnClickAlwaysShowNameOffButton) self.showDamageButtonList[0].SAFE_SetEvent( self.__OnClickShowDamageOnButton) self.showDamageButtonList[1].SAFE_SetEvent( self.__OnClickShowDamageOffButton) self.showsalesTextButtonList[0].SAFE_SetEvent( self.__OnClickSalesTextOnButton) self.showsalesTextButtonList[1].SAFE_SetEvent( self.__OnClickSalesTextOffButton) if app.ENABLE_OFFLINE_SHOP: self.showOfflineShopButtonList[0].SAFE_SetEvent( self.__OnClickOfflineShopOnButton) self.showOfflineShopButtonList[1].SAFE_SetEvent( self.__OnClickOfflineShopWoOnButton) self.showOfflineShopButtonList[2].SAFE_SetEvent( self.__OnClickOfflineShopOffButton) self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX()) self.__ClickRadioButton( self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD()) self.__SetPeacePKMode()