예제 #1
0
    def __Load(self):
        self.__Load_LoadScript("uiscript/systemoptiondialog.py")
        self.__Load_BindObject()

        self.SetCenterPosition()

        self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))

        self.ctrlMusicVolume.SetSliderPos(float(
            systemSetting.GetMusicVolume()))
        self.ctrlMusicVolume.SetEvent(ui.__mem_func__(
            self.OnChangeMusicVolume))

        self.ctrlSoundVolume.SetSliderPos(
            float(systemSetting.GetSoundVolume()) / 5.0)
        self.ctrlSoundVolume.SetEvent(ui.__mem_func__(
            self.OnChangeSoundVolume))

        #		self.ctrlShadowQuality.SetSliderPos(float(systemSetting.GetShadowLevel()) / 5.0)
        #		self.ctrlShadowQuality.SetEvent(ui.__mem_func__(self.OnChangeShadowQuality))

        self.changeMusicButton.SAFE_SetEvent(self.__OnClickChangeMusicButton)

        self.cameraModeButtonList[0].SAFE_SetEvent(
            self.__OnClickCameraModeShortButton)
        self.cameraModeButtonList[1].SAFE_SetEvent(
            self.__OnClickCameraModeLongButton)

        self.fogModeButtonList[0].SAFE_SetEvent(
            self.__OnClickFogModeLevel0Button)
        self.fogModeButtonList[1].SAFE_SetEvent(
            self.__OnClickFogModeLevel1Button)
        self.fogModeButtonList[2].SAFE_SetEvent(
            self.__OnClickFogModeLevel2Button)

        self.tilingModeButtonList[0].SAFE_SetEvent(
            self.__OnClickTilingModeCPUButton)
        self.tilingModeButtonList[1].SAFE_SetEvent(
            self.__OnClickTilingModeGPUButton)

        self.tilingApplyButton.SAFE_SetEvent(self.__OnClickTilingApplyButton)

        self.__SetCurTilingMode()

        self.__ClickRadioButton(self.fogModeButtonList,
                                constInfo.GET_FOG_LEVEL_INDEX())
        self.__ClickRadioButton(self.cameraModeButtonList,
                                constInfo.GET_CAMERA_MAX_DISTANCE_INDEX())

        if musicInfo.fieldMusic == musicInfo.METIN2THEMA:
            self.selectMusicFile.SetText(uiSelectMusic.DEFAULT_THEMA)
        else:
            self.selectMusicFile.SetText(
                musicInfo.fieldMusic[:MUSIC_FILENAME_MAX_LEN])
예제 #2
0
    def Open(self):
        self.loginFailureMsgDict={

            "ALREADY"    : localeInfo.LOGIN_FAILURE_ALREAY,
            "NOID"        : localeInfo.LOGIN_FAILURE_NOT_EXIST_ID,
            "WRONGPWD"    : localeInfo.LOGIN_FAILURE_WRONG_PASSWORD,
            "FULL"        : localeInfo.LOGIN_FAILURE_TOO_MANY_USER,
            "SHUTDOWN"    : localeInfo.LOGIN_FAILURE_SHUTDOWN,
            "REPAIR"    : localeInfo.LOGIN_FAILURE_REPAIR_ID,
            "BLOCK"        : localeInfo.LOGIN_FAILURE_BLOCK_ID,
            "WRONGMAT"    : localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER,
            "QUIT"        : localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER_TRIPLE,
            "BESAMEKEY"    : localeInfo.LOGIN_FAILURE_BE_SAME_KEY,
            "NOTAVAIL"    : localeInfo.LOGIN_FAILURE_NOT_AVAIL,
            "NOBILL"    : localeInfo.LOGIN_FAILURE_NOBILL,
            "BLKLOGIN"    : localeInfo.LOGIN_FAILURE_BLOCK_LOGIN,
            "WEBBLK"    : localeInfo.LOGIN_FAILURE_WEB_BLOCK,
        }

        self.loginFailureFuncDict = {
            "WRONGPWD"    : localeInfo.LOGIN_FAILURE_WRONG_PASSWORD,
            "WRONGMAT"    : localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER,
            "QUIT"        : app.Exit,
        }

        self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
        self.SetWindowName("LoginWindow")

        self.__LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH + "LoginWindow.py")

        if musicInfo.loginMusic != "":
            snd.SetMusicVolume(systemSetting.GetMusicVolume())
            snd.FadeInMusic("BGM/" + musicInfo.loginMusic)

        snd.SetSoundVolume(systemSetting.GetSoundVolume())

        ime.AddExceptKey(91)
        ime.AddExceptKey(93)

        self.SetChannel("CH1")
        self.idEditLine.SetFocus()
        self.pressKey()

        for aID in xrange(0, 4):
            if get_reg("%d_id" % aID):
                self.accountText[aID].SetText("%s" % binascii.a2b_base64("%s" % get_reg("%d_id" % aID)))

        self.Show()
        app.ShowCursor()
예제 #3
0
    def LoadWindow(self):
        try:
            pyScrLoader = ui.PythonScriptLoader()
            pyScrLoader.LoadScriptFile(self,
                                       "exscript/gameoption_slideritem.py")
        except:
            import exception
            exception.Abort("GameOptionWindow.LoadWindow.LoadObject")

        self.title = self.GetChild("titleTextLine")
        self.slider = self.GetChild("slideBar")

        self.slider.SetSliderPos(
            float(float(systemSetting.GetSoundVolume()) / 5.0))
        self.slider.SetEvent(ui.__mem_func__(self.OnChangeVolume))
        self.Show()
예제 #4
0
	def Open(self):
		ServerStateChecker.Create(self)

		print "LOGIN WINDOW OPEN ----------------------------------------------------------------------------"

		self.loginFailureMsgDict={
			#"DEFAULT" : localeInfo.LOGIN_FAILURE_UNKNOWN,

			"ALREADY"	: localeInfo.LOGIN_FAILURE_ALREAY,
			"NOID"		: localeInfo.LOGIN_FAILURE_NOT_EXIST_ID,
			"WRONGPWD"	: localeInfo.LOGIN_FAILURE_WRONG_PASSWORD,
			"FULL"		: localeInfo.LOGIN_FAILURE_TOO_MANY_USER,
			"SHUTDOWN"	: localeInfo.LOGIN_FAILURE_SHUTDOWN,
			"REPAIR"	: localeInfo.LOGIN_FAILURE_REPAIR_ID,
			"BLOCK"		: localeInfo.LOGIN_FAILURE_BLOCK_ID,
			"WRONGMAT"	: localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER,
			"QUIT"		: localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER_TRIPLE,
			"BESAMEKEY"	: localeInfo.LOGIN_FAILURE_BE_SAME_KEY,
			"NOTAVAIL"	: localeInfo.LOGIN_FAILURE_NOT_AVAIL,
			"NOBILL"	: localeInfo.LOGIN_FAILURE_NOBILL,
			"BLKLOGIN"	: localeInfo.LOGIN_FAILURE_BLOCK_LOGIN,
			"WEBBLK"	: localeInfo.LOGIN_FAILURE_WEB_BLOCK,
			"BADSCLID"	: localeInfo.LOGIN_FAILURE_WRONG_SOCIALID,
			"AGELIMIT"	: localeInfo.LOGIN_FAILURE_SHUTDOWN_TIME,
		}

		self.loginFailureFuncDict = {
			"WRONGPWD"	: self.__DisconnectAndInputPassword,
			"WRONGMAT"	: self.__DisconnectAndInputMatrix,
			"QUIT"		: app.Exit,
		}

		self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
		self.SetWindowName("LoginWindow")

		if not self.__LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH + "LoginWindow.py"):
			dbg.TraceError("LoginWindow.Open - __LoadScript Error")
			return
		
		self.__LoadLoginInfo("loginInfo.xml")
		
		if app.loggined:
			self.loginFailureFuncDict = {
			"WRONGPWD"	: app.Exit,
			"WRONGMAT"	: app.Exit,
			"QUIT"		: app.Exit,
			}

		if musicInfo.loginMusic != "":
			snd.SetMusicVolume(systemSetting.GetMusicVolume())
			snd.FadeInMusic("BGM/"+musicInfo.loginMusic)

		snd.SetSoundVolume(systemSetting.GetSoundVolume())

		# pevent key "[" "]"
		ime.AddExceptKey(91)
		ime.AddExceptKey(93)
			
		self.Show()

		global SKIP_LOGIN_PHASE
		if SKIP_LOGIN_PHASE:
			if self.isStartError:
				self.connectBoard.Hide()
				self.loginBoard.Hide()
				self.serverBoard.Hide()
				self.PopupNotifyMessage(localeInfo.LOGIN_CONNECT_FAILURE, self.__ExitGame)
				return

			if self.loginInfo:
				self.serverBoard.Hide()
			else:
				self.__RefreshServerList()
				self.__OpenServerBoard()
		else:
			connectingIP = self.stream.GetConnectAddr()
			if connectingIP:
				if app.USE_OPENID and not app.OPENID_TEST :
					self.__RefreshServerList()
					self.__OpenServerBoard()
				else:
					self.__OpenLoginBoard()
					if IsFullBackImage():
						self.GetChild("bg1").Hide()
						self.GetChild("bg2").Show()

			else:
				self.__RefreshServerList()
				self.__OpenServerBoard()

		app.ShowCursor()
예제 #5
0
	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))
예제 #6
0
	def Open(self):
		ServerStateChecker.Create(self)
		
		print "LOGIN WINDOW OPEN ----------------------------------------------------------------------------"
		
		self.loginFailureMsgDict={

			"ALREADY"	: localeInfo.LOGIN_FAILURE_ALREAY,
			"NOID"		: localeInfo.LOGIN_FAILURE_NOT_EXIST_ID,
			"WRONGPWD"	: localeInfo.LOGIN_FAILURE_WRONG_PASSWORD,
			"FULL"		: localeInfo.LOGIN_FAILURE_TOO_MANY_USER,
			"SHUTDOWN"	: localeInfo.LOGIN_FAILURE_SHUTDOWN,
			"REPAIR"	: localeInfo.LOGIN_FAILURE_REPAIR_ID,
			"BLOCK"		: localeInfo.LOGIN_FAILURE_BLOCK_ID,
			"REBOOT"	: localeInfo.LOGIN_CONNECT_REBOOT,
			"PWCHANGE"	: localeInfo.LOGIN_CONNECT_PWCHANGE,
			"SBLOCK"	: localeInfo.LOGIN_CONNECT_UBLOCK,
			"BOT"		: localeInfo.LOGIN_CONNECT_BOT,
			"WRONGMAT"	: localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER,
			"QUIT"		: localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER_TRIPLE,
			"BESAMEKEY"	: localeInfo.LOGIN_FAILURE_BE_SAME_KEY,
			"NOTAVAIL"	: localeInfo.LOGIN_FAILURE_NOT_AVAIL,
			"NOBILL"	: localeInfo.LOGIN_FAILURE_NOBILL,
			"BLKLOGIN"	: localeInfo.LOGIN_FAILURE_BLOCK_LOGIN,
			"WEBBLK"	: localeInfo.LOGIN_FAILURE_WEB_BLOCK,
			"HWID"		: localeInfo.LOGIN_FAILURE_HWID_BLOCK,
		}

		self.loginFailureFuncDict = {
			"WRONGPWD"	: localeInfo.LOGIN_FAILURE_WRONG_PASSWORD,
			"WRONGMAT"	: localeInfo.LOGIN_FAILURE_WRONG_MATRIX_CARD_NUMBER,
			"QUIT"		: app.Exit,
		}

		if app.NEW_CLIENT_VERSION_CHECK:
			self.loginFailureMsgDict["WRONGVER"] = localeInfo.LOGIN_FAILURE_WRONG_VERSION
			self.loginFailureFuncDict["WRONGVER"] = app.Exit
		
		self.__RequestServerStateList()
		self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
		self.SetWindowName("LoginWindow")

		self.__LoadScript("tbx/ui/loginwindow.py")
		
		for i in xrange(4):
			self.CreateChannel(i)
			
		self.CheckAccount()
		
		
		if systemSetting.IsForcedRules() != RULES_VALUE:
			self.OpenRulesBoard()
			
		if musicInfo.loginMusic != "":
			snd.SetMusicVolume(systemSetting.GetMusicVolume())
			snd.FadeInMusic("BGM/" + musicInfo.loginMusic)

		snd.SetSoundVolume(systemSetting.GetSoundVolume())

		ime.AddExceptKey(91)
		ime.AddExceptKey(93)
		
		self.SetChannel(0)
		
		self.InitWithCMD()
		self.Show()
		app.ShowCursor()