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