예제 #1
0
	def Refresh(self):
		for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT):
			itemCount = shop.GetOfflineShopItemCount(i)
			if (itemCount <= 1):
				itemCount = 0
			self.itemSlotWindow.SetItemSlot(i, shop.GetOfflineShopItemID(i), itemCount)
			
		wndMgr.RefreshSlot(self.itemSlotWindow.GetWindowHandle())
예제 #2
0
    def Refresh(self):
        net.SendRefreshOfflineShop()
        iCount = 0
        for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT):
            if (shop.GetOfflineShopItemID(i) == -842150451):
                iCount = iCount + 1

        if (iCount == shop.OFFLINE_SHOP_SLOT_COUNT):
            chat.AppendChat(chat.CHAT_TYPE_INFO, "Pazar'da suan birsey yok.")
            return

        for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT):
            itemCount = shop.GetOfflineShopItemCount(i)
            if (itemCount <= 1):
                itemCount = 0

            self.itemSlot.SetItemSlot(i, shop.GetOfflineShopItemID(i))

        wndMgr.RefreshSlot(self.itemSlot.GetWindowHandle())
예제 #3
0
	def Refresh(self):
		net.SendRefreshUnsoldItems()
		iCount = 0
		for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT):
			if (shop.GetOfflineShopItemID(i) == -842150451):
				iCount = iCount + 1
				
		if (iCount == shop.OFFLINE_SHOP_SLOT_COUNT):
			chat.AppendChat(chat.CHAT_TYPE_INFO, "You have nothing in offline shop at the moment.")
			return
			
		for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT):
			itemCount = shop.GetOfflineShopItemCount(i)
			if (itemCount <= 1):
				itemCount = 0
					
			self.itemSlot.SetItemSlot(i, shop.GetOfflineShopItemID(i))
		
		wndMgr.RefreshSlot(self.itemSlot.GetWindowHandle())
예제 #4
0
    def UnselectItemSlot(self, selectedSlotPos):
        if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1):
            return

        itemIndex = shop.GetOfflineShopItemID(selectedSlotPos)
        item.SelectItem(itemIndex)
        itemName = item.GetItemName()

        priceInputBoard = uiCommon.MoneyInputDialog()
        priceInputBoard.SetTitle(itemName + "Yeni fiyat")
        priceInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrice))
        priceInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrice))
        priceInputBoard.Open()
        self.priceInputBoard = priceInputBoard
        self.priceInputBoard.pos = selectedSlotPos
예제 #5
0
	def UnselectItemSlot(self, selectedSlotPos):
		if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1):
			return
			
		itemIndex = shop.GetOfflineShopItemID(selectedSlotPos)
		item.SelectItem(itemIndex)
		itemName = item.GetItemName()
		
		questionDialog = uiCommon.QuestionDialog()
		questionDialog.SetText(localeInfo.DO_YOU_WANT_TO_REMOVE_ITEM % (itemName))
		questionDialog.SetAcceptEvent(lambda arg = True : self.AnswerRemoveItem(arg))
		questionDialog.SetCancelEvent(lambda arg = False : self.AnswerRemoveItem(arg))
		questionDialog.Open()
		questionDialog.pos = selectedSlotPos
		self.questionDialog = questionDialog
		
		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
예제 #6
0
	def AskBuyItem(self, slotPos):
		itemIndex = shop.GetOfflineShopItemID(slotPos)
		itemPrice = shop.GetOfflineShopItemPrice(slotPos)
		itemCount = shop.GetOfflineShopItemCount(slotPos)

		item.SelectItem(itemIndex)
		itemName = item.GetItemName()

		itemBuyQuestionDialog = uiCommon.QuestionDialog()
		itemBuyQuestionDialog.SetText(localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, localeInfo.NumberToMoneyString(itemPrice)))
		itemBuyQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerBuyItem(arg))
		itemBuyQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerBuyItem(arg))
		itemBuyQuestionDialog.Open()
		itemBuyQuestionDialog.pos = slotPos
		self.itemBuyQuestionDialog = itemBuyQuestionDialog
		
		constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
예제 #7
0
	def SelectItemSlot(self, selectedSlotPos):
		if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1):
			return
			
		isAttached = mouseModule.mouseController.isAttached()
		if (not isAttached):
			curCursorNum = app.GetCursor()
			if (app.BUY == curCursorNum):
				net.SendOfflineShopBuyPacket(selectedSlotPos)
			else:
				selectedItemID = shop.GetOfflineShopItemID(selectedSlotPos)
				itemCount = shop.GetOfflineShopItemCount(selectedSlotPos)
				
				type = player.SLOT_TYPE_OFFLINE_SHOP
				mouseModule.mouseController.AttachObject(self, type, selectedSlotPos, selectedItemID, itemCount)
				mouseModule.mouseController.SetCallBack("INVENTORY", ui.__mem_func__(self.DropToInventory))
				snd.PlaySound("sound/ui/pick.wav")