Ejemplo n.º 1
0
 def __VirtualKeyboard_SetSymbolMode(self):
     self.virtualKeyboardIsUpper = FALSE
     self.virtualKeyboardMode = "SYMBOL"
     if locale.IsBRAZIL():
         self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS_BR)
     else:
         self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS)
Ejemplo n.º 2
0
    def __RefreshServerList(self):
        regionID = self.__GetRegionID()

        if not serverInfo.REGION_DICT.has_key(regionID):
            return

        self.serverList.ClearItem()

        regionDict = serverInfo.REGION_DICT[regionID]

        # SEVER_LIST_BUG_FIX
        visible_index = 1
        for id, regionDataDict in regionDict.items():
            name = regionDataDict.get("name", "noname")
            if locale.IsBRAZIL() or locale.IsCANADA():
                self.serverList.InsertItem(id, "%s" % (name))
            else:
                if locale.IsCIBN10():
                    if name[0] == "#":
                        self.serverList.InsertItem(-1, "  %s" % (name[1:]))
                    else:
                        self.serverList.InsertItem(id, "  %s" % (name))
                        visible_index += 1
                else:
                    try:
                        server_id = serverInfo.SERVER_ID_DICT[id]
                    except:
                        server_id = visible_index

                    self.serverList.InsertItem(
                        id, "  %02d. %s" % (int(server_id), name))

                    visible_index += 1
Ejemplo n.º 3
0
    def __VirtualKeyboard_SetLowerMode(self):
        self.virtualKeyboardIsUpper = FALSE

        if self.virtualKeyboardMode == "ALPHABET":
            self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_ALPHABET_LOWERS)
        elif self.virtualKeyboardMode == "NUMBER":
            self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_NUMBERS)
        else:
            if locale.IsBRAZIL():
                self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS_BR)
            else:
                self.__VirtualKeyboard_SetKeys(self.VIRTUAL_KEY_SYMBOLS)
Ejemplo n.º 4
0
    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
Ejemplo n.º 5
0
	def Open(self):
		print "OPEN LOADING WINDOW -------------------------------------------------------------------------------"

		#app.HideCursor()

		try:
			pyScrLoader = ui.PythonScriptLoader()
			
			if locale.IsYMIR() or locale.IsWE_KOREA() or locale.IsCANADA() or locale.IsBRAZIL() or locale.IsEUROPE():
				pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "LoadingWindow.py")
			else:			
				pyScrLoader.LoadScriptFile(self, "UIScript/LoadingWindow.py")
		except:
			import exception
			exception.Abort("LodingWindow.Open - LoadScriptFile Error")

		try:
			self.loadingImage=self.GetChild("BackGround")
			self.errMsg=self.GetChild("ErrorMessage")
			self.loadingGage=self.GetChild("FullGage")
		except:
			import exception
			exception.Abort("LodingWindow.Open - LoadScriptFile Error")

		self.errMsg.Hide()

		if locale.IsHONGKONG():
			imgFileNameDict = {
				0 : app.GetLocalePath() + "/ui/loading/loading0.sub",
				1 : app.GetLocalePath() + "/ui/loading/loading1.sub",
				2 : app.GetLocalePath() + "/ui/loading/loading2.sub",
				3 : app.GetLocalePath() + "/ui/loading/loading3.sub",
				4 : app.GetLocalePath() + "/ui/loading/loading4.sub",
				5 : app.GetLocalePath() + "/ui/loading/loading5.sub",
				6 : app.GetLocalePath() + "/ui/loading/loading6.sub"
			}
		elif locale.IsCIBN10():
			imgFileNameDict = {
				0 : app.GetLocalePath() + "/ui/loading/loading0.jpg",
				1 : app.GetLocalePath() + "/ui/loading/loading1.jpg",
				2 : app.GetLocalePath() + "/ui/loading/loading2.jpg",
				3 : app.GetLocalePath() + "/ui/loading/loading3.jpg",
				4 : app.GetLocalePath() + "/ui/loading/loading4.jpg",
				5 : app.GetLocalePath() + "/ui/loading/loading5.jpg",
				6 : app.GetLocalePath() + "/ui/loading/loading6.jpg",
				7 : app.GetLocalePath() + "/ui/loading/loading7.jpg",
			}
		elif locale.IsYMIR() or locale.IsWE_KOREA() or locale.IsCANADA() or locale.IsBRAZIL() or locale.IsEUROPE() or locale.IsJAPAN():
			imgFileNameDict = {
				0 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading0.sub",
				1 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading1.sub",
				2 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading2.sub",
				3 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading3.sub",

			}
		elif constInfo.SUB2_LOADING_ENABLE:
			imgFileNameDict = {
				0 : "d:/ymir work/uiloading/background_loading_warrior.sub",
				1 : "d:/ymir work/uiloading/background_loading_assassin.sub",
				2 : "d:/ymir work/uiloading/background_loading_shaman.sub",
				3 : "d:/ymir work/uiloading/background_loading_sura.sub",
				4 : "d:/ymir work/uiloading/background_loading_assassin2.sub",
				5 : "d:/ymir work/uiloading/background_loading_sura2.sub",
				6 : "d:/ymir work/uiloading/background_loading_assassin3.sub",
				7 : "d:/ymir work/uiloading/background_loading_assassin3.sub",
			}
		else:
			imgFileNameDict = {
				0 : "d:/ymir work/ui/intro/pattern/background_loading_warrior.jpg",
				1 : "d:/ymir work/ui/intro/pattern/background_loading_assassin.jpg",
				2 : "d:/ymir work/ui/intro/pattern/background_loading_shaman.jpg",
			}

		try:
			imgFileName = imgFileNameDict[app.GetRandom(0, len(imgFileNameDict) - 1)]
			self.loadingImage.LoadImage(imgFileName)

		except:
			print "LoadingWindow.Open.LoadImage - %s File Load Error" % (imgFileName)
			self.loadingImage.Hide()


		width = float(wndMgr.GetScreenWidth()) / float(self.loadingImage.GetWidth())
		height = float(wndMgr.GetScreenHeight()) / float(self.loadingImage.GetHeight())

		self.loadingImage.SetScale(width, height)
		self.loadingGage.SetPercentage(2, 100)

		self.Show()

		chrSlot=self.stream.GetCharacterSlot()
		net.SendSelectCharacterPacket(chrSlot)

		app.SetFrameSkip(0)