Exemplo n.º 1
0
    def LoadWindow(self):
        try:
            pyScrLoader = ui.PythonScriptLoader()
            pyScrLoader.LoadScriptFile(self, "exscript/adventboard.py")
        except:
            import exception
            exception.Abort("AdventWindow.LoadWindow.LoadObject")

        # self.GetChild("Close_Button").SetEvent(self.Close)
        self.rewardDialog = self.GetChild("reward_background")
        self.rewardDialogTitle = self.GetChild("rewardTitle")
        self.rewardDialogItemName = self.GetChild("rewardItemName")
        self.rewardDialogInfo = self.GetChild("rewardDialogReminder")
        self.rewardDialogItemImage = self.GetChild("rewardItemSlot")
        self.rewardDialogCloseButton = self.GetChild(
            "Close_RewardDialogButton")
        i = 1
        self.adventDayButtonDict = []
        while i <= 24:
            self.adventDayButtonDict.append(
                self.GetChild("button_day_0" + str(i)))
            self.adventDayButtonDict[i - 1].SetEvent(
                lambda arg=i: self.OnClickAdventButton(arg))
            self.adventDayButtonDict[
                i -
                1].ShowToolTip = lambda arg=i: self.__OverInAdventButton(arg)
            self.adventDayButtonDict[
                i -
                1].HideToolTip = lambda arg=i: self.__OverOutAdventButton()
            if ENABLE_DAY_TEXT_LINE:
                self.adventDayButtonDict[i - 1].SetText(str(i))
            self.adventDayButtonDict[i - 1].Hide()
            i = i + 1

        self.rewardDialog.SetColor(self.BOARD_COLOR)
        self.rewardDialogItemName.SetFontColor(0.5411, 0.7254, 0.5568)
        self.rewardDialogTitle.SetFontColor(0.9490, 0.9058, 0.7568)
        self.rewardDialogCloseButton.SetEvent(self.CloseRewardDialog)
        self.toolTip = uiToolTip.ToolTip()

        # self.explodeTest = Explosion()
        # self.explodeTest.SetParent(self)
        # self.explodeTest.SetPosition(100,100)

        ##################
        ## DEV SPÄTER LÖSCHEN!!!
        self.Open()

        self.SetCurrentDay(5)
        for i in xrange(24):
            self.InitAdventButton(i + 1, app.GetRandom(1, 2))

        self.OpenRewardDialog(27001, 1)
Exemplo n.º 2
0
def Suffle(src):
	if VIRTUAL_KEYBOARD_RAND_KEY:
		items = [item for item in src]

		itemCount = len(items)
		for oldPos in xrange(itemCount):
			newPos = app.GetRandom(0, itemCount-1)
			items[newPos], items[oldPos] = items[oldPos], items[newPos]

		return "".join(items)
	else:
		return src
Exemplo n.º 3
0
    def Open(self):
        print "OPEN LOADING WINDOW -------------------------------------------------------------------------------"

        try:
            pyScrLoader = ui.PythonScriptLoader()
            pyScrLoader.LoadScriptFile(
                self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "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()

        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",
        }

        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)
Exemplo n.º 4
0
	def __OnClickBetButton(self):
		curMoney = player.GetMoney()
		if curMoney < SLOT_MACHINE_BET_VALUES[self.betIndex]:
			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SLOT_MACHINE_NEED_GOLD)
			return

		## Network
		# Slot machine start with chosen bet.
		if not DEBUG:
			net.SendStartSlotMachine(SLOT_MACHINE_START, self.betIndex)
		else:
			self.OnSetReels(False, False,\
				app.GetRandom(1, len(SLOT_MACHINE_REELS)),\
				app.GetRandom(1, len(SLOT_MACHINE_REELS)),\
				app.GetRandom(1, len(SLOT_MACHINE_REELS))\
			)

		# Play money sound.
		if not self.isRolling:
			if ENABLE_SOUND:
				snd.PlaySound("sound/ui/money.wav")
Exemplo n.º 5
0
	def OnChangeReelResult(self, slotPos):
		# Get random itemVnum.
		itemVnum = SLOT_MACHINE_REELS[app.GetRandom(1, len(SLOT_MACHINE_REELS))]

		# Select item information.
		item.SelectItem(itemVnum)
		itemIcon = item.GetIconImage()
		(width, height) = item.GetItemSize()

		# Set item icon on reel slot.
		self.reelIconSlot.SetSlot(slotPos, 0, width, height, itemIcon, (1.0, 1.0, 1.0, 0.5))
		self.reelIconSlot.SetSlotCount(slotPos, 0)
		self.reelIconSlot.ShowSlotBaseImage(slotPos)
		self.reelIconSlot.RefreshSlot()
Exemplo n.º 6
0
	def __init__(self, stream):
		print "NEW EMPIRE WINDOW  ----------------------------------------------------------------------------"
		ui.ScriptWindow.__init__(self)
		net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, self)

		self.stream=stream
		self.empireID=app.GetRandom(1, 3)
		self.descIndex=0
		self.empireArea = {}
		self.empireAreaFlag = {}
		self.empireFlag = {}
		self.empireAreaButton = {}
		self.empireAreaCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
		self.empireAreaDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
		self.empireAreaFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
		self.empireAreaFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
		self.empireFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
		self.empireFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
Exemplo n.º 7
0
	def __OpenServerBoard(self):

		loadRegionID, loadServerID, loadChannelID = self.__LoadChannelInfo()
		
		serverIndex = self.__ServerIDToServerIndex(loadRegionID, loadServerID)
		channelIndex = self.__ChannelIDToChannelIndex(loadChannelID)
		
		# 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.serverList.SelectItem(serverIndex)

		if localeInfo.IsEUROPE():
			self.channelList.SelectItem(app.GetRandom(0, self.channelList.GetItemCount()))
		else:
			if channelIndex >= 0:
				self.channelList.SelectItem(channelIndex)

		## Show/Hide 코드에 문제가 있어서 임시 - [levites]
		self.serverBoard.SetPosition(self.xServerBoard, self.yServerBoard)
		self.serverBoard.Show()
		self.connectBoard.Hide()
		self.loginBoard.Hide()

		if self.virtualKeyboard:
			self.virtualKeyboard.Hide()

		if app.loggined and not SKIP_LOGIN_PHASE_SUPPORT_CHANNEL:
			self.serverList.SelectItem(self.loginnedServer-1)
			self.channelList.SelectItem(self.loginnedChannel-1)
			self.__OnClickSelectServerButton()
Exemplo n.º 8
0
	def __SelectGender(self, gender):
		for button in self.genderButtonList:
			button.SetUp()

		self.genderButtonList[gender].Down()

		old_gender = self.gender
		self.gender = gender

		for v1 in GENDER_LIST:
			for i in xrange(SLOT_COUNT[v1]):
				chr.SelectInstance(self.__GetSlotChrID(v1, i))
				if v1==self.gender:
					chr.Show()
				else:
					chr.Hide()
		self.__ResetNameList(old_gender)
		if self.slot >= SLOT_COUNT[self.gender]:
			# self.NameList[self.slot].SetAlpha(0.0)
			self.__SelectSlot(app.GetRandom(0, SLOT_COUNT[self.gender]-1))
			return # the scene will be already updated, so return or double updated scene
		self.__UpdateScene()
Exemplo n.º 9
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")
            self.tipTextLine = self.GetChild("tipTextLine")
        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: "yamato_load/loading01.jpg",
            }
        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()

        self.tipTextLine.SetText(settinginfo.GetTipText())

        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()
        GFHhg54GHGhh45GHGH.SendSelectCharacterPacket(chrSlot)

        app.SetFrameSkip(0)
Exemplo n.º 10
0
	def Open(self):
		print "OPEN CREATE WINDOW ----------------------------------------------------------------------------"

		playerSettingModule.LoadGameData("INIT")

		self.reservingRaceIndex = -1
		self.reservingShapeIndex = -1
		self.reservingStartTime = 0
		self.stat = [0, 0, 0, 0]

		self.gender = 0
		self.slot = -1
		#
		self.instanceIDs = []
		if app.ENABLE_WOLFMAN_CHARACTER:
			self.shapeList = [
				[0, 0, 0, 0, 0],
				[0, 0, 0, 0]]
		else:
			self.shapeList = [
				[0, 0, 0, 0],
				[0, 0, 0, 0]]

		self.descIndex = 0

		try:
			dlgBoard = ui.ScriptWindow()
			pythonScriptLoader = ui.PythonScriptLoader()
			pythonScriptLoader.LoadScriptFile(dlgBoard, uiScriptLocale.LOCALE_UISCRIPT_PATH + "createcharacterwindow.py")

		except:
			import exception
			exception.Abort("CreateCharacterWindow.Open.LoadObject")

		try:
			getChild = dlgBoard.GetChild

			self.NameList = {}
			self.NameList[MAN] = []
			self.NameList[MAN].append(getChild("name_warrior"))
			self.NameList[MAN].append(getChild("name_assassin"))
			self.NameList[MAN].append(getChild("name_sura"))
			self.NameList[MAN].append(getChild("name_shaman"))
			if app.ENABLE_WOLFMAN_CHARACTER:
				self.NameList[MAN].append(getChild("name_wolfman"))
			self.NameList[WOMAN] = []
			self.NameList[WOMAN].append(getChild("name_warrior"))
			self.NameList[WOMAN].append(getChild("name_assassin"))
			self.NameList[WOMAN].append(getChild("name_sura"))
			self.NameList[WOMAN].append(getChild("name_shaman"))

			self.GaugeList = []
			self.GaugeList.append(getChild("hth_gauge"))
			self.GaugeList.append(getChild("int_gauge"))
			self.GaugeList.append(getChild("str_gauge"))
			self.GaugeList.append(getChild("dex_gauge"))

			self.btnCreate = getChild("create_button")
			self.btnCancel = getChild("cancel_button")
			self.btnPrev = getChild("prev_button")
			self.btnNext = getChild("next_button")
			self.btnLeft = getChild("left_button")
			self.btnRight = getChild("right_button")
			self.textBoard = getChild("text_board")

			self.genderButtonList = []
			self.genderButtonList.append(getChild("gender_button_01"))
			self.genderButtonList.append(getChild("gender_button_02"))

			self.shapeButtonList = []
			self.shapeButtonList.append(getChild("shape_button_01"))
			self.shapeButtonList.append(getChild("shape_button_02"))

			self.editCharacterName = getChild("character_name_value")

			self.statValue = []
			self.statValue.append(getChild("hth_value"))
			self.statValue.append(getChild("int_value"))
			self.statValue.append(getChild("str_value"))
			self.statValue.append(getChild("dex_value"))

			getChild("hth_button").ShowToolTip = lambda arg=self.STAT_CON: self.OverInStatButton(arg)
			getChild("hth_button").HideToolTip = lambda arg=self.STAT_CON: self.OverOutStatButton()
			getChild("int_button").ShowToolTip = lambda arg=self.STAT_INT: self.OverInStatButton(arg)
			getChild("int_button").HideToolTip = lambda arg=self.STAT_INT: self.OverOutStatButton()
			getChild("str_button").ShowToolTip = lambda arg=self.STAT_STR: self.OverInStatButton(arg)
			getChild("str_button").HideToolTip = lambda arg=self.STAT_STR: self.OverOutStatButton()
			getChild("dex_button").ShowToolTip = lambda arg=self.STAT_DEX: self.OverInStatButton(arg)
			getChild("dex_button").HideToolTip = lambda arg=self.STAT_DEX: self.OverOutStatButton()

			getChild("hth_button").Hide()
			getChild("int_button").Hide()
			getChild("str_button").Hide()
			getChild("dex_button").Hide()

			self.backGround = getChild("BackGround")

		except:
			import exception
			exception.Abort("CreateCharacterWindow.Open.BindObject")

		self.btnCreate.SetEvent(ui.__mem_func__(self.CreateCharacter))
		self.btnCancel.SetEvent(ui.__mem_func__(self.CancelCreate))
		self.btnPrev.SetEvent(ui.__mem_func__(self.PrevDescriptionPage))
		self.btnNext.SetEvent(ui.__mem_func__(self.NextDescriptionPage))
		self.btnLeft.SetEvent(ui.__mem_func__(self.__DecreaseSlotIndex))
		self.btnRight.SetEvent(ui.__mem_func__(self.__IncreaseSlotIndex))

		self.genderButtonList[0].SetEvent(ui.__mem_func__(self.__SelectGender), MAN)
		self.genderButtonList[1].SetEvent(ui.__mem_func__(self.__SelectGender), WOMAN)

		self.shapeButtonList[0].SetEvent(ui.__mem_func__(self.__SelectShape), SHAPE0)
		self.shapeButtonList[1].SetEvent(ui.__mem_func__(self.__SelectShape), SHAPE1)
		self.editCharacterName.SetReturnEvent(ui.__mem_func__(self.CreateCharacter))
		self.editCharacterName.SetEscapeEvent(ui.__mem_func__(self.CancelCreate))
		self.dlgBoard = dlgBoard

		self.curRotation	= [] + self.SLOT_ROTATION[self.gender]
		self.destRotation	= [] + self.SLOT_ROTATION[self.gender]
		self.curNameAlpha	= [0.0, 0.0, 0.0, 0.0, 0.0]
		self.destNameAlpha	= [0.0, 0.0, 0.0, 0.0, 0.0]
		self.curGauge		= [0.0, 0.0, 0.0, 0.0]
		self.destGauge		= [0.0, 0.0, 0.0, 0.0]

		self.descriptionBox = self.DescriptionBox()
		self.descriptionBox.Show()

		self.chrRenderer = self.CharacterRenderer()
		self.chrRenderer.SetParent(self.backGround)
		self.chrRenderer.Show()

		self.toolTip = uiToolTip.ToolTip()
		self.toolTip.ClearToolTip()

		self.editCharacterName.SetText("")

		self.EnableWindow()
		self.__SelectSlot(0)

		app.SetCamera(500.0, 10.0, 180.0, 95.0)

		self.__MakeCharacter(MAN, 0, playerSettingModule.RACE_WARRIOR_M)
		self.__MakeCharacter(MAN, 1, playerSettingModule.RACE_ASSASSIN_M)
		self.__MakeCharacter(MAN, 2, playerSettingModule.RACE_SURA_M)
		self.__MakeCharacter(MAN, 3, playerSettingModule.RACE_SHAMAN_M)
		if app.ENABLE_WOLFMAN_CHARACTER:
			self.__MakeCharacter(MAN, 4, playerSettingModule.RACE_WOLFMAN_M)

		self.__MakeCharacter(WOMAN, 0, playerSettingModule.RACE_WARRIOR_W)
		self.__MakeCharacter(WOMAN, 1, playerSettingModule.RACE_ASSASSIN_W)
		self.__MakeCharacter(WOMAN, 2, playerSettingModule.RACE_SURA_W)
		self.__MakeCharacter(WOMAN, 3, playerSettingModule.RACE_SHAMAN_W)

		self.__SelectGender(app.GetRandom(MAN, WOMAN))
		self.__SelectShape(0)
		self.__SelectSlot(app.GetRandom(0, SLOT_COUNT[self.gender]-1))

		self.dlgBoard.Show()
		self.Show()

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

		app.ShowCursor()
Exemplo n.º 11
0
    def Open(self):
        playerSettingModule.LoadGameData("INIT")

        self.reservingRaceIndex = -1
        self.reservingShapeIndex = -1
        self.reservingStartTime = 0

        self.gender = 0
        self.slot = -1
        self.shape = 0

        try:
            dlgBoard = ui.ScriptWindow()
            pythonScriptLoader = ui.PythonScriptLoader()
            pythonScriptLoader.LoadScriptFile(
                dlgBoard,
                "pongo_work/characterwindow/create/createcharacterwindow.py")

        except:
            import exception
            exception.Abort("CreateCharacterWindow.Open.LoadObject")

        try:
            getChild = dlgBoard.GetChild

            self.btnCreate = getChild("create_button")
            self.btnExit = getChild("exit_button")

            self.editCharacterName = getChild("name")

            self.genderButton = []
            self.genderButton.append(getChild("gender_man"))
            self.genderButton.append(getChild("gender_woman"))

            self.char = []
            self.char.append(getChild("char1"))
            self.char.append(getChild("char2"))
            self.char.append(getChild("char3"))
            self.char.append(getChild("char4"))

            self.shapeButton = []
            self.shapeButton.append(getChild("shape1"))
            self.shapeButton.append(getChild("shape2"))

            self.backGround = getChild("BackGround")

        except:
            import exception
            exception.Abort("CreateCharacterWindow.Open.BindObject")

        self.btnCreate.SetEvent(ui.__mem_func__(self.CreateCharacter))
        self.btnExit.SetEvent(ui.__mem_func__(self.CancelCreate))

        self.genderButton[0].SetEvent(ui.__mem_func__(self.__SelectGender),
                                      MAN)
        self.genderButton[1].SetEvent(ui.__mem_func__(self.__SelectGender),
                                      WOMAN)

        self.editCharacterName.SetText("")
        self.editCharacterName.SetReturnEvent(
            ui.__mem_func__(self.CreateCharacter))
        self.editCharacterName.SetEscapeEvent(
            ui.__mem_func__(self.CancelCreate))

        self.chrRenderer = self.CharacterRenderer()
        self.chrRenderer.SetParent(self.backGround)
        self.chrRenderer.Show()

        self.dlgBoard = dlgBoard

        self.characters = {
            0: [
                playerSettingModule.RACE_WARRIOR_M,
                playerSettingModule.RACE_ASSASSIN_M,
                playerSettingModule.RACE_SURA_M,
                playerSettingModule.RACE_SHAMAN_M
            ],
            1: [
                playerSettingModule.RACE_WARRIOR_W,
                playerSettingModule.RACE_ASSASSIN_W,
                playerSettingModule.RACE_SURA_W,
                playerSettingModule.RACE_SHAMAN_W
            ]
        }

        self.char[0].SetEvent(ui.__mem_func__(self.__SelectSlot), 0)
        self.char[1].SetEvent(ui.__mem_func__(self.__SelectSlot), 1)
        self.char[2].SetEvent(ui.__mem_func__(self.__SelectSlot), 2)
        self.char[3].SetEvent(ui.__mem_func__(self.__SelectSlot), 3)

        self.shapeButton[0].SetEvent(ui.__mem_func__(self.__SelectShape), 0)
        self.shapeButton[1].SetEvent(ui.__mem_func__(self.__SelectShape), 1)

        self.EnableWindow()
        self.__SelectSlot(app.GetRandom(0, 3))

        app.SetCamera(500.0, 10.0, 180.0, 95.0)

        self.__SelectGender(0)
        self.__SelectShape(0)

        self.Show()
        self.dlgBoard.Show()

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

        app.ShowCursor()
Exemplo n.º 12
0
	def Open(self):
		#print "##---------------------------------------- NEW INTRO CREATE OPEN"
		playerSettingModule.LoadGameData("INIT")
				
		## Func Open UI Loading START ##
		dlgBoard = ui.ScriptWindow()
		self.dlgBoard = dlgBoard
		pythonScriptLoader = ui.PythonScriptLoader()#uiScriptLocale.LOCALE_UISCRIPT_PATH = locale/ymir_ui/
		pythonScriptLoader.LoadScriptFile( self.dlgBoard, uiScriptLocale.LOCALE_UISCRIPT_PATH + "New_CreateCharacterWindow.py" ) 

		getChild = self.dlgBoard.GetChild
		
		## HanMoon ##
		self.NameList = []
		self.NameList.append(getChild("name_warrior"))
		self.NameList.append(getChild("name_assassin"))
		self.NameList.append(getChild("name_sura"))
		self.NameList.append(getChild("name_shaman"))
		self.NameList.append(getChild("name_wolfman"))
		
		## Text ##
		self.textBoard = getChild("text_board")
		self.btnPrev = getChild("prev_button")
		self.btnNext = getChild("next_button")
				
		## Select Job Button List Append ##
		self.JobList = []
		self.JobList.append(getChild("WARRIOR"))
		self.JobList.append(getChild("ASSASSIN"))
		self.JobList.append(getChild("SURA"))
		self.JobList.append(getChild("SHAMAN"))
		self.JobList.append(getChild("WOLFMAN"))

		if localeInfo.IsARABIC():
			for button in self.JobList :
				button.LeftRightReverse() 

		## Image Click Name & Face(Left Button) ##
		self.SelectBtnNameList = []
		self.SelectBtnNameList.append(getChild("name_warrior_small"))
		self.SelectBtnNameList.append(getChild("name_assassin_small"))
		self.SelectBtnNameList.append(getChild("name_sura_small"))
		self.SelectBtnNameList.append(getChild("name_shaman_small"))
		self.SelectBtnNameList.append(getChild("name_wolfman_small"))
		
		self.SelectBtnFaceList = []
		self.SelectBtnFaceList.append(getChild("CharacterFace_0"))
		self.SelectBtnFaceList.append(getChild("CharacterFace_1"))
		self.SelectBtnFaceList.append(getChild("CharacterFace_2"))
		self.SelectBtnFaceList.append(getChild("CharacterFace_3"))
		self.SelectBtnFaceList.append(getChild("CharacterFace_4"))
			
		## Select SEX Button List Append ##
		self.genderButtonList = []
		self.genderButtonList.append(getChild("gender_button_01"))
		self.genderButtonList.append(getChild("gender_button_02"))
		
		## Select Shape Button List Append ##
		self.shapeButtonList = []
		self.shapeButtonList.append(getChild("shape_button_01"))
		self.shapeButtonList.append(getChild("shape_button_02"))
		
		## StatPoint Value ##
		self.statValue = []
		self.statValue.append(getChild("hth_value"))
		self.statValue.append(getChild("int_value"))
		self.statValue.append(getChild("str_value"))
		self.statValue.append(getChild("dex_value"))
		
		## Gauge UI ##
		self.GaugeList = []
		self.GaugeList.append(getChild("hth_gauge"))
		self.GaugeList.append(getChild("int_gauge"))
		self.GaugeList.append(getChild("str_gauge"))
		self.GaugeList.append(getChild("dex_gauge"))
		
		## Create or Cancel ##
		self.btnCreate = getChild("create_button")
		self.btnCancel = getChild("cancel_button")
		
		## Empire Flag ##
		self.empireName = getChild("EmpireName")
		self.flagDict = {
			net.EMPIRE_B : "d:/ymir work/ui/intro/empire/empireflag_b.sub",
			net.EMPIRE_C : "d:/ymir work/ui/intro/empire/empireflag_c.sub",
		}
		self.flag = getChild("EmpireFlag")

		self.discFace = getChild("DiscFace")
		self.raceNameText = getChild("raceName_Text")
			
		## ID Character Name ##
		self.editCharacterName = getChild("character_name_value")
	
		## Background ## Note : Default : Sinsu
		self.backGroundDict = {
			net.EMPIRE_B : "d:/ymir work/ui/intro/empire/background/empire_chunjo.sub",
			net.EMPIRE_C : "d:/ymir work/ui/intro/empire/background/empire_jinno.sub",
		}
		self.backGround = getChild("BackGround")

		
		## INIT Job Sex ##
		self.JobSex = {}
		self.JobSex[0] = app.GetRandom(MAN, WOMAN) ## WARRIOR ##
		self.JobSex[1] = app.GetRandom(MAN, WOMAN) ## ASSASSIN ##
		self.JobSex[2] = app.GetRandom(MAN, WOMAN) ## SURA	##
		self.JobSex[3] = app.GetRandom(MAN, WOMAN) ## SHAMAN ##
		self.JobSex[4] = MAN ## WOLFMAN ##
		
		##Tool Tip##
		self.toolTip = uiToolTip.ToolTip()
		self.toolTip.ClearToolTip()
		
		self.editCharacterName.SetText("")
		
		self.EnableWindow()
		
		## Select Job Button List Start Event ##
		self.JobList[0].SetEvent(ui.__mem_func__(self.SelectJob), 0)
		self.JobList[1].SetEvent(ui.__mem_func__(self.SelectJob), 1)
		self.JobList[2].SetEvent(ui.__mem_func__(self.SelectJob), 2)
		self.JobList[3].SetEvent(ui.__mem_func__(self.SelectJob), 3)
		self.JobList[4].SetEvent(ui.__mem_func__(self.SelectJob), 4)
		
		## Select Sex Button List Start Event ##
		self.genderButtonList[MAN].SetEvent(ui.__mem_func__(self.SelectGender), MAN)
		self.genderButtonList[WOMAN].SetEvent(ui.__mem_func__(self.SelectGender), WOMAN)
		
		## Select Shape Button List Start Event ##
		self.shapeButtonList[0].SetEvent(ui.__mem_func__(self.SelectShape), 0)
		self.shapeButtonList[1].SetEvent(ui.__mem_func__(self.SelectShape), 1)
		
		## Create or Cancel ##
		self.btnCreate.SetEvent(ui.__mem_func__(self.CreateCharacterButton))
		self.btnCancel.SetEvent(ui.__mem_func__(self.CancelButton))
	
		## Job Description ##
		self.btnPrev.SetEvent(ui.__mem_func__(self.PrevDescriptionPage))
		self.btnNext.SetEvent(ui.__mem_func__(self.NextDescriptionPage))
		
		self.editCharacterName.SetReturnEvent(ui.__mem_func__(self.CreateCharacterButton))
		self.editCharacterName.SetEscapeEvent(ui.__mem_func__(self.CancelButton))
		
		## Image Click Face & Name ##
		self.SelectBtnNameList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 0)
		self.SelectBtnNameList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 1)
		self.SelectBtnNameList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 2)
		self.SelectBtnNameList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 3)
		self.SelectBtnNameList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 4)
		
		self.SelectBtnNameList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
		self.SelectBtnNameList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
		self.SelectBtnNameList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 2)
		self.SelectBtnNameList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 3)
		self.SelectBtnNameList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 4)
		
		self.SelectBtnNameList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
		self.SelectBtnNameList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
		self.SelectBtnNameList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 2)
		self.SelectBtnNameList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 3)
		self.SelectBtnNameList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 4)
		
		self.SelectBtnFaceList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 0)
		self.SelectBtnFaceList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 1)
		self.SelectBtnFaceList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 2)
		self.SelectBtnFaceList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 3)
		self.SelectBtnFaceList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_click", 4)
		
		self.SelectBtnFaceList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 0)
		self.SelectBtnFaceList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 1)
		self.SelectBtnFaceList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 2)
		self.SelectBtnFaceList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 3)
		self.SelectBtnFaceList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_in", 4)
		
		self.SelectBtnFaceList[0].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 0)
		self.SelectBtnFaceList[1].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 1)
		self.SelectBtnFaceList[2].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 2)
		self.SelectBtnFaceList[3].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 3)
		self.SelectBtnFaceList[4].SetEvent(ui.__mem_func__(self.EventProgress), "mouse_over_out", 4)
		
		## Tooltip ##
		getChild("WARRIOR").ShowToolTip	 	= lambda arg = self.M2JOBLIST[0] : self.OverInToolTip(arg)
		getChild("WARRIOR").HideToolTip	 	= lambda : self.OverOutToolTip()
		getChild("ASSASSIN").ShowToolTip 	= lambda arg = self.M2JOBLIST[1] : self.OverInToolTip(arg)
		getChild("ASSASSIN").HideToolTip 	= lambda : self.OverOutToolTip()
		getChild("SURA").ShowToolTip 		= lambda arg = self.M2JOBLIST[2] : self.OverInToolTip(arg)
		getChild("SURA").HideToolTip 		= lambda : self.OverOutToolTip()
		getChild("SHAMAN").ShowToolTip 		= lambda arg = self.M2JOBLIST[3] : self.OverInToolTip(arg)
		getChild("SHAMAN").HideToolTip 		= lambda : self.OverOutToolTip()
		getChild("WOLFMAN").ShowToolTip 	= lambda arg = self.M2JOBLIST[4] : self.OverInToolTip(arg)
		getChild("WOLFMAN").HideToolTip 	= lambda : self.OverOutToolTip()
		
		getChild("gender_button_01").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_MAN : self.OverInToolTip(arg)
		getChild("gender_button_01").HideToolTip 	= lambda : self.OverOutToolTip()
		getChild("gender_button_02").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_WOMAN : self.OverInToolTip(arg)
		getChild("gender_button_02").HideToolTip 	= lambda : self.OverOutToolTip()
		
		getChild("shape_button_01").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_SHAPE + "1": self.OverInToolTip(arg)
		getChild("shape_button_01").HideToolTip 	= lambda : self.OverOutToolTip()
		getChild("shape_button_02").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_SHAPE + "2" : self.OverInToolTip(arg)
		getChild("shape_button_02").HideToolTip 	= lambda : self.OverOutToolTip()
		
		getChild("prev_button").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_PREV : self.OverInToolTip(arg)
		getChild("prev_button").HideToolTip 	= lambda : self.OverOutToolTip()
		getChild("next_button").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_NEXT : self.OverInToolTip(arg)
		getChild("next_button").HideToolTip 	= lambda : self.OverOutToolTip()
		getChild("create_button").ShowToolTip 	= lambda arg = uiScriptLocale.CREATE_CREATE : self.OverInToolTip(arg)
		getChild("create_button").HideToolTip 	= lambda : self.OverOutToolTip()
		getChild("cancel_button").ShowToolTip 	= lambda arg = uiScriptLocale.CANCEL : self.OverInToolTip(arg)
		getChild("cancel_button").HideToolTip 	= lambda : self.OverOutToolTip()
		
		## Func Open UI Loading END##		
		## Func Open Make Character & Render START##	
	
		## Flag Setting ##
		my_empire = net.GetEmpireID()
		self.SetEmpire(my_empire)
		
		#Job Description Box
		self.descriptionBox = self.DescriptionBox()
		self.descriptionBox.Show()
				
		##Character Render##
		self.chrRenderer = self.CharacterRenderer()
		self.chrRenderer.SetParent(self.backGround)
		self.chrRenderer.Show()
									
		## Make Character ##
		self.MakeCharacter(playerSettingModule.RACE_WARRIOR_M)	
		self.MakeCharacter(playerSettingModule.RACE_ASSASSIN_M)	
		self.MakeCharacter(playerSettingModule.RACE_SURA_M)		
		self.MakeCharacter(playerSettingModule.RACE_SHAMAN_M)		

		self.MakeCharacter(playerSettingModule.RACE_WARRIOR_W)	
		self.MakeCharacter(playerSettingModule.RACE_ASSASSIN_W)	
		self.MakeCharacter(playerSettingModule.RACE_SURA_W)		
		self.MakeCharacter(playerSettingModule.RACE_SHAMAN_W)		
		
		self.MakeCharacter(playerSettingModule.RACE_WOLFMAN_M)	
		
		self.dlgBoard.Show()
		self.Show() 	
		app.ShowCursor()
		
		if musicInfo.createMusic != "":
			snd.SetMusicVolume(systemSetting.GetMusicVolume())
			snd.FadeInMusic("BGM/"+musicInfo.createMusic)
		
		##Default Setting##
		self.SelectJob(app.GetRandom(0, self.LEN_JOBLIST - 1))
Exemplo n.º 13
0
	def __BindEvent(self):
		# Title Bar
		if self.titleBar:
			self.titleBar.SetCloseEvent(ui.__mem_func__(self.__OnClickCloseTitleBar))

		# Bet Button
		if self.betButton:
			self.betButton.SetEvent(ui.__mem_func__(self.__OnClickBetButton))

		# Down Bet Button
		if self.downBetButton:
			self.downBetButton.SetEvent(ui.__mem_func__(self.__OnClickDownBetButton))

		# Up Bet Button
		if self.upBetButton:
			self.upBetButton.SetEvent(ui.__mem_func__(self.__OnClickUpBetButton))

		# Information (Jackpot) Button
		if self.informationButton:
			self.informationButton.SetToggleUpEvent(ui.__mem_func__(self.__OnClickInformationButton))
			self.informationButton.SetToggleDownEvent(ui.__mem_func__(self.__OnClickInformationButton))

		# Help ToolTip Button
		if self.helpToolTipButton:
			self.toolTipHelp = self.__CreateGameTypeToolTip(localeInfo.SLOT_MACHINE_INFO_TOOLTIP, SLOT_MACHINE_TOOLTIP_DICT)
			self.toolTipHelp.SetTop()
			self.helpToolTipButton.SetToolTipWindow(self.toolTipHelp)

		# Jackpot Effect
		if self.jackpotEffect:
			self.jackpotEffect.SetEndFrameEvent(ui.__mem_func__(self.__OnHideEffects))

		# Success Effect
		if self.successEffect:
			self.successEffect.SetEndFrameEvent(ui.__mem_func__(self.__OnHideEffects))

		# Slot Reel Effect
		if self.reelIconEffectList:
			for reelIconEffect in self.reelIconEffectList:
				reelIconEffect.SetEndFrameEvent(ui.__mem_func__(self.__OnHideEffects))

		for slotPos in xrange(self.reelIconSlot.GetSlotCount()):
			# Get random itemVnum.
			itemVnum = SLOT_MACHINE_REELS[app.GetRandom(1, len(SLOT_MACHINE_REELS))]

			# Select item information.
			item.SelectItem(itemVnum)
			itemIcon = item.GetIconImage()
			(width, height) = item.GetItemSize()

			# Set item icon on reel slot.
			self.reelIconSlot.SetSlot(slotPos, 0, width, height, itemIcon, (1.0, 1.0, 1.0, 0.5))
			self.reelIconSlot.SetSlotCount(slotPos, 0)
			self.reelIconSlot.ShowSlotBaseImage(slotPos)

		self.reelIconSlot.RefreshSlot()

		for slotPos in xrange(self.jackpotReelIconSlot.GetSlotCount()):
			uniqueSlot = 1

			if slotPos >= 3 and slotPos <= 5:
				uniqueSlot = 2
			elif slotPos >= 6 and slotPos <= 8:
				uniqueSlot = 3
			else:
				uniqueSlot = 1

			# Get jackpot itemVnum.
			itemVnum = SLOT_MACHINE_REELS[uniqueSlot]

			# Select item information.
			item.SelectItem(itemVnum)
			itemIcon = item.GetIconImage()
			(width, height) = item.GetItemSize()

			# Set item icon on jackpot reel slot.
			self.jackpotReelIconSlot.SetSlot(slotPos, 0, width, height, itemIcon, (1.0, 1.0, 1.0, 0.5))
			self.jackpotReelIconSlot.SetSlotCount(slotPos, 0)
			self.jackpotReelIconSlot.ShowSlotBaseImage(slotPos)

		self.jackpotReelIconSlot.RefreshSlot()

		# Click up bet button.
		self.__OnClickUpBetButton()