- Mesaj
- 88
- Çözümler
- 7
- Beğeni
- 50
- Puan
- 709
- Ticaret Puanı
- 0
Merhabalar eşya silme sisteminde her şey istediğim gibi gidiyor fakat silme ve satma butonlarını bir türlü çalıştıramadım.
Aldığım hata şu şekildedir:
Game.py içeriği şu şekilde olup RequestDestroyItem ve RequestSellItem eklidir.
Sizce nerede hata yapıyorum?
Aldığım hata şu şekildedir:
Python:
0430 22:19:20978 :: Traceback (most recent call last):
0430 22:19:20979 :: File "ui.py", line 1100, in CallEvent
0430 22:19:20979 :: File "game.py", line 1439, in <lambda>
0430 22:19:20979 :: AttributeError
0430 22:19:20979 :: :
0430 22:19:20980 :: 'GameWindow' object has no attribute 'RequestDestroyItem'
0430 22:19:20980 ::
0430 22:19:22033 :: Traceback (most recent call last):
0430 22:19:22033 :: File "ui.py", line 1100, in CallEvent
0430 22:19:22034 :: File "game.py", line 1440, in <lambda>
0430 22:19:22034 :: AttributeError
0430 22:19:22034 :: :
0430 22:19:22034 :: 'GameWindow' object has no attribute 'RequestSellItem'
0430 22:19:22034 ::
Game.py içeriği şu şekilde olup RequestDestroyItem ve RequestSellItem eklidir.
Python:
def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
# PRIVATESHOP_DISABLE_ITEM_DROP - ê°œ?¸ìƒ? ?´ê? ?ˆ?” ?™?ˆ ?„?´í…œ 버ë¦?ë°©ì?
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
return
# END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
self.stream.popupWindow.Close()
self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
else:
if player.SLOT_TYPE_INVENTORY == attachedType:
dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
item.SelectItem(dropItemIndex)
dropItemName = item.GetItemName()
## Question Text
questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP_NEW(dropItemName, attachedItemCount, localeInfo.NumberToMoneyString(player.GetISellItemPrice(attachedItemSlotPos)))
## Dialog
itemDropQuestionDialog = uiCommon.QuestionDialogItem()
itemDropQuestionDialog.SetText(questionText)
itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem(arg))
itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg))
itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
itemDropQuestionDialog.Open()
itemDropQuestionDialog.dropType = attachedType
itemDropQuestionDialog.dropNumber = attachedItemSlotPos
itemDropQuestionDialog.dropCount = attachedItemCount
self.itemDropQuestionDialog = itemDropQuestionDialog
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
# elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
# dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
item.SelectItem(dropItemIndex)
dropItemName = item.GetItemName()
## Question Text
questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP_NEW(dropItemName, attachedItemCount, localeInfo.NumberToMoneyString(player.GetISellItemPrice(attachedItemSlotPos)))
## Dialog
itemDropQuestionDialog = uiCommon.QuestionDialogItem()
itemDropQuestionDialog.SetText(questionText)
itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
itemDropQuestionDialog.SetDestroyEvent(lambda arg=True: self.RequestDestroyItem(arg))
itemDropQuestionDialog.SetSellEvent(lambda arg=True: self.RequestSellItem(arg))
itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
itemDropQuestionDialog.Open()
itemDropQuestionDialog.dropType = attachedType
itemDropQuestionDialog.dropNumber = attachedItemSlotPos
itemDropQuestionDialog.dropCount = attachedItemCount
self.itemDropQuestionDialog = itemDropQuestionDialog
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
def RequestDropItem(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropCount = self.itemDropQuestionDialog.dropCount
dropNumber = self.itemDropQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
net.SendGoldDropPacketNew(dropCount)
snd.PlaySound("sound/ui/money.wav")
else:
# PRIVATESHOP_DISABLE_ITEM_DROP
self.__SendDropItemPacket(dropNumber, dropCount)
# END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
# PRIVATESHOP_DISABLE_ITEM_DROP
self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
# END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
# PRIVATESHOP_DISABLE_ITEM_DROP
def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
# END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
# ALPER İTEM SİLME
def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemDestroyPacket(itemVNum)
def __SendSellItemPacket(self, itemVNum, itemInvenTyoe = player.INVENTORY):
if uiPrivateShopBuilder.IsBuildingPrivateShop():
chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
return
net.SendItemSellPacket(itemVNum)
def RequestDestroyItem(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropNumber = self.itemDropQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
def RequestSellItem(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropNumber = self.itemDropQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendSellItemPacket(dropNumber)
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
# ALPER SON
Sizce nerede hata yapıyorum?