Esempio n. 1
0
    def Open(self):
        print "OPEN LOADING WINDOW -------------------------------------------------------------------------------"

        #app.HideCursor()

        try:
            pyScrLoader = ui.PythonScriptLoader()

            if localeInfo.IsYMIR() or localeInfo.IsWE_KOREA(
            ) or localeInfo.IsCANADA() or localeInfo.IsBRAZIL(
            ) or localeInfo.IsEUROPE() or localeInfo.IsJAPAN():
                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 localeInfo.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 localeInfo.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 localeInfo.IsYMIR() or localeInfo.IsWE_KOREA(
        ) or localeInfo.IsCANADA() or localeInfo.IsBRAZIL(
        ) or localeInfo.IsEUROPE() or localeInfo.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)
Esempio n. 2
0
    def __LoadScript(self, fileName):
        import dbg
        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 localeInfo.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(
                    localeInfo.VIRTUAL_KEY_ALPHABET_UPPERS)
                self.VIRTUAL_KEY_ALPHABET_LOWERS = "".join([
                    localeInfo.VIRTUAL_KEY_ALPHABET_LOWERS[
                        localeInfo.VIRTUAL_KEY_ALPHABET_UPPERS.index(e)]
                    for e in self.VIRTUAL_KEY_ALPHABET_UPPERS
                ])
                if localeInfo.IsBRAZIL():
                    self.VIRTUAL_KEY_SYMBOLS_BR = Suffle(
                        localeInfo.VIRTUAL_KEY_SYMBOLS_BR)
                else:
                    self.VIRTUAL_KEY_SYMBOLS = Suffle(
                        localeInfo.VIRTUAL_KEY_SYMBOLS)
                self.VIRTUAL_KEY_NUMBERS = Suffle(
                    localeInfo.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
Esempio n. 3
0
 def ShowGift(self):
     if not localeInfo.IsBRAZIL():
         self.wndGiftBox.Show()
Esempio n. 4
0
    }

elif localeInfo.IsYMIR() or localeInfo.IsCHEONMA():
    FULL_BACK_IMAGE = True

elif localeInfo.IsHONGKONG():
    FULL_BACK_IMAGE = True
    RUNUP_MATRIX_AUTH = True
    PASSPOD_MSG_DICT = {
        "NOTELE": localeInfo.LOGIN_FAILURE_NOTELEBLOCK,
    }

elif localeInfo.IsJAPAN():
    FULL_BACK_IMAGE = True

elif localeInfo.IsBRAZIL():
    LOGIN_DELAY_SEC = 60.0


def IsFullBackImage():
    global FULL_BACK_IMAGE
    return FULL_BACK_IMAGE


def IsLoginDelay():
    global LOGIN_DELAY_SEC
    if LOGIN_DELAY_SEC > 0.0:
        return True
    else:
        return False
Esempio n. 5
0
    def SellAttachedItem(self):

        if shop.IsPrivateShop():
            mouseModule.mouseController.DeattachObject()
            return

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()
        if localeInfo.IsBRAZIL() == 0:
            attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex(
            )

        if player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:

            if localeInfo.IsBRAZIL():
                itemIndex = player.GetItemIndex(attachedSlotPos)
                item.SelectItem(itemIndex)
            else:
                item.SelectItem(attachedItemIndex)

            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

            itemtype = player.INVENTORY

            if localeInfo.IsBRAZIL() == 0:
                if player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
                    itemtype = player.DRAGON_SOUL_INVENTORY

            if player.IsValuableItem(itemtype, attachedSlotPos):

                itemPrice = item.GetISellItemPrice()

                if item.Is1GoldItem():
                    itemPrice = attachedCount / itemPrice / 5
                else:
                    itemPrice = itemPrice * max(1, attachedCount) / 5

                itemName = item.GetItemName()

                questionDialog = uiCommon.QuestionDialog()
                questionDialog.SetText(
                    localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                                itemPrice))

                questionDialog.SetAcceptEvent(
                    lambda arg1=attachedSlotPos, arg2=attachedCount, arg3=
                    itemtype: self.OnSellItem(arg1, arg2, arg3))
                questionDialog.SetCancelEvent(
                    ui.__mem_func__(self.OnCloseQuestionDialog))
                questionDialog.Open()
                self.questionDialog = questionDialog

                constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

            else:
                self.OnSellItem(attachedSlotPos, attachedCount, itemtype)

        else:
            snd.PlaySound("sound/ui/loginfail.wav")

        mouseModule.mouseController.DeattachObject()