示例#1
0
	def OverInItem(self, slotNumber):
		if mouseModule.mouseController.isAttached():
			return

		(Type, Position) = player.GetLocalQuickSlot(slotNumber)

		if player.SLOT_TYPE_INVENTORY == Type:
			self.tooltipItem.SetInventoryItem(Position)
			self.tooltipSkill.HideToolTip()

		elif player.SLOT_TYPE_SKILL == Type:

			skillIndex = player.GetSkillIndex(Position)
			skillType = skill.GetSkillType(skillIndex)

			if skill.SKILL_TYPE_GUILD == skillType:
				import guild
				skillGrade = 0
				skillLevel = guild.GetSkillLevel(Position)

			else:
				skillGrade = player.GetSkillGrade(Position)
				skillLevel = player.GetSkillLevel(Position)

			self.tooltipSkill.SetSkillNew(Position, skillIndex, skillGrade, skillLevel)
			self.tooltipItem.HideToolTip()
示例#2
0
	def OnDeactivateSkill(self, usedSlotIndex):
		slotIndex = 0

		## Current Skill Button
		if usedSlotIndex == self.curSkillButton.GetSlotIndex():
			self.curSkillButton.Deactivate()

		## Quick Slot
		for slotWindow in self.quickslot:

			for i in xrange(4):

				(Type, Position) = player.GetLocalQuickSlot(slotIndex)

				if Type == player.SLOT_TYPE_SKILL:
					if usedSlotIndex == Position:
						slotWindow.DeactivateSlot(slotIndex)
						return

				slotIndex += 1
示例#3
0
	def OnUseSkill(self, usedSlotIndex, coolTime):

		QUICK_SLOT_SLOT_COUNT = 4
		slotIndex = 0

		## Current Skill Button
		if usedSlotIndex == self.curSkillButton.GetSlotIndex():
			self.curSkillButton.Activate(coolTime)

		## Quick Slot
		for slotWindow in self.quickslot:

			for i in xrange(QUICK_SLOT_SLOT_COUNT):

				(Type, Position) = player.GetLocalQuickSlot(slotIndex)

				if Type == player.SLOT_TYPE_SKILL:
					if usedSlotIndex == Position:
						slotWindow.SetSlotCoolTime(slotIndex, coolTime)
						return

				slotIndex += 1
示例#4
0
	def RefreshQuickSlot(self):

		pageNum = player.GetQuickPage()

		try:
			self.quickPageNumImageBox.LoadImage(TaskBar.QUICKPAGE_NUMBER_FILENAME[pageNum])
		except:
			pass

		startNumber = 0
		for slot in self.quickslot:

			for i in xrange(4):

				slotNumber = i+startNumber

				(Type, Position) = player.GetLocalQuickSlot(slotNumber)

				if player.SLOT_TYPE_NONE == Type:
					slot.ClearSlot(slotNumber)
					continue

				if player.SLOT_TYPE_INVENTORY == Type:

					itemIndex = player.GetItemIndex(Position)
					itemCount = player.GetItemCount(Position)
					if itemCount <= 1:
						itemCount = 0

					## 자동물약 (#72723, #72724) 특수처리 - 아이템인데도 슬롯에 활성화/비활성화 표시를 위한 작업임 - [hyo]
					if constInfo.IS_AUTO_POTION(itemIndex):
						# metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
						metinSocket = [player.GetItemMetinSocket(Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]

						if 0 != int(metinSocket[0]):
							slot.ActivateSlot(slotNumber)
						else:
							slot.DeactivateSlot(slotNumber)

					slot.SetItemSlot(slotNumber, itemIndex, itemCount)

				elif player.SLOT_TYPE_SKILL == Type:

					skillIndex = player.GetSkillIndex(Position)
					if 0 == skillIndex:
						slot.ClearSlot(slotNumber)
						continue

					skillType = skill.GetSkillType(skillIndex)
					if skill.SKILL_TYPE_GUILD == skillType:
						import guild
						skillGrade = 0
						skillLevel = guild.GetSkillLevel(Position)

					else:
						skillGrade = player.GetSkillGrade(Position)
						skillLevel = player.GetSkillLevel(Position)

					slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel)
					slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
					slot.SetCoverButton(slotNumber)

					## NOTE : CoolTime 체크
					if player.IsSkillCoolTime(Position):
						(coolTime, elapsedTime) = player.GetSkillCoolTime(Position)
						slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)

					## NOTE : Activate 되어 있다면 아이콘도 업데이트
					if player.IsSkillActive(Position):
						slot.ActivateSlot(slotNumber)

				elif player.SLOT_TYPE_EMOTION == Type:

					emotionIndex = Position
					slot.SetEmotionSlot(slotNumber, emotionIndex)
					slot.SetCoverButton(slotNumber)
					slot.SetSlotCount(slotNumber, 0)

			slot.RefreshSlot()
			startNumber += 4
示例#5
0
    def RefreshQuickSlot(self):

        pageNum = player.GetQuickPage()

        try:
            self.quickPageNumImageBox.LoadImage(
                TaskBar.QUICKPAGE_NUMBER_FILENAME[pageNum])
        except:
            pass

        startNumber = 0
        for slot in self.quickslot:

            for i in xrange(4):

                slotNumber = i + startNumber

                (Type, Position) = player.GetLocalQuickSlot(slotNumber)

                if player.SLOT_TYPE_NONE == Type:
                    slot.ClearSlot(slotNumber)
                    continue

                if player.SLOT_TYPE_INVENTORY == Type:

                    itemIndex = player.GetItemIndex(Position)
                    itemCount = player.GetItemCount(Position)
                    if itemCount <= 1:
                        itemCount = 0

                    if constInfo.IS_AUTO_POTION(itemIndex):
                        metinSocket = [
                            player.GetItemMetinSocket(Position, j)
                            for j in xrange(player.METIN_SOCKET_MAX_NUM)
                        ]

                        if 0 != int(metinSocket[0]):
                            slot.ActivateSlot(slotNumber)
                        else:
                            slot.DeactivateSlot(slotNumber)

                    if app.ENABLE_GROWTH_PET_SYSTEM:
                        if constInfo.IS_PET_ITEM(itemIndex):
                            self.__SetCoolTimePetItemSlot(
                                slot, Position, slotNumber, itemIndex)

                            slot.DeactivateSlot(slotNumber)

                            active_id = player.GetActivePetItemId()
                            if active_id and active_id == player.GetItemMetinSocket(
                                    Position, 2):
                                slot.ActivateSlot(slotNumber)

                    slot.SetItemSlot(slotNumber, itemIndex, itemCount)

                elif player.SLOT_TYPE_SKILL == Type:

                    skillIndex = player.GetSkillIndex(Position)
                    if 0 == skillIndex:
                        slot.ClearSlot(slotNumber)
                        continue

                    skillType = skill.GetSkillType(skillIndex)
                    if skill.SKILL_TYPE_GUILD == skillType:
                        import guild
                        skillGrade = 0
                        skillLevel = guild.GetSkillLevel(Position)

                    else:
                        skillGrade = player.GetSkillGrade(Position)
                        skillLevel = player.GetSkillLevel(Position)

                    slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade,
                                         skillLevel)
                    slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
                    slot.SetCoverButton(slotNumber)

                    if player.IsSkillCoolTime(Position):
                        (coolTime,
                         elapsedTime) = player.GetSkillCoolTime(Position)
                        slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)

                    if player.IsSkillActive(Position):
                        slot.ActivateSlot(slotNumber)

                elif player.SLOT_TYPE_EMOTION == Type:

                    emotionIndex = Position
                    slot.SetEmotionSlot(slotNumber, emotionIndex)
                    slot.SetCoverButton(slotNumber)
                    slot.SetSlotCount(slotNumber, 0)

            slot.RefreshSlot()
            startNumber += 4