예제 #1
0
	def __SelectSlot(self, slot):

		if slot < 0:
			return

		if slot >= SLOT_COUNT:
			return		

		if self.slot == slot:
			return

		self.slot = slot
		self.ResetStat()

		for i in xrange(SLOT_COUNT):
			self.destNameAlpha[i] = 0.0

		self.destNameAlpha[slot] = 1.0

		for i in xrange(SLOT_COUNT):
			self.destRotation[(i+self.slot)%SLOT_COUNT] = self.SLOT_ROTATION[i]

		if self.IsShow():
			snd.PlaySound("sound/ui/click.wav")

		event.ClearEventSet(self.descIndex)
		self.descIndex = event.RegisterEventSet(self.DESCRIPTION_FILE_NAME[self.slot])
		
		if locale.IsARABIC(): 
			event.SetEventSetWidth(self.descIndex, 170)

		chr_id = self.__GetSlotChrID(self.gender, slot)
		if chr.HasInstance(chr_id):
			chr.SelectInstance(chr_id)
			self.__SelectShape(self.shapeList[self.gender][slot])
예제 #2
0
    def AppendMaterial(self, vnum, count):
        slot = self.__MakeSlot()
        slot.SetParent(self)
        slot.SetPosition(15, self.dialogHeight)

        itemImage = self.__MakeItemImage()
        itemImage.SetParent(slot)
        item.SelectItem(vnum)
        itemImage.LoadImage(item.GetIconImageFileName())

        thinBoard = self.__MakeThinBoard()
        thinBoard.SetPosition(50, self.dialogHeight)
        thinBoard.SetSize(191, 20)

        textLine = ui.TextLine()
        textLine.SetParent(thinBoard)
        textLine.SetFontName(locale.UI_DEF_FONT)
        textLine.SetPackedFontColor(0xffdddddd)
        textLine.SetText("%s x %02d" % (item.GetItemName(), count))
        textLine.SetOutline()
        textLine.SetFeather(FALSE)
        textLine.SetWindowVerticalAlignCenter()
        textLine.SetVerticalAlignCenter()

        if locale.IsARABIC():
            (x, y) = textLine.GetTextSize()
            textLine.SetPosition(x, 0)
        else:
            textLine.SetPosition(15, 0)

        textLine.Show()
        self.children.append(textLine)

        self.dialogHeight += 34
        self.UpdateDialog()
예제 #3
0
    def OnResize(self):
        x, y = self.btnSizing.GetLocalPosition()
        width = self.btnSizing.GetWidth()
        height = self.btnSizing.GetHeight()

        if x < self.CHAT_LOG_WINDOW_MINIMUM_WIDTH - width:
            self.btnSizing.SetPosition(
                self.CHAT_LOG_WINDOW_MINIMUM_WIDTH - width, y)
            return
        if y < self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height:
            self.btnSizing.SetPosition(
                x, self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT - height)
            return

        self.scrollBar.LockScroll()
        self.SetSize(x + width, y + height)
        self.scrollBar.UnlockScroll()

        if locale.IsARABIC():
            self.chatInputSet.SetPosition(20, 25)
        else:
            self.chatInputSet.SetPosition(0, 25)

        self.chatInputSet.SetSize(self.GetWidth() - 20, 20)
        self.chatInputSet.RefreshPosition()
        self.chatInputSet.SetChatMax(self.GetWidth() / 8)
예제 #4
0
    def Open(self, maxValue, unitValue=1):

        if locale.IsYMIR() or locale.IsCHEONMA() or locale.IsHONGKONG():
            unitValue = ""

        width = self.GetWidth()
        (mouseX, mouseY) = wndMgr.GetMousePosition()

        if mouseX + width / 2 > wndMgr.GetScreenWidth():
            xPos = wndMgr.GetScreenWidth() - width
        elif mouseX - width / 2 < 0:
            xPos = 0
        else:
            xPos = mouseX - width / 2

        self.SetPosition(xPos, mouseY - self.GetHeight() - 20)

        if locale.IsARABIC():
            self.maxValueTextLine.SetText("/" + str(maxValue))
        else:
            self.maxValueTextLine.SetText(" / " + str(maxValue))

        self.pickValueEditLine.SetText(str(unitValue))
        self.pickValueEditLine.SetFocus()

        ime.SetCursorPosition(1)

        self.unitValue = unitValue
        self.maxValue = maxValue
        self.Show()
        self.SetTop()
예제 #5
0
    def OpenChat(self):
        self.SetSize(self.CHAT_WINDOW_WIDTH, 25)
        chat.SetBoardState(self.chatID, chat.BOARD_STATE_EDIT)
        self.boardState = chat.BOARD_STATE_EDIT

        (x, y, width, height) = self.GetRect()
        (btnX, btnY) = self.btnChatSizing.GetGlobalPosition()

        if locale.IsARABIC():
            chat.SetPosition(self.chatID, x + width - 10, y)
        else:
            chat.SetPosition(self.chatID, x + 10, y)

        chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100)

        if self.IsShow():
            self.btnChatSizing.Show()

        self.Refresh()

        self.btnSendWhisper.SetPosition(self.GetWidth() - 50, 2)
        self.btnSendWhisper.Show()

        self.btnChatLog.SetPosition(self.GetWidth() - 25, 2)
        self.btnChatLog.Show()

        self.chatInputSet.Open()
        self.chatInputSet.SetTop()
        self.SetTop()
예제 #6
0
    def OnRender(self):
        (x, y, width, height) = self.GetRect()

        if locale.IsARABIC():
            grp.SetColor(0x77000000)
            grp.RenderBar(x + 2, y + 45, 13, height - 45)

            grp.SetColor(0x77000000)
            grp.RenderBar(x, y, width, height)
            grp.SetColor(0xff525552)
            grp.RenderBox(x, y, width - 2, height)
            grp.SetColor(0xff000000)
            grp.RenderBox(x + 1, y + 1, width - 2, height)

            grp.SetColor(0xff989898)
            grp.RenderLine(x + width - 13, y + height - 1, 11, -11)
            grp.RenderLine(x + width - 9, y + height - 1, 7, -7)
            grp.RenderLine(x + width - 5, y + height - 1, 3, -3)
        else:
            grp.SetColor(0x77000000)
            grp.RenderBar(x + width - 15, y + 45, 13, height - 45)

            grp.SetColor(0x77000000)
            grp.RenderBar(x, y, width, height)
            grp.SetColor(0xff525552)
            grp.RenderBox(x, y, width - 2, height)
            grp.SetColor(0xff000000)
            grp.RenderBox(x + 1, y + 1, width - 2, height)

            grp.SetColor(0xff989898)
            grp.RenderLine(x + width - 13, y + height - 1, 11, -11)
            grp.RenderLine(x + width - 9, y + height - 1, 7, -7)
            grp.RenderLine(x + width - 5, y + height - 1, 3, -3)

        #####

        chat.ArrangeShowingChat(self.chatID)

        if locale.IsARABIC():
            chat.SetPosition(self.chatID, x + width - 10, y + height - 25)
        else:
            chat.SetPosition(self.chatID, x + 10, y + height - 25)

        chat.SetHeight(self.chatID, height - 45 - 25)
        chat.Update(self.chatID)
        chat.Render(self.chatID)
예제 #7
0
    def RefreshPosition(self):
        if locale.IsARABIC():
            self.chatLine.SetSize(self.GetWidth() - 93, 18)
        else:
            self.chatLine.SetSize(self.GetWidth() - 93, 13)

        self.btnSend.SetPosition(self.GetWidth() - 25, 2)

        (self.chatLine.x, self.chatLine.y, self.chatLine.width,
         self.chatLine.height) = self.chatLine.GetRect()
예제 #8
0
    def __CreateFileListBox(self):
        fileListBox = ui.ListBoxEx()
        fileListBox.SetParent(self)

        if locale.IsARABIC():
            fileListBox.SetPosition(
                self.GetWidth() - fileListBox.GetWidth() - 10, 50)
        else:
            fileListBox.SetPosition(15, 50)

        fileListBox.Show()
        return fileListBox
예제 #9
0
    def __CreateTextLine(self, fileName):
        textLine = ui.TextLine()
        textLine.SetParent(self)

        if locale.IsARABIC():
            textLine.SetPosition(6 * len(fileName) + 6, 0)
        else:
            textLine.SetPosition(0, 0)

        textLine.SetText(fileName)
        textLine.Show()
        return textLine
예제 #10
0
	def __init__(self, stream):
		print "NEW LOGO WINDOW  ----------------------------------------------------------------------------"
		ui.ScriptWindow.__init__(self)
		net.SetPhaseWindow(net.PHASE_WINDOW_LOGO, self)
		self.stream = stream
		self.playingVideo = 0
		self.bNeedUpdate = TRUE
		self.nextLogoIndex = 0
		
		if (locale.IsEUROPE() or locale.IsARABIC()) and (not locale.IsCHEONMA() and not locale.IsWE_KOREA()):
			self.videoList = ["gf.mpg", "ymir.wmv"]
		else:
			self.videoList = ["ymir.wmv"]
예제 #11
0
    def Show(self):
        if self.AtlasMainWindow:
            (bGet, iSizeX, iSizeY) = miniMap.GetAtlasSize()
            if bGet:
                self.SetSize(iSizeX + 15, iSizeY + 38)

                if locale.IsARABIC():
                    self.board.SetPosition(iSizeX + 15, 0)

                self.board.SetSize(iSizeX + 15, iSizeY + 38)
                #self.AtlasMainWindow.SetSize(iSizeX, iSizeY)
                self.AtlasMainWindow.ShowAtlas()
                self.AtlasMainWindow.Show()
        ui.ScriptWindow.Show(self)
예제 #12
0
    def UpdateDialog(self):
        newWidth = self.newToolTip.GetWidth() + 230 + 15 + 20
        newHeight = self.newToolTip.GetHeight() + 98

        if locale.IsARABIC():
            self.board.SetPosition(newWidth, 0)

            (x, y) = self.titleBar.GetLocalPosition()
            self.titleBar.SetPosition(newWidth - 15, y)

        self.board.SetSize(newWidth, newHeight)
        self.titleBar.SetWidth(newWidth - 15)
        self.SetSize(newWidth, newHeight)

        (x, y) = self.GetLocalPosition()
        self.SetPosition(x, y)
예제 #13
0
    def SetHP(self, hpPercentage):
        if not self.hpGauge.IsShow():

            self.SetSize(200 + 7 * self.nameLength, self.GetHeight())

            if locale.IsARABIC():
                self.name.SetPosition(self.GetWidth() - 23, 13)
            else:
                self.name.SetPosition(23, 13)

            self.name.SetWindowHorizontalAlignLeft()
            self.name.SetHorizontalAlignLeft()
            self.hpGauge.Show()
            self.UpdatePosition()

        self.hpGauge.SetPercentage(hpPercentage, 100)
예제 #14
0
    def SetWhisperDialogSize(self, width, height):
        try:

            max = int((width - 90) / 6) * 3 - 6

            self.board.SetSize(width, height)
            self.scrollBar.SetPosition(width - 25, 35)
            self.scrollBar.SetScrollBarSize(height - 100)
            self.scrollBar.SetPos(1.0)
            self.editBar.SetSize(width - 18, 50)
            self.chatLine.SetSize(width - 90, 40)
            self.chatLine.SetLimitWidth(width - 90)
            self.SetSize(width, height)

            if 0 != self.targetName:
                chat.SetWhisperBoxSize(self.targetName, width - 50,
                                       height - 90)

            if locale.IsARABIC():
                self.textRenderer.SetPosition(width - 20, 28)
                self.scrollBar.SetPosition(
                    width - 25 + self.scrollBar.GetWidth(), 35)
                self.editBar.SetPosition(10 + self.editBar.GetWidth(),
                                         height - 60)
                self.sendButton.SetPosition(
                    width - 80 + self.sendButton.GetWidth(), 10)
                self.minimizeButton.SetPosition(
                    width - 42 + self.minimizeButton.GetWidth(), 12)
                self.closeButton.SetPosition(
                    width - 24 + self.closeButton.GetWidth(), 12)
                self.chatLine.SetPosition(5 + self.chatLine.GetWidth(), 5)
                self.board.SetPosition(self.board.GetWidth(), 0)
            else:
                self.textRenderer.SetPosition(20, 28)
                self.scrollBar.SetPosition(width - 25, 35)
                self.editBar.SetPosition(10, height - 60)
                self.sendButton.SetPosition(width - 80, 10)
                self.minimizeButton.SetPosition(width - 42, 12)
                self.closeButton.SetPosition(width - 24, 12)

            self.SetChatLineMax(max)

        except:
            import exception
            exception.Abort("WhisperDialog.SetWhisperDialogSize.BindObject")
예제 #15
0
	def OnSelectEmpire(self, arg):
		for key in self.empireArea.keys():
			self.empireAreaDestAlpha[key] = 0.0
			self.empireAreaFlagDestAlpha[key] = 0.0
			self.empireFlagDestAlpha[key] = 0.0
		self.empireAreaDestAlpha[arg] = 1.0
		self.empireAreaFlagDestAlpha[arg] = 1.0
		self.empireFlagDestAlpha[arg] = 1.0
		self.empireID = arg
		
		event.ClearEventSet(self.descIndex)
		if self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME.has_key(arg):
			self.descIndex = event.RegisterEventSet(self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME[arg])

			if locale.IsARABIC():
				event.SetEventSetWidth(self.descIndex, 170)
			else:
				event.SetRestrictedCount(self.descIndex, 35)
예제 #16
0
    def __Load(self):
        self.popupDialog = PopupDialog(self)

        if locale.IsARABIC():
            self.__Load_LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH +
                                   "MusicListWindow.py")
        else:
            self.__Load_LoadScript("UIScript/MusicListWindow.py")

        self.__Load_BindObject()

        self.refreshButton.SAFE_SetEvent(self.__OnRefresh)
        self.cancelButton.SAFE_SetEvent(self.__OnCancel)
        self.okButton.SAFE_SetEvent(self.__OnOK)
        self.board.SetCloseEvent(ui.__mem_func__(self.__OnCancel))
        self.UpdateRect()

        self.__RefreshFileList()
예제 #17
0
    def SetSize(self, width, height):
        self.imgCenter.SetRenderingRect(
            0.0, 0.0,
            float((width - self.BLOCK_WIDTH * 2) - self.BLOCK_WIDTH) /
            self.BLOCK_WIDTH, 0.0)
        self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0)
        self.imgRight.SetPosition(width - self.BLOCK_WIDTH, 0)

        if locale.IsARABIC():
            self.titleName.SetPosition(self.GetWidth() - 20, 3)
            self.btnClose.SetPosition(3, 3)
            self.scrollBar.SetPosition(1, 45)
        else:
            self.btnClose.SetPosition(width - self.btnClose.GetWidth() - 5, 5)
            self.scrollBar.SetPosition(width - 15, 45)

        self.scrollBar.SetScrollBarSize(height - 45 - 12)
        self.scrollBar.SetPos(self.scrollBarPos)
        ui.Window.SetSize(self, width, height)
예제 #18
0
    def LoadDialogSinglePage(self):
        try:
            pyScrLoader = ui.PythonScriptLoader()

            if locale.IsARABIC():
                pyScrLoader.LoadScriptFile(
                    self,
                    uiScriptLocale.LOCALE_UISCRIPT_PATH + "HelpWindow.py")
            else:
                pyScrLoader.LoadScriptFile(self, "UIScript/HelpWindow.py")
        except:
            import exception
            exception.Abort("HelpWindow.LoadDialogSinglePage.LoadScript")

        try:
            GetObject = self.GetChild
            self.btnClose = GetObject("close_button")
        except:
            import exception
            exception.Abort("DialogWindow.LoadDialogSinglePage.BindObject")
예제 #19
0
    def CloseChat(self):
        chat.SetBoardState(self.chatID, chat.BOARD_STATE_VIEW)
        self.boardState = chat.BOARD_STATE_VIEW

        (x, y, width, height) = self.GetRect()

        if locale.IsARABIC():
            chat.SetPosition(self.chatID, x + width - 10,
                             y + self.EDIT_LINE_HEIGHT)
        else:
            chat.SetPosition(self.chatID, x + 10, y + self.EDIT_LINE_HEIGHT)

        self.SetSize(self.CHAT_WINDOW_WIDTH, 0)

        self.chatInputSet.Close()
        self.btnSendWhisper.Hide()
        self.btnChatLog.Hide()
        self.btnChatSizing.Hide()

        self.Refresh()
예제 #20
0
    def OnUpdate(self):

        if not self.tooltipInfo:
            return

        if not self.infoGuildMark:
            return

        self.infoGuildMark.Hide()
        self.tooltipInfo.Hide()

        if FALSE == self.board.IsIn():
            return

        (mouseX, mouseY) = wndMgr.GetMousePosition()
        (bFind, sName, iPosX, iPosY, dwTextColor,
         dwGuildID) = miniMap.GetAtlasInfo(mouseX, mouseY)

        if FALSE == bFind:
            return

        if "empty_guild_area" == sName:
            sName = locale.GUILD_EMPTY_AREA

        if locale.IsARABIC() and sName[-1].isalnum():
            self.tooltipInfo.SetText("(%s)%d, %d" % (sName, iPosX, iPosY))
        else:
            self.tooltipInfo.SetText("%s(%d, %d)" % (sName, iPosX, iPosY))

        (x, y) = self.GetGlobalPosition()
        self.tooltipInfo.SetTooltipPosition(mouseX - x, mouseY - y)
        self.tooltipInfo.SetTextColor(dwTextColor)
        self.tooltipInfo.Show()
        self.tooltipInfo.SetTop()

        if 0 != dwGuildID:
            textWidth, textHeight = self.tooltipInfo.GetTextSize()
            self.infoGuildMark.SetIndex(dwGuildID)
            self.infoGuildMark.SetPosition(mouseX - x - textWidth - 18 - 5,
                                           mouseY - y)
            self.infoGuildMark.Show()
예제 #21
0
    def __LoadWindow(self):
        if self.isLoaded == 1:
            return

        self.isLoaded = 1

        try:
            if locale.IsARABIC() or locale.IsVIETNAM() or locale.IsJAPAN():
                self.__LoadScript(uiScriptLocale.LOCALE_UISCRIPT_PATH +
                                  "CharacterWindow.py")
            else:
                self.__LoadScript("UIScript/CharacterWindow.py")

            self.__BindObject()
            self.__BindEvent()
        except:
            import exception
            exception.Abort("CharacterWindow.__LoadWindow")

        #self.tabButtonDict["EMOTICON"].Disable()
        self.SetState("STATUS")
예제 #22
0
    def UpdateDialog(self):
        newWidth = self.toolTip.GetWidth() + 60
        newHeight = self.dialogHeight + 69

        ## 936 : 개량 확률 표시 안함
        ##if 936 == app.GetDefaultCodePage():
        newHeight -= 8

        if locale.IsARABIC():
            self.board.SetPosition(newWidth, 0)

            (x, y) = self.titleBar.GetLocalPosition()
            self.titleBar.SetPosition(newWidth - 15, y)

        self.board.SetSize(newWidth, newHeight)
        self.toolTip.SetPosition(15 + 35, 38)
        self.titleBar.SetWidth(newWidth - 15)
        self.SetSize(newWidth, newHeight)

        (x, y) = self.GetLocalPosition()
        self.SetPosition(x, y)
예제 #23
0
    def RefreshBoardEditState(self):

        (x, y, width, height) = self.GetRect()
        (btnX, btnY) = self.btnChatSizing.GetGlobalPosition()

        self.xBar = x
        self.yBar = btnY
        self.widthBar = width
        self.heightBar = y - btnY + self.EDIT_LINE_HEIGHT
        self.curHeightBar = self.heightBar

        if locale.IsARABIC():
            chat.SetPosition(self.chatID, x + width - 10, y)
        else:
            chat.SetPosition(self.chatID, x + 10, y)

        chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT)
        chat.ArrangeShowingChat(self.chatID)

        if btnY > y:
            self.btnChatSizing.SetPosition(btnX, y)
            self.heightBar = self.EDIT_LINE_HEIGHT
예제 #24
0
    def __CreateButton(self):

        if locale.IsARABIC():
            bx = 20
        else:
            bx = 13

        btnAll = ui.RadioButton()
        btnAll.SetParent(self)
        btnAll.SetPosition(bx, 24)
        btnAll.SetUpVisual("d:/ymir work/ui/public/xsmall_button_01.sub")
        btnAll.SetOverVisual("d:/ymir work/ui/public/xsmall_button_02.sub")
        btnAll.SetDownVisual("d:/ymir work/ui/public/xsmall_button_03.sub")
        btnAll.SetText(locale.CHAT_ALL)
        btnAll.SetEvent(ui.__mem_func__(self.ToggleAllChatMode))
        btnAll.Down()
        btnAll.Show()
        self.btnAll = btnAll

        x = bx + 48
        i = 0
        self.modeButtonList = []
        for name in self.CHAT_MODE_NAME:
            btn = ui.ToggleButton()
            btn.SetParent(self)
            btn.SetPosition(x, 24)
            btn.SetUpVisual("d:/ymir work/ui/public/xsmall_button_01.sub")
            btn.SetOverVisual("d:/ymir work/ui/public/xsmall_button_02.sub")
            btn.SetDownVisual("d:/ymir work/ui/public/xsmall_button_03.sub")
            btn.SetText(name)
            btn.Show()

            mode = self.CHAT_MODE_INDEX[i]
            btn.SetToggleUpEvent(lambda arg=mode: self.ToggleChatMode(arg))
            btn.SetToggleDownEvent(lambda arg=mode: self.ToggleChatMode(arg))
            self.modeButtonList.append(btn)

            x += 48
            i += 1
예제 #25
0
    def RefreshBoardViewState(self):
        (x, y, width, height) = self.GetRect()
        (btnX, btnY) = self.btnChatSizing.GetGlobalPosition()
        textAreaHeight = self.visibleLineCount * chat.GetLineStep(self.chatID)

        if locale.IsARABIC():
            chat.SetPosition(self.chatID, x + width - 10,
                             y + self.EDIT_LINE_HEIGHT)
        else:
            chat.SetPosition(self.chatID, x + 10, y + self.EDIT_LINE_HEIGHT)

        chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100)

        if self.boardState == chat.BOARD_STATE_EDIT:
            textAreaHeight += 45
        elif self.visibleLineCount != 0:
            textAreaHeight += 10 + 10

        self.xBar = x
        self.yBar = y + self.EDIT_LINE_HEIGHT - textAreaHeight
        self.widthBar = width
        self.heightBar = textAreaHeight

        self.scrollBar.Hide()
예제 #26
0
    def __CreateDialog(self):

        pyScrLoader = ui.PythonScriptLoader()
        if locale.IsARABIC():
            pyScrLoader.LoadScriptFile(
                self, uiScriptLocale.LOCALE_UISCRIPT_PATH +
                "inputdialogwithdescription.py")
        else:
            pyScrLoader.LoadScriptFile(
                self, "uiscript/inputdialogwithdescription.py")

        try:
            getObject = self.GetChild
            self.board = getObject("Board")
            self.acceptButton = getObject("AcceptButton")
            self.cancelButton = getObject("CancelButton")
            self.inputSlot = getObject("InputSlot")
            self.inputValue = getObject("InputValue")
            self.description = getObject("Description")

        except:
            import exception
            exception.Abort(
                "InputDialogWithDescription.LoadBoardDialog.BindObject")
예제 #27
0
	def __init__(self):
		if locale.IsARABIC():
			self.MAP_NAME_IMAGE =	{
							"metin2_map_a1"  : LOCALE_PATH+"a1.tga",
							"map_a2"         : LOCALE_PATH+"a2.tga",
							"season2/metin2_map_a2_1": LOCALE_PATH+"a2_2.tga",
							"metin2_map_a3"  : LOCALE_PATH+"a3.tga",
							"metin2_map_b1"  : LOCALE_PATH+"b1.tga",
							"map_b2"         : LOCALE_PATH+"b2.tga",
							"metin2_map_b3"  : LOCALE_PATH+"b3.tga",
							"metin2_map_c1"  : LOCALE_PATH+"c1.tga",
							"map_c2"         : LOCALE_PATH+"c2.tga",
							"metin2_map_c3"  : LOCALE_PATH+"c3.tga",
							"metin2_map_deviltower1" : LOCALE_PATH+"devil1_title.tga",
							"metin2_map_n_desert_01" : LOCALE_PATH+"desert1.tga",
							"season2/metin2_map_n_desert_02": LOCALE_PATH+"desert2.tga",
							"metin2_map_n_flame_01" : LOCALE_PATH+"frame1.tga",
							"season2/metin2_map_n_flame_02": LOCALE_PATH+"frame2.tga",
							"metin2_map_milgyo" : LOCALE_PATH+"milgyo.tga",
							"season2/metin2_map_milgyo_a": LOCALE_PATH+"milgyo2.TGA",
							"metin2_map_monkeydungeon" : LOCALE_PATH+"monkey1.tga",
							"metin2_map_monkeydungeon_02" : LOCALE_PATH+"monkey2.tga",
							"metin2_map_monkeydungeon_03" : LOCALE_PATH+"monkey3.tga",
							"metin2_map_guild_01" : LOCALE_PATH+"guild1.tga",
							"metin2_map_guild_02" : LOCALE_PATH+"guild2.tga",
							"metin2_map_guild_03" : LOCALE_PATH+"guild3.tga",
							"season2/metin2_map_skipia_dungeon_01": LOCALE_PATH+"skipia.tga",
							"season2/metin2_map_skipia_dungeon_02": LOCALE_PATH+"skipia.tga",
							"map_n_snowm_01" : LOCALE_PATH+"snow1.tga",
							"season2/map_n_snowm_02": LOCALE_PATH+"snow2.tga",
							"metin2_map_spiderdungeon" : LOCALE_PATH+"spider1.tga",
							"metin2_map_trent" : LOCALE_PATH+"trent.tga",
							"metin2_map_trent02" : LOCALE_PATH+"trent02.tga",
							"season2/metin2_map_trent_a": LOCALE_PATH+"trent_a.tga",
							"season2/metin2_map_trent02_a": LOCALE_PATH+"trent02_a.tga",
							"metin2_map_dd"	:	LOCALE_PATH+"devil_basement.tga",
							"metin2_map_devilsCatacomb"	:	LOCALE_PATH+"devil_basement.tga",
							"metin2_map_dd"	:	LOCALE_PATH+"devil_basement.tga",
							"season1/metin2_map_WL_01" :	LOCALE_PATH+"wl.tga",
							"season1/metin2_map_nusluck01":	LOCALE_PATH+"nusluck.tga",	
						}
		else:
			self.MAP_NAME_IMAGE =	{
							"metin2_map_a1"  : LOCALE_PATH+"a1.tga",
							"map_a2"         : LOCALE_PATH+"a2.tga",
							"metin2_map_a3"  : LOCALE_PATH+"a3.tga",
							"metin2_map_b1"  : LOCALE_PATH+"b1.tga",
							"map_b2"         : LOCALE_PATH+"b2.tga",
							"metin2_map_b3"  : LOCALE_PATH+"b3.tga",
							"metin2_map_c1"  : LOCALE_PATH+"c1.tga",
							"map_c2"         : LOCALE_PATH+"c2.tga",
							"metin2_map_c3"  : LOCALE_PATH+"c3.tga",
							"map_n_snowm_01" : LOCALE_PATH+"snow1.tga",
							"metin2_map_deviltower1" : LOCALE_PATH+"devil1_title.tga",
							"metin2_map_n_flame_01" : LOCALE_PATH+"frame1.tga",
							"metin2_map_n_desert_01" : LOCALE_PATH+"desert1.tga",
							"metin2_map_milgyo" : LOCALE_PATH+"milgyo.tga",
							"metin2_map_monkeydungeon" : LOCALE_PATH+"monkey1.tga",
							"metin2_map_monkeydungeon_02" : LOCALE_PATH+"monkey2.tga",
							"metin2_map_monkeydungeon_03" : LOCALE_PATH+"monkey3.tga",
							"metin2_map_guild_01" : LOCALE_PATH+"guild1.tga",
							"metin2_map_guild_02" : LOCALE_PATH+"guild2.tga",
							"metin2_map_guild_03" : LOCALE_PATH+"guild3.tga",
							"metin2_map_trent" : LOCALE_PATH+"trent.tga",
							"metin2_map_trent02" : LOCALE_PATH+"trent02.tga",
							"season2/map_n_snowm_02": LOCALE_PATH+"snow2.tga",
							"season2/metin2_map_a2_1": LOCALE_PATH+"a2_2.tga",
							"season2/metin2_map_n_desert_02": LOCALE_PATH+"desert2.tga",
							"season2/metin2_map_n_flame_02": LOCALE_PATH+"frame2.tga",
							"season2/metin2_map_milgyo_a": LOCALE_PATH+"milgyo2.TGA",
							"season2/metin2_map_trent_a": LOCALE_PATH+"trent_a.tga",
							"season2/metin2_map_trent02_a": LOCALE_PATH+"trent02_a.tga",
							"season2/metin2_map_skipia_dungeon_01": LOCALE_PATH+"skipia.tga",
							"season2/metin2_map_skipia_dungeon_02": LOCALE_PATH+"skipia.tga",
							"metin2_map_devilsCatacomb"	:	LOCALE_PATH+"devil_basement.tga",
							"metin2_guild_village_01"	:	LOCALE_PATH+"a4.tga",
							"metin2_guild_village_02"	:	LOCALE_PATH+"b4.tga",
							"metin2_guild_village_03"	:	LOCALE_PATH+"c4.tga",
							"metin2_map_BayBlackSand"	:	LOCALE_PATH+"bay.tga",
							"metin2_map_Mt_Thunder"		:	LOCALE_PATH+"thunder.tga",
							"metin2_map_dawnmistwood"	:	LOCALE_PATH+"dawn.tga",
							"Metin2_map_CapeDragonHead"	:	LOCALE_PATH+"cape.tga",
							"metin2_map_spiderdungeon"	:	LOCALE_PATH+"sd01.tga",
							"season1/metin2_map_spiderdungeon_02"	:	LOCALE_PATH+"sd02.tga",
							"season1/metin2_map_spiderdungeon_02_1"	:	LOCALE_PATH+"sd02.tga",
							"metin2_map_spiderdungeon_03"		:	LOCALE_PATH+"sd03.tga",
						}

		ui.ExpandedImageBox.__init__(self, "TOP_MOST")
		self.AddFlag("not_pick")
		self.__Initialize()
예제 #28
0
    def __init__(self):
        ui.ThinBoard.__init__(self)

        name = ui.TextLine()
        name.SetParent(self)
        name.SetDefaultFontName()
        name.SetOutline()
        name.Show()

        hpGauge = ui.Gauge()
        hpGauge.SetParent(self)
        hpGauge.MakeGauge(130, "red")
        hpGauge.Hide()

        closeButton = ui.Button()
        closeButton.SetParent(self)
        closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
        closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
        closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
        closeButton.SetPosition(30, 13)

        if locale.IsARABIC():
            hpGauge.SetPosition(55, 17)
            hpGauge.SetWindowHorizontalAlignLeft()
            closeButton.SetWindowHorizontalAlignLeft()
        else:
            hpGauge.SetPosition(175, 17)
            hpGauge.SetWindowHorizontalAlignRight()
            closeButton.SetWindowHorizontalAlignRight()
        if app.ENABLE_SEND_TARGET_INFO:
            infoButton = ui.Button()
            infoButton.SetParent(self)
            infoButton.SetUpVisual("d:/ymir work/ui/pattern/q_mark_01.tga")
            infoButton.SetOverVisual("d:/ymir work/ui/pattern/q_mark_02.tga")
            infoButton.SetDownVisual("d:/ymir work/ui/pattern/q_mark_01.tga")
            infoButton.SetEvent(ui.__mem_func__(self.OnPressedInfoButton))
            infoButton.Hide()

            infoBoard = self.InfoBoard()
            infoBoard.Hide()
            infoButton.showWnd = infoBoard

        closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton))
        closeButton.Show()

        self.buttonDict = {}
        self.showingButtonList = []
        for buttonName in self.BUTTON_NAME_LIST:
            button = ui.Button()
            button.SetParent(self)

            if locale.IsARABIC():
                button.SetUpVisual(
                    "d:/ymir work/ui/public/Small_Button_01.sub")
                button.SetOverVisual(
                    "d:/ymir work/ui/public/Small_Button_02.sub")
                button.SetDownVisual(
                    "d:/ymir work/ui/public/Small_Button_03.sub")
            else:
                button.SetUpVisual(
                    "d:/ymir work/ui/public/small_thin_button_01.sub")
                button.SetOverVisual(
                    "d:/ymir work/ui/public/small_thin_button_02.sub")
                button.SetDownVisual(
                    "d:/ymir work/ui/public/small_thin_button_03.sub")

            button.SetWindowHorizontalAlignCenter()
            button.SetText(buttonName)
            button.Hide()
            self.buttonDict[buttonName] = button
            self.showingButtonList.append(button)

        self.buttonDict[locale.TARGET_BUTTON_WHISPER].SetEvent(
            ui.__mem_func__(self.OnWhisper))
        self.buttonDict[locale.TARGET_BUTTON_EXCHANGE].SetEvent(
            ui.__mem_func__(self.OnExchange))
        self.buttonDict[locale.TARGET_BUTTON_FIGHT].SetEvent(
            ui.__mem_func__(self.OnPVP))
        self.buttonDict[locale.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(
            ui.__mem_func__(self.OnPVP))
        self.buttonDict[locale.TARGET_BUTTON_AVENGE].SetEvent(
            ui.__mem_func__(self.OnPVP))
        self.buttonDict[locale.TARGET_BUTTON_FRIEND].SetEvent(
            ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[locale.TARGET_BUTTON_FRIEND].SetEvent(
            ui.__mem_func__(self.OnAppendToMessenger))
        self.buttonDict[locale.TARGET_BUTTON_INVITE_PARTY].SetEvent(
            ui.__mem_func__(self.OnPartyInvite))
        self.buttonDict[locale.TARGET_BUTTON_LEAVE_PARTY].SetEvent(
            ui.__mem_func__(self.OnPartyExit))
        self.buttonDict[locale.TARGET_BUTTON_EXCLUDE].SetEvent(
            ui.__mem_func__(self.OnPartyRemove))

        self.buttonDict[locale.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(
            self.__OnGuildAddMember)
        self.buttonDict[locale.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(
            self.__OnDismount)
        self.buttonDict[locale.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(
            self.__OnExitObserver)
        self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(
            self.__OnViewEquipment)
        self.buttonDict[
            locale.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(
                self.__OnRequestParty)
        self.buttonDict[locale.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(
            self.__OnDestroyBuilding)
        self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(
            self.__OnEmotionAllow)

        self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(
            ui.__mem_func__(self.__OnVoteBlockChat))

        self.name = name
        self.hpGauge = hpGauge
        if app.ENABLE_SEND_TARGET_INFO:
            self.infoButton = infoButton
        if app.ENABLE_SEND_TARGET_INFO:
            self.vnum = 0
        self.closeButton = closeButton
        self.nameString = 0
        self.nameLength = 0
        self.vid = 0
        self.eventWhisper = None
        self.isShowButton = FALSE

        self.__Initialize()
        self.ResetTargetBoard()
        self.healthBoard = uiHealth.HealthBoard()
예제 #29
0
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return
		self.isLoaded = 1
		try:
			pyScrLoader = ui.PythonScriptLoader()			
			pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "dragonsoulwindow.py")
		
		except:
			import exception
			exception.Abort("dragonsoulwindow.LoadWindow.LoadObject")
		try:
			if locale.IsARABIC():
				self.board = self.GetChild("Equipment_Base")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				self.board = self.GetChild("Tab_01")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				self.board = self.GetChild("Tab_02")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				self.board = self.GetChild("Tab_03")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				self.board = self.GetChild("Tab_04")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				self.board = self.GetChild("Tab_05")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				self.board = self.GetChild("Tab_06")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				
			wndItem = self.GetChild("ItemSlot")
			wndEquip = self.GetChild("EquipmentSlot")
			self.activateButton = self.GetChild("activate")
			self.deckTab = []
			self.deckTab.append(self.GetChild("deck1"))
			self.deckTab.append(self.GetChild("deck2"))
			self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))			
			self.inventoryTab = []
			self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_03"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_04"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_05"))
			self.tabDict = {
				0	: self.GetChild("Tab_01"),
				1	: self.GetChild("Tab_02"),
				2	: self.GetChild("Tab_03"),
				3	: self.GetChild("Tab_04"),
				4	: self.GetChild("Tab_05"),
				5	: self.GetChild("Tab_06"),
			}
			self.tabButtonDict = {
				0	: self.GetChild("Tab_Button_01"),
				1	: self.GetChild("Tab_Button_02"),
				2	: self.GetChild("Tab_Button_03"),
				3	: self.GetChild("Tab_Button_04"),
				4	: self.GetChild("Tab_Button_05"),
				5	: self.GetChild("Tab_Button_06"),
			}
			self.tabText = self.GetChild("tab_text_area")
		except:
			import exception
			exception.Abort("InventoryWindow.LoadWindow.BindObject")
		## DragonSoul Kind Tap
		for (tabKey, tabButton) in self.tabButtonDict.items():
			tabButton.SetEvent(ui.__mem_func__(self.SetDSKindIndex), tabKey)
		## Item
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
		wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
		wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
		
		## Equipment
		wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptyEquipSlot))
		wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectEquipItemSlot))
		wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseEquipItemSlot))
		wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseEquipItemSlot))
		wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInEquipItem))
		wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutEquipItem))
		
		## Deck
		self.deckTab[0].SetToggleDownEvent(lambda arg=0: self.SetDeckPage(arg))
		self.deckTab[1].SetToggleDownEvent(lambda arg=1: self.SetDeckPage(arg))
		self.deckTab[0].SetToggleUpEvent(lambda arg=0: self.__DeckButtonDown(arg))
		self.deckTab[1].SetToggleUpEvent(lambda arg=1: self.__DeckButtonDown(arg))
		self.deckTab[0].Down()
		## Grade button
		self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
		self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
		self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg))
		self.inventoryTab[3].SetEvent(lambda arg=3: self.SetInventoryPage(arg))
		self.inventoryTab[4].SetEvent(lambda arg=4: self.SetInventoryPage(arg))
		self.inventoryTab[0].Down()
		## Etc
		self.wndItem = wndItem
		self.wndEquip = wndEquip
		
		self.dlgQuestion = uiCommon.QuestionDialog2()
		self.dlgQuestion.Close()
		
		self.activateButton.SetToggleDownEvent(ui.__mem_func__(self.ActivateButtonClick))
		self.activateButton.SetToggleUpEvent(ui.__mem_func__(self.ActivateButtonClick))
		self.wndPopupDialog = uiCommon.PopupDialog()
		
		## 
		self.listHighlightedSlot = []
		
		## Refresh
		self.SetInventoryPage(0)
		self.RefreshItemSlot()
		self.RefreshEquipSlotWindow()
		self.RefreshBagSlotWindow()
		self.SetDSKindIndex(0)
		self.activateButton.Enable()
		self.deckTab[self.deckPageIndex].Down()
		self.activateButton.SetUp()
예제 #30
0
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return
		self.isLoaded = 1
		try:
			pyScrLoader = ui.PythonScriptLoader()			
			pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "dragonsoulrefinewindow.py")

		except:
			import exception
			exception.Abort("dragonsoulrefinewindow.LoadWindow.LoadObject")
		try:
			if locale.IsARABIC():
				self.board = self.GetChild("DragonSoulRefineWindowBaseImage")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				
			wndRefineSlot = self.GetChild("RefineSlot")
			wndResultSlot = self.GetChild("ResultSlot")
			self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))			
			self.refineChoiceButtonDict = {
				self.REFINE_TYPE_GRADE	: self.GetChild("GradeButton"),
				self.REFINE_TYPE_STEP: self.GetChild("StepButton"),
				self.REFINE_TYPE_STRENGTH	: self.GetChild("StrengthButton"),
			}
			self.doRefineButton = self.GetChild("DoRefineButton")
			self.wndMoney = self.GetChild("Money_Slot")
		
		except:
			import exception
			exception.Abort("DragonSoulRefineWindow.LoadWindow.BindObject")
		
	
		## Item Slots
		wndRefineSlot.SetOverInItemEvent(ui.__mem_func__(self.__OverInRefineItem))
		wndRefineSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutItem))
		wndRefineSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.__SelectRefineEmptySlot))
		wndRefineSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot))
		wndRefineSlot.SetUseSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot))
		wndRefineSlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot))
		
		wndResultSlot.SetOverInItemEvent(ui.__mem_func__(self.__OverInResultItem))
		wndResultSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutItem))
		self.wndRefineSlot = wndRefineSlot
		self.wndResultSlot = wndResultSlot
		
		## Button
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].SetToggleDownEvent(self.__ToggleDownGradeButton)
		self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetToggleDownEvent(self.__ToggleDownStepButton)
		self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetToggleDownEvent(self.__ToggleDownStrengthButton)
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_GRADE))
		self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_STEP))
		self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_STRENGTH))
		self.doRefineButton.SetEvent(self.__PressDoRefineButton)
		
		## Dialog
		self.wndPopupDialog = uiCommon.PopupDialog()
		
		self.currentRefineType = self.REFINE_TYPE_GRADE
		self.refineItemInfo = {}
		self.resultItemInfo = {}
		self.currentRecipe = {}
		
		self.wndMoney.SetText(locale.NumberToMoneyString(0))
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].Down()
		
		self.__Initialize()