def __UseItem(self, slotIndex):
if app.__ENABLE_NEW_OFFLINESHOP__:
if uiofflineshop.IsBuildingShop() and uiofflineshop.IsSaleSlot(player.INVENTORY, slotIndex):
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINESHOP_CANT_SELECT_ITEM_DURING_BUILING)
return
ItemVNum = player.GetItemIndex(slotIndex)
item.SelectItem(ItemVNum)
if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
self.questionDialog = uiCommon.QuestionDialog()
self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM2)
self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
self.questionDialog.Open()
self.questionDialog.slotIndex = slotIndex
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
elif app.IsPressed(app.DIK_LSHIFT):
if player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX or \
player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_TREASURE_BOX:
ItemVNum != 31374 and ItemVNum != 50255 and\
ItemVNum != 50187 and ItemVNum != 50197 and\
ItemVNum != 50188 and ItemVNum != 50189 and\
ItemVNum != 50190 and ItemVNum != 50191 and\
ItemVNum != 50192 and ItemVNum != 50193 and\
ItemVNum != 50194 and ItemVNum != 50195:
if app.ENABLE_SHOW_CHEST_DROP:
if self.interface:
if self.interface.dlgChestDrop:
if not self.interface.dlgChestDrop.IsShow():
self.interface.dlgChestDrop.Open(slotIndex)
net.SendChestDropInfo(slotIndex)
pass
else:
self.__SendUseItemPacket(slotIndex)