markx202 1 Posted September 5, 2019 Share Posted September 5, 2019 Hi guys! I have a problem: 0904 22:09:25493 :: Traceback (most recent call last): 0904 22:09:25494 :: File "networkModule.py", line 239, in SetGamePhase 0904 22:09:25494 :: File "game.py", line 111, in __init__ 0904 22:09:25494 :: File "interfaceModule.py", line 353, in MakeInterface 0904 22:09:25494 :: File "interfaceModule.py", line 192, in __MakeWindows 0904 22:09:25494 :: AttributeError 0904 22:09:25494 :: : 0904 22:09:25494 :: 'Interface' object has no attribute 'game' 0904 22:09:25494 :: Can someone help me? I've done this: game.py import uirarityrefine #Before self.__ServerCommand_Build() self.wndRR = uirarityrefine.RefineRarityWindow() self.wndRR.SetItemToolTip(self.interface.tooltipItem) #After "PlayMusic" : self.__PlayMusic, "REFINE_Rarity" : self.RefineRarity, "RarityRefine_Success" : self.RarityRefine_Success, "RarityRefine_NeedItem" : self.RarityRefine_NeedItem, "RarityRefine_Fail" : self.RarityRefine_Fail, #AT THE END def RefineRarity(self, evo): self.wndRR.Open(evo) def RarityRefine_Success(self): self.wndRR.SuccessMessage() def RarityRefine_NeedItem(self, code): self.wndRR.NeedItem(code) def RarityRefine_Fail(self): self.wndRR.Failed() interfacemodule.py #After def __MakeWindows(self): [..] wndInventory.BindInterfaceClass(self) #I put wndInventory.BindGameClass(self.game) #Before if __name__ == "__main__": #I put def BindGameWindow(self, game): self.game = game uiinventory.py #Before def UseItemSlot(self, slotIndex): #I put def BindGameClass(self, game): self.game = game #After slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex) #I put if (self.game is not None and self.game.wndRR.IsShow()): self.game.wndRR.UseItemSlot(player.INVENTORY, slotIndex) return #After def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos): #I put if srcItemVID == 11115: item.SelectItem(player.GetItemIndex(dstItemSlotPos)) if item.GetItemType() == item.ITEM_TYPE_WEAPON: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) self.game.wndRR.UseItemSlot(player.INVENTORY,dstItemSlotPos,True) else: chat.AppendChat(1,"<Sistem> Item is not a weapon.") Link to comment Share on other sites More sharing options...
Fire 23 Posted September 5, 2019 Share Posted September 5, 2019 You are missing the declaration of self.game = None Search def __init__(self): and add the missing code inside it Link to comment Share on other sites More sharing options...
markx202 1 Posted September 5, 2019 Author Share Posted September 5, 2019 10 minutes ago, Fire said: You are missing the declaration of self.game = None Search def __init__(self): and add the missing code inside it Done and now i have this one! 0905 11:59:25425 :: Traceback (most recent call last): 0905 11:59:25425 :: File "ui.py", line 1962, in OnSelectItemSlot 0905 11:59:25425 :: File "ui.py", line 88, in __call__ 0905 11:59:25425 :: File "ui.py", line 79, in __call__ 0905 11:59:25425 :: File "uiInventory.py", line 823, in SelectItemSlot 0905 11:59:25425 :: File "uiInventory.py", line 894, in __DropSrcItemToDestItemInInventory 0905 11:59:25425 :: AttributeError 0905 11:59:25425 :: : 0905 11:59:25425 :: 'InventoryWindow' object has no attribute 'wndRR' 0905 11:59:25425 :: And if i add self.wndRR = None in __init__ on inventorywindow i have this one: 0905 12:01:20686 :: Traceback (most recent call last): 0905 12:01:20686 :: File "ui.py", line 1962, in OnSelectItemSlot 0905 12:01:20686 :: File "ui.py", line 88, in __call__ 0905 12:01:20686 :: File "ui.py", line 79, in __call__ 0905 12:01:20686 :: File "uiInventory.py", line 825, in SelectItemSlot 0905 12:01:20686 :: File "uiInventory.py", line 896, in __DropSrcItemToDestItemInInventory 0905 12:01:20686 :: AttributeError 0905 12:01:20686 :: : 0905 12:01:20686 :: 'NoneType' object has no attribute 'UseItemSlot' 0905 12:01:20686 :: However thanks for answer me! I really appreciate that. 1 Link to comment Share on other sites More sharing options...
Fire 23 Posted September 5, 2019 Share Posted September 5, 2019 Can you share this function? __DropSrcItemToDestItemInInventory Link to comment Share on other sites More sharing options...
markx202 1 Posted September 5, 2019 Author Share Posted September 5, 2019 def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos): if srcItemSlotPos == dstItemSlotPos: return if app.RARITY_SYSTEM: if srcItemVID == 71053 or srcItemVID == 30741: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) if item.IsRefineScroll(srcItemVID): if self.__isSameItem(srcItemVID,dstItemSlotPos): # bugfix! self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0) else: self.RefineItem(srcItemSlotPos, dstItemSlotPos) self.wndItem.SetUseMode(False) if srcItemVID == 11115: item.SelectItem(player.GetItemIndex(dstItemSlotPos)) if item.GetItemType() == item.ITEM_TYPE_WEAPON: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) self.game.wndRR.UseItemSlot(player.INVENTORY,dstItemSlotPos,True) else: chat.AppendChat(1,"This is not a weapon.") # cyh itemseal 2013 11 08 elif app.ENABLE_SOULBIND_SYSTEM and item.IsSealScroll(srcItemVID): self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) elif item.IsMetin(srcItemVID): self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos) elif item.IsDetachScroll(srcItemVID): self.DetachMetinFromItem(srcItemSlotPos, dstItemSlotPos) elif item.IsKey(srcItemVID): self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) elif (player.GetItemFlags(srcItemSlotPos) & ITEM_FLAG_APPLICABLE) == ITEM_FLAG_APPLICABLE: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) elif item.GetUseType(srcItemVID) in self.USE_TYPE_TUPLE: self.__SendUseItemToItemPacket(srcItemSlotPos, dstItemSlotPos) else: #snd.PlaySound("sound/ui/drop.wav") ## 이동시킨 곳이 장착 슬롯일 경우 아이템을 사용해서 장착 시킨다 - [levites] if player.IsEquipmentSlot(dstItemSlotPos): ## 들고 있는 아이템이 장비일때만 if item.IsEquipmentVID(srcItemVID): self.__UseItem(srcItemSlotPos) else: self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0) #net.SendItemMovePacket(srcItemSlotPos, dstItemSlotPos, 0) Link to comment Share on other sites More sharing options...
Fire 23 Posted September 5, 2019 Share Posted September 5, 2019 As I can see uirarityrefine.py doesn't got UseItemSlot function. You have to add it on uirarityrefine.py and adapt it to the file. Feel free to share uirarityrefine and I'll try to reach the solution Link to comment Share on other sites More sharing options...
markx202 1 Posted September 5, 2019 Author Share Posted September 5, 2019 Ty man this is uirarityrefine.py https://pastebin.com/9hdEyZMC Link to comment Share on other sites More sharing options...
Active Member Koray 2002 Posted September 5, 2019 Active Member Share Posted September 5, 2019 self.wndRR is looks like not initialized, probably you placed; self.wndRR = uirarityrefine.RefineRarityWindow() self.wndRR.SetItemToolTip(self.interface.tooltipItem) lines to wrong function 1 Link to comment Share on other sites More sharing options...
markx202 1 Posted September 5, 2019 Author Share Posted September 5, 2019 I put: self.wndRR = uirarityrefine.RefineRarityWindow() self.wndRR.SetItemToolTip(self.interface.tooltipItem) to Link to comment Share on other sites More sharing options...
Active Member Koray 2002 Posted September 5, 2019 Active Member Share Posted September 5, 2019 self.wndRR func is used in uiinventory not in game Link to comment Share on other sites More sharing options...
markx202 1 Posted September 5, 2019 Author Share Posted September 5, 2019 28 minutes ago, Koray said: self.wndRR func is used in uiinventory not in game Yes but if i put self.wndRR = uirarityrefine.RefineWindow() in __init__ function on InventoryWindow class client generate a syserr with NoneType has no attribute 'wndRR' Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now