Example #1
0
	def SelectItemSlot(self, selectedSlotPos):

		selectedSlotPos = self.__LocalPosToGlobalPos(selectedSlotPos)

		if mouseModule.mouseController.isAttached():

			attachedSlotType = mouseModule.mouseController.GetAttachedType()

			if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_INVENTORY == attachedSlotType:

				if fgGHGjjFHJghjfFG1545gGG.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
					GFHhg54GHGhh45GHGH.SendSafeboxSaveMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
					snd.PlaySound("sound/ui/money.wav")

				else:
					attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
					#GFHhg54GHGhh45GHGH.SendSafeboxCheckinPacket(attachedSlotPos, selectedSlotPos)
					#snd.PlaySound("sound/ui/drop.wav")

			mouseModule.mouseController.DeattachObject()

		else:

			curCursorNum = app.GetCursor()
			if app.SELL == curCursorNum:
				chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SAFEBOX_SELL_DISABLE_SAFEITEM)

			elif app.BUY == curCursorNum:
				chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)

			else:
				selectedItemID = safebox.GetItemID(selectedSlotPos)
				mouseModule.mouseController.AttachObject(self, fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_SAFEBOX, selectedSlotPos, selectedItemID)
				snd.PlaySound("sound/ui/pick.wav")
Example #2
0
    def OnSelectItemSlot(self, selectedSlotPos):

        isAttached = mouseModule.mouseController.isAttached()
        if isAttached:
            snd.PlaySound("sound/ui/loginfail.wav")
            mouseModule.mouseController.DeattachObject()

        else:
            if not selectedSlotPos in self.itemStock:
                return

            invenType, invenPos = self.itemStock[selectedSlotPos]
            shop.DelPrivateShopItemStock(invenType, invenPos)
            snd.PlaySound("sound/ui/drop.wav")

            if app.ENABLE_SLOT_MARKING_SYSTEM:
                (itemInvenPage,
                 itemSlotPos) = self.lockedItems[selectedSlotPos]
                if itemInvenPage == self.wndInventory.GetInventoryPageIndex():
                    self.wndInventory.wndItem.SetCanMouseEventSlot(itemSlotPos)

                self.lockedItems[selectedSlotPos] = (-1, -1)

            del self.itemStock[selectedSlotPos]

            self.Refresh()
	def OnSelectItemSlot(self, selectedSlotPos):
		isAttached = mouseModule.mouseController.isAttached()
		if isAttached:
			snd.PlaySound("sound/ui/loginfail.wav")
			mouseModule.mouseController.DeattachObject()
			self.UI["board"].Hide()
		else:
			if not int(selectedSlotPos) in constInfo.gift_items.keys():
				self.UI["board"].Hide()
				return

			snd.PlaySound("sound/ui/drop.wav")
			self.Get(selectedSlotPos)
	def OnSelectItemSlot(self, selectedSlotPos):
		isAttached = mouseModule.mouseController.isAttached()
		if (isAttached):
			snd.PlaySound("sound/ui/loginfail.wav")
			mouseModule.mouseController.DeattachObject()

		else:
			if (not selectedSlotPos in self.itemStock):
				return

			invenType, invenPos = self.itemStock[selectedSlotPos]
			shop.DelOfflineShopItemStock(invenType, invenPos)
			snd.PlaySound("sound/ui/drop.wav")
			del self.itemStock[selectedSlotPos]
			self.Refresh()
    def EventProgress(self, event_type, slot):
        if self.Disable:
            return

        if "mouse_click" == event_type:
            if slot == self.SelectSlot:
                return

            snd.PlaySound("sound/ui/click.wav")
            self.SelectButton(slot)
        elif "mouse_over_in" == event_type:
            for button in self.CharacterButtonList:
                button.SetUp()

            self.CharacterButtonList[slot].Over()
            self.CharacterButtonList[self.SelectSlot].Down()
            self.OverInToolTip(slot)
        elif "mouse_over_out" == event_type:
            for button in self.CharacterButtonList:
                button.SetUp()

            self.CharacterButtonList[self.SelectSlot].Down()
            self.OverOutToolTip()
        else:
            print " New_introSelect.py ::EventProgress : FALSE"
Example #6
0
    def OnLoginFailure(self, error):
        if self.connectingDialog:
            self.connectingDialog.Close()
        self.connectingDialog = None

        try:
            loginFailureMsg = self.loginFailureMsgDict[error]
        except KeyError:
            if PASSPOD_MSG_DICT:
                try:
                    loginFailureMsg = PASSPOD_MSG_DICT[error]
                except KeyError:
                    loginFailureMsg = locale.LOGIN_FAILURE_UNKNOWN + error
            else:
                loginFailureMsg = locale.LOGIN_FAILURE_UNKNOWN + error

        #0000685: [M2EU] ŸÆÀ̵ð/ºñ¹Ð¹øÈ£ À¯Ãß °¡ŽÉ ¹ö±× ŒöÁ€: ¹«Á¶°Ç ÆÐœº¿öµå·Î Æ÷Ä¿œº°¡ °¡°Ô žžµçŽÙ
        loginFailureFunc = self.loginFailureFuncDict.get(
            error, self.SetPasswordEditLineFocus)

        if app.loggined:
            self.PopupNotifyMessage(loginFailureMsg, self.__ExitGame)
        else:
            self.PopupNotifyMessage(loginFailureMsg, loginFailureFunc)

        snd.PlaySound("sound/ui/loginfail.wav")
Example #7
0
	def OnSetReelResult(self, slotPos):
		# Try to get network itemVnum.
		try:
			itemVnum = SLOT_MACHINE_REELS[self.reelResult[slotPos]]
		except IndexError:
			itemVnum = 63017

		# 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()

		# Check if reel slot is unique.
		if self.reelResult[slotPos] <= SLOT_MACHINE_MAX_JACKPOTS:
			if ENABLE_SOUND:
				# Play jackpot reel icon sound.
				snd.PlaySound("sound/ui/quest_receive.wav")

			if ENABLE_EFFECT:
				# Show reel boom effect.
				if self.reelIconEffectList and not self.isInformationPage:
					self.reelIconEffectList[slotPos].ResetFrame()
					self.reelIconEffectList[slotPos].Show()
Example #8
0
    def __SelectSlot(self, slot):

        if slot < 0:
            return

        if slot >= SLOT_COUNT:
            return

        if self.slot == slot:
            return

        self.slot = slot

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

        chr_id = self.__GetSlotChrID(self.gender, slot)

        for id in xrange(BASE_CHR_ID + SLOT_COUNT * PAGE_COUNT):
            chr.DeleteInstance(id)

        chr.SelectInstance(chr_id)

        for i in xrange(len(self.char)):
            self.char[i].SetUp()

        self.char[slot].Down()

        self.__MakeCharacter(chr_id, self.characters[self.gender][slot])
        self.__SelectShape(self.shape)
        self.__SelectGender(self.gender)
Example #9
0
	def OnLoginFailure(self, error):
		if self.connectingDialog:
			self.connectingDialog.Close()
		self.connectingDialog = None

		try:
			loginFailureMsg = self.loginFailureMsgDict[error]
		except KeyError:
			if PASSPOD_MSG_DICT:
				try:
					loginFailureMsg = PASSPOD_MSG_DICT[error]
				except KeyError:
					loginFailureMsg = localeInfo.LOGIN_FAILURE_UNKNOWN + error
			else:
				loginFailureMsg = localeInfo.LOGIN_FAILURE_UNKNOWN  + error


		#0000685: [M2EU] 아이디/비밀번호 유추 가능 버그 수정: 무조건 패스워드로 포커스가 가게 만든다
		loginFailureFunc=self.loginFailureFuncDict.get(error, self.SetPasswordEditLineFocus)

		if app.loggined:
			self.PopupNotifyMessage(loginFailureMsg, self.__ExitGame)
		else:
			self.PopupNotifyMessage(loginFailureMsg, loginFailureFunc)

		snd.PlaySound("sound/ui/loginfail.wav")
	def SelectEmptySlot(self, selectedSlotPos):

		selectedSlotPos = self.__LocalPosToGlobalPos(selectedSlotPos)

		if mouseModule.mouseController.isAttached():

			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()

			if player.SLOT_TYPE_SAFEBOX == attachedSlotType:

				net.SendSafeboxItemMovePacket(attachedSlotPos, selectedSlotPos, 0)
				#snd.PlaySound("sound/ui/drop.wav")
			else:
				attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
				if player.RESERVED_WINDOW == attachedInvenType:
					return
					
				if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
					net.SendSafeboxSaveMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
					snd.PlaySound("sound/ui/money.wav")

				else:
					net.SendSafeboxCheckinPacket(attachedInvenType, attachedSlotPos, selectedSlotPos)
					#snd.PlaySound("sound/ui/drop.wav")
			
			mouseModule.mouseController.DeattachObject()
Example #11
0
    def OpenPickMoneyDialog(self):

        if mouseModule.mouseController.isAttached():

            attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber(
            )
            if player.SLOT_TYPE_SAFEBOX == mouseModule.mouseController.GetAttachedType(
            ):

                if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex(
                ):
                    net.SendSafeboxWithdrawMoneyPacket(
                        mouseModule.mouseController.GetAttachedItemCount())
                    snd.PlaySound("sound/ui/money.wav")

            mouseModule.mouseController.DeattachObject()

        else:
            curMoney = player.GetElk()

            if curMoney <= 0:
                return

            self.dlgPickMoney.SetTitleName(localeInfo.PICK_MONEY_TITLE)
            self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
            self.dlgPickMoney.Open(curMoney)
            self.dlgPickMoney.SetMax(7)  # 인벤토리 990000 제한 버그 수정
	def AcceptInputPrice(self):
		if (not self.priceInputBoard):
			return True

		text = self.priceInputBoard.GetText()
		if (not text):
			return True

		if (not text.isdigit()):
			return True

		if (int(text) <= 0):
			return True

		attachedInvenType = self.priceInputBoard.sourceWindowType
		sourceSlotPos = self.priceInputBoard.sourceSlotPos
		targetSlotPos = self.priceInputBoard.targetSlotPos

		for privatePos, (itemWindowType, itemSlotIndex) in self.itemStock.items():
			if (itemWindowType == attachedInvenType and itemSlotIndex == sourceSlotPos):
				shop.DelOfflineShopItemStock(itemWindowType, itemSlotIndex)
				del self.itemStock[privatePos]

		price = int(self.priceInputBoard.GetText())

		if (IsOfflineShopItemPriceList()):	
			SetOfflineShopItemPrice(self.priceInputBoard.itemVNum, price)

		shop.AddOfflineShopItemStock(attachedInvenType, sourceSlotPos, targetSlotPos, price)
		self.itemStock[targetSlotPos] = (attachedInvenType, sourceSlotPos)
		snd.PlaySound("sound/ui/drop.wav")
		
		self.Refresh()
		self.priceInputBoard = None
		return True
    def SelectItemSlot(self, selectedSlotPos):
        if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
            return

        isAttached = mouseModule.mouseController.isAttached()
        selectedSlotPos = self.__GetRealIndex(selectedSlotPos)
        if isAttached:
            self.SellAttachedItem()

        else:

            if True == shop.IsMainPlayerPrivateShop():
                return

            curCursorNum = app.GetCursor()
            if app.BUY == curCursorNum:
                self.AskBuyItem(selectedSlotPos)

            elif app.SELL == curCursorNum:
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_SELL_INFO)

            else:
                selectedItemID = shop.GetItemID(selectedSlotPos)
                itemCount = shop.GetItemCount(selectedSlotPos)

                type = player.SLOT_TYPE_SHOP
                if shop.IsPrivateShop():
                    type = player.SLOT_TYPE_PRIVATE_SHOP

                mouseModule.mouseController.AttachObject(
                    self, type, selectedSlotPos, selectedItemID, itemCount)
                mouseModule.mouseController.SetCallBack(
                    "INVENTORY", ui.__mem_func__(self.DropToInventory))
                snd.PlaySound("sound/ui/pick.wav")
    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

        self.empireName.SetText(self.EMPIRE_NAME.get(self.empireID, ""))
        rgb = self.EMPIRE_NAME_COLOR[self.empireID]
        self.empireName.SetFontColor(rgb[0], rgb[1], rgb[2])
        snd.PlaySound("sound/ui/click.wav")

        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])

            #event.SetFontColor(self.descIndex, 0.7843, 0.7843, 0.7843)

            if localeInfo.IsARABIC():
                event.SetEventSetWidth(self.descIndex, 170)
            else:
                event.SetRestrictedCount(self.descIndex, 35)

        if event.BOX_VISIBLE_LINE_COUNT >= event.GetTotalLineCount(
                self.descIndex):
            self.btnPrev.Hide()
            self.btnNext.Hide()
        else:
            self.btnPrev.Show()
            self.btnNext.Show()
Example #15
0
    def AcceptEditPrice(self):

        if not self.priceInputBoard:
            return True

        text = self.priceInputBoard.GetText()

        if not text:
            return True

        if not text.isdigit():
            return True

        if int(text) <= 0:
            return True

        targetSlotPos = self.priceInputBoard.targetSlotPos
        price = int(self.priceInputBoard.GetText())
        #self.ItemSlot.DeactivateSlot(int(targetSlotPos))
        self.items[int(targetSlotPos)]["price"] = price
        snd.PlaySound("sound/ui/drop.wav")
        net.SendChatPacket("/update_shop_item price|" + str(self.id) + "|" +
                           str(self.items[int(targetSlotPos)]["id"]) + "|" +
                           str(price))
        self.Refresh()
        self.priceInputBoard = None
        return True
	def SelectEquipItemSlot(self, itemSlotIndex):
		if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
			return

		itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(player.INVENTORY, itemSlotIndex)

		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			# 자기 자신을 자기 자신에게 드래그하는 경우
			if player.SLOT_TYPE_INVENTORY == attachedSlotType and itemSlotIndex == attachedSlotPos:
				return
 
			attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
				
			attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
			if player.RESERVED_WINDOW != attachedInvenType:
				net.SendItemUseToItemPacket(attachedInvenType, attachedSlotPos, player.INVENTORY, itemSlotIndex)

			mouseModule.mouseController.DeattachObject()
		else:
			selectedItemVNum = player.GetItemIndex(player.INVENTORY, itemSlotIndex)
			itemCount = player.GetItemCount(player.INVENTORY, itemSlotIndex)
			mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
			self.wndItem.SetUseMode(FALSE)
			snd.PlaySound("sound/ui/pick.wav")
Example #17
0
	def SelectEmptySlot(self, selectedSlotPos):

		selectedSlotPos = self.__LocalPosToGlobalPos(selectedSlotPos)

		if mouseModule.mouseController.isAttached():

			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			
			if constInfo.BlockItemsSystem["Block"] == 1:
				chat.AppendChat(1, "Sicherheitssystem ist Aktiviert.")
				return
			
			if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_SAFEBOX == attachedSlotType:

				GFHhg54GHGhh45GHGH.SendSafeboxItemMovePacket(attachedSlotPos, selectedSlotPos, 0)
				#snd.PlaySound("sound/ui/drop.wav")
			else:
				attachedInvenType = fgGHGjjFHJghjfFG1545gGG.SlotTypeToInvenType(attachedSlotType)
				if fgGHGjjFHJghjfFG1545gGG.RESERVED_WINDOW == attachedInvenType:
					return
					
				if fgGHGjjFHJghjfFG1545gGG.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
					GFHhg54GHGhh45GHGH.SendSafeboxSaveMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
					snd.PlaySound("sound/ui/money.wav")

				else:
					GFHhg54GHGhh45GHGH.SendSafeboxCheckinPacket(attachedInvenType, attachedSlotPos, selectedSlotPos)
					#snd.PlaySound("sound/ui/drop.wav")
			
			mouseModule.mouseController.DeattachObject()
Example #18
0
    def OnSelectItemSlot(self, selectedSlotPos):
        isAttached = mouseModule.mouseController.isAttached()
        #selectedSlotPos = self.__GetRealIndex(selectedSlotPos)
        if isAttached:
            snd.PlaySound("sound/ui/loginfail.wav")
            #self.ItemSlot.DeactivateSlot(int(selectedSlotPos))
            mouseModule.mouseController.DeattachObject()
            self.Edit["Board"].Hide()
        else:
            if not int(selectedSlotPos) in self.items.keys():
                self.Edit["Board"].Hide()
                return

            snd.PlaySound("sound/ui/drop.wav")
            #self.ItemSlot.ActivateSlot(selectedSlotPos)
            self.EditItem(selectedSlotPos)
Example #19
0
	def SellItem(self):
		if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
			if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
				## 용혼석도 팔리게 하는 기능 추가하면서 인자 type 추가
				net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
				snd.PlaySound("sound/ui/money.wav")
		self.OnCloseQuestionDialog()
Example #20
0
	def SelectItemSlot(self, itemSlotIndex):
		if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
			return

		itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)

		if mouseModule.mouseController.isAttached():
			attachedSlotType = mouseModule.mouseController.GetAttachedType()
			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
			attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()

			if player.SLOT_TYPE_INVENTORY == attachedSlotType:
				self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex)

			mouseModule.mouseController.DeattachObject()

		else:

			curCursorNum = app.GetCursor()
			if app.SELL == curCursorNum:
				self.__SellItem(itemSlotIndex)
				
			elif app.BUY == curCursorNum:
				chat.AppendChat(chat.CHAT_TYPE_INFO, locale.SHOP_BUY_INFO)

			elif app.IsPressed(app.DIK_LALT):
				link = player.GetItemLink(itemSlotIndex)
				ime.PasteString(link)

			elif app.IsPressed(app.DIK_LSHIFT):
				itemCount = player.GetItemCount(itemSlotIndex)
				
				if itemCount > 1:
					self.dlgPickMoney.SetTitleName(locale.PICK_ITEM_TITLE)
					self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
					self.dlgPickMoney.Open(itemCount)
					self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex
				#else:
					#selectedItemVNum = player.GetItemIndex(itemSlotIndex)
					#mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum)

			elif app.IsPressed(app.DIK_LCONTROL):
				itemIndex = player.GetItemIndex(itemSlotIndex)

				if TRUE == item.CanAddToQuickSlotItem(itemIndex):
					player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
				else:
					chat.AppendChat(chat.CHAT_TYPE_INFO, locale.QUICKSLOT_REGISTER_DISABLE_ITEM)

			else:
				selectedItemVNum = player.GetItemIndex(itemSlotIndex)
				itemCount = player.GetItemCount(itemSlotIndex)
				mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
				
				if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex):				
					self.wndItem.SetUseMode(TRUE)
				else:					
					self.wndItem.SetUseMode(FALSE)

				snd.PlaySound("sound/ui/pick.wav")
Example #21
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])
Example #22
0
 def OnSellItem(self, slotPos, count, itemtype):
     import constInfo, chat
     if constInfo.BlockItemsSystem["Block"] == 1:
         chat.AppendChat(1, "Sicherheitssystem Aktiviert.")
         return
     GFHhg54GHGhh45GHGH.SendShopSellPacketNew(slotPos, count, itemtype)
     snd.PlaySound("sound/ui/money.wav")
     self.OnCloseQuestionDialog()
Example #23
0
    def __OnSelectItemSlot(self, selectedSlotPos):

        isAttached = mouseModule.mouseController.isAttached()
        if isAttached:
            snd.PlaySound("sound/ui/loginfail.wav")
            mouseModule.mouseController.DeattachObject()

        else:
            if not selectedSlotPos in self.cubeItemInfo:
                return

            snd.PlaySound("sound/ui/drop.wav")

            net.SendChatPacket("/cube del %d " % selectedSlotPos)
            del self.cubeItemInfo[selectedSlotPos]

            self.Refresh()
Example #24
0
    def __OnSelectItemSlot(self, selectedSlotPos):
        if selectedSlotPos == 2:
            return

        snd.PlaySound("sound/ui/loginfail.wav")
        self.acceSlot.ClearSlot(selectedSlotPos)
        net.SendChatPacket("/acce del %d " % selectedSlotPos)
        if selectedSlotPos == 0:
            self.slot_pos_index = 999
            self.slot_index1 = 999
            self.acceSlot.ClearSlot(2)
        elif selectedSlotPos == 1:
            self.slot_index2 = 999
            self.acceSlot.ClearSlot(2)

        if not selectedSlotPos in self.acceItemInfo:
            return

        del self.acceItemInfo[selectedSlotPos]

        isAttached = mouseModule.mouseController.isAttached()
        if isAttached:
            attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber(
            )
            if constInfo.IS_ACCE_ITEM(player.GetItemIndex(attachedSlotPos),
                                      0) == TRUE:
                if selectedSlotPos == 2:
                    return

                if selectedSlotPos == 0:
                    self.slot_pos_index = attachedSlotPos

                if self.slot_index1 == attachedSlotPos and selectedSlotPos == 0 or self.slot_index2 == attachedSlotPos and selectedSlotPos == 1:
                    return
                elif self.slot_index2 == attachedSlotPos and selectedSlotPos == 0 or self.slot_index1 == attachedSlotPos and selectedSlotPos == 1:
                    return

                if selectedSlotPos == 0:
                    self.slot_index1 = attachedSlotPos
                elif selectedSlotPos == 1:
                    self.slot_index2 = attachedSlotPos

                for slotPos, invenPos in self.acceItemInfo.items():
                    if invenPos == attachedSlotPos:
                        del self.acceItemInfo[slotPos]

                self.acceItemInfo[selectedSlotPos] = attachedSlotPos
                self.acceSlot.ClearSlot(selectedSlotPos)
                self.acceSlot.SetItemSlot(selectedSlotPos,
                                          player.GetItemIndex(attachedSlotPos),
                                          player.GetItemCount(attachedSlotPos))
                net.SendChatPacket("/acce add %d %d" %
                                   (selectedSlotPos, attachedSlotPos))

            mouseModule.mouseController.DeattachObject()

        self.Refresh()
Example #25
0
    def AcceptRemoveItem(self, slot):
        if int(slot) in self.items.keys():
            snd.PlaySound("sound/ui/drop.wav")
            net.SendChatPacket("/update_shop_item remove|" + str(self.id) +
                               "|" + str(self.items[int(slot)]["id"]))
            #self.ItemSlot.DeactivateSlot(int(slot))
            del self.items[int(slot)]
        self.Refresh()

        self.__OnClosePopupDialog()
Example #26
0
    def OnLoginFailure(self, error):
        try:
            loginFailureMsg = self.loginFailureMsgDict[error]
        except KeyError:

            loginFailureMsg = localeInfo.LOGIN_FAILURE_UNKNOWN  + error

        loginFailureFunc = self.loginFailureFuncDict.get(error, self.EmptyFunc)

        self.PopupNotifyMessage(loginFailureMsg, loginFailureFunc)

        snd.PlaySound("sound/ui/loginfail.wav")
Example #27
0
    def SellAttachedItem(self):

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

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()

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

            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 player.IsValuableItem(itemtype, attachedSlotPos):

                itemPrice = player.GetISellItemPrice(attachedSlotPos)

                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()
Example #28
0
    def SellAttachedItem(self):

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

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()
        if player.SLOT_TYPE_INVENTORY == attachedSlotType:

            itemIndex = player.GetItemIndex(attachedSlotPos)
            item.SelectItem(itemIndex)

            if item.IsAntiFlag(item.ANTIFLAG_SELL):
                popup = uiCommon.PopupDialog()
                popup.SetText(locale.SHOP_CANNOT_SELL_ITEM)
                popup.SetAcceptEvent(self.__OnClosePopupDialog)
                popup.Open()
                self.popup = popup

            elif player.IsValuableItem(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(
                    locale.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                            itemPrice))

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

            else:
                self.OnSellItem(attachedSlotPos, attachedCount)

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

        mouseModule.mouseController.DeattachObject()
Example #29
0
	def SelectItemSlot(self, selectedSlotPos):

		if mouseModule.mouseController.isAttached():

			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MALL_CANNOT_INSERT)
			mouseModule.mouseController.DeattachObject()

		else:

			curCursorNum = app.GetCursor()
			selectedItemID = safebox.GetMallItemID(selectedSlotPos)
			mouseModule.mouseController.AttachObject(self, fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_MALL, selectedSlotPos, selectedItemID)
			snd.PlaySound("sound/ui/pick.wav")
Example #30
0
	def OnLoginFailure(self, error):
		if error == "SENTRY":
			self.stream.popupWindow.Close()
			if not self.sentryDialog:
				self.sentryDialog = SentryDialog(self.OnExitSentryDialog)

			self.sentryDialog.Open()
			snd.PlaySound("sound/ui/loginfail.wav")

			return
			
		try:
			loginFailureMsg = self.loginFailureMsgDict[error]
		except KeyError:
		
			loginFailureMsg = localeInfo.LOGIN_FAILURE_UNKNOWN  + error

		loginFailureFunc = self.loginFailureFuncDict.get(error, self.EmptyFunc)

		self.PopupNotifyMessage(loginFailureMsg, loginFailureFunc)

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