def UnselectItemSlot(self, selectedSlotPos): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return if shop.IsPrivateShop(): self.AskBuyItem(selectedSlotPos) else: net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos))
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 UnselectItemSlot(self, selectedSlotPos): import constInfo, chat if constInfo.BlockItemsSystem["Block"] == 1: chat.AppendChat(1, "Sicherheitssystem Aktiviert.") return if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return if shop.IsPrivateShop(): self.AskBuyItem(selectedSlotPos) else: GFHhg54GHGhh45GHGH.SendShopBuyPacket( self.__GetRealIndex(selectedSlotPos))
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()
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()
def OverInItem(self, slotIndex): if not app.ENABLE_OFFLINE_SHOP: slotIndex = self.__GetRealIndex(slotIndex) if mouseModule.mouseController.isAttached(): return if 0 != self.tooltipItem: if app.ENABLE_OFFLINE_SHOP: IsPc = shop.IsPrivateShop() self.tooltipItem.SetShopItem(IsPc, slotIndex) else: if shop.SHOP_COIN_TYPE_GOLD == shop.GetTabCoinType( self.tabIdx): self.tooltipItem.SetShopItem(slotIndex) else: self.tooltipItem.SetShopItemBySecondaryCoin(slotIndex)
def UnselectItemSlot(self, selectedSlotPos): if shop.IsPrivateShop(): self.AskBuyItem(selectedSlotPos) else: net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos))
def SellAttachedItem(self): import constInfo, chat if constInfo.BlockItemsSystem["Block"] == 1: chat.AppendChat(1, "Sicherheitssystem Aktiviert.") return if shop.IsPrivateShop(): mouseModule.mouseController.DeattachObject() return attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedCount = mouseModule.mouseController.GetAttachedItemCount() if localeInfo.IsBRAZIL() == 0: attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex( ) if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_INVENTORY == attachedSlotType or fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType: if localeInfo.IsBRAZIL(): itemIndex = fgGHGjjFHJghjfFG1545gGG.GetItemIndex( attachedSlotPos) item.SelectItem(itemIndex) else: 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 = fgGHGjjFHJghjfFG1545gGG.INVENTORY if localeInfo.IsBRAZIL() == 0: if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType: itemtype = fgGHGjjFHJghjfFG1545gGG.DRAGON_SOUL_INVENTORY if fgGHGjjFHJghjfFG1545gGG.IsValuableItem(itemtype, 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( 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()
def OnTop(self): if not shop.IsPrivateShop(): self.interface.SetOnTopWindow(player.ON_TOP_WND_SHOP) self.interface.RefreshMarkInventoryBag()