Active Member Mind Rapist 188 Posted July 24, 2016 Active Member Share Posted July 24, 2016 Hello devs, I found this tut the other day and I did it. It is actually an effect for non-tradable items when the exchange window is open. When this window is open this system basicly covers the non-tradable item's slot with a white color and makes it unusable for this action. I want to do the same for non-sellable items (vendors and myshop) and non-storagable items. I tried this in my uitooltip Spoiler import shop import safebox def RefreshBagSlotWindow(self): getItemVNum=player.GetItemIndex getItemCount=player.GetItemCount setItemVNum=self.wndItem.SetItemSlot for i in xrange(player.INVENTORY_PAGE_SIZE): slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i) itemCount = getItemCount(slotNumber) # itemCount == 0이면 소켓을 비운다. if 0 == itemCount: self.wndItem.ClearSlot(i) continue elif 1 == itemCount: itemCount = 0 itemVnum = getItemVNum(slotNumber) setItemVNum(i, itemVnum, itemCount) if exchange.isTrading() and item.IsAntiFlag(item.ANTIFLAG_GIVE): self.wndItem.SetUnusableSlot(i) self.listUnusableSlot.append(i) elif not exchange.isTrading() and item.IsAntiFlag(item.ANTIFLAG_GIVE) and slotNumber in self.listUnusableSlot: self.wndItem.SetUsableSlot(i) self.listUnusableSlot.remove(i) if shop.isShopping() and item.IsAntiFlag(item.ANTIFLAG_SELL): self.wndItem.SetUnusableSlot(i) self.listUnusableSlot.append(i) elif not shop.isShopping() and item.IsAntiFlag(item.ANTIFLAG_SELL) and slotNumber in self.listUnusableSlot: self.wndItem.SetUsableSlot(i) self.listUnusableSlot.remove(i) if shop.isPrivateShop() and item.IsAntiFlag(item.ANTIFLAG_MYSHOP): self.wndItem.SetUnusableSlot(i) self.listUnusableSlot.append(i) elif not shop.isPrivateShop() and item.IsAntiFlag(item.ANTIFLAG_MYSHOP) and slotNumber in self.listUnusableSlot: self.wndItem.SetUsableSlot(i) self.listUnusableSlot.remove(i) if safebox.ItemInstanceVector() and item.IsAntiFlag(item.ANTIFLAG_SAVE): self.wndItem.SetUnusableSlot(i) self.listUnusableSlot.append(i) elif not safebox.ItemInstanceVector() and item.IsAntiFlag(item.ANTIFLAG_SAVE) and slotNumber in self.listUnusableSlot: self.wndItem.SetUsableSlot(i) self.listUnusableSlot.remove(i) (ignore the exchange function this one works ) but I'm getting this syserr Spoiler 0715 03:47:19619 :: Traceback (most recent call last): 0715 03:47:19619 :: File "networkModule.py", line 247, in SetGamePhase 0715 03:47:19620 :: File "game.py", line 101, in __init__ 0715 03:47:19620 :: File "interfaceModule.py", line 289, in MakeInterface 0715 03:47:19620 :: File "interfaceModule.py", line 173, in __MakeWindows 0715 03:47:19620 :: File "uiInventory.py", line 263, in __init__ 0715 03:47:19620 :: File "uiInventory.py", line 404, in __LoadWindow 0715 03:47:19620 :: File "uiInventory.py", line 471, in SetInventoryPage 0715 03:47:19620 :: File "uiInventory.py", line 574, in RefreshBagSlotWindow 0715 03:47:19620 :: NameError 0715 03:47:19620 :: : 0715 03:47:19620 :: global name 'safebox' is not defined 0715 03:47:19620 :: Are there any tuts or tips that can help? Thanks in advance Link to comment Share on other sites More sharing options...
Itachi 44 Posted July 24, 2016 Share Posted July 24, 2016 import safebox??? Link to comment Share on other sites More sharing options...
Active Member Mind Rapist 188 Posted July 24, 2016 Author Active Member Share Posted July 24, 2016 Yeah in the other tut it says to import exchange so I tried to do import safebox and import shop before the def begins but no luck... Link to comment Share on other sites More sharing options...
Denis 1474 Posted July 24, 2016 Share Posted July 24, 2016 At uiinventory.InventoryWindow().RefreshBagSlotWindow() add if constInfo.My_Systems["wj_trade_icon"]: if shop.IsOpen() and not shop.IsPrivateShop(): if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) if safebox.IsOpen(): if item.IsAntiFlag(item.ITEM_ANTIFLAG_SAFEBOX): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) if exchange.isTrading(): if item.IsAntiFlag(item.ITEM_ANTIFLAG_GIVE): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) if uiPrivateShopBuilder.IsBuildingPrivateShop(True): if item.IsAntiFlag(item.ITEM_ANTIFLAG_MYSHOP): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) else: self.wndItem.SetUsableSlot(False,i) Remove the constinfo though. Link to comment Share on other sites More sharing options...
Active Member Mind Rapist 188 Posted July 24, 2016 Author Active Member Share Posted July 24, 2016 21 minutes ago, Denis said: At uiinventory.InventoryWindow().RefreshBagSlotWindow() add Hide contents if constInfo.My_Systems["wj_trade_icon"]: if shop.IsOpen() and not shop.IsPrivateShop(): if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) if safebox.IsOpen(): if item.IsAntiFlag(item.ITEM_ANTIFLAG_SAFEBOX): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) if exchange.isTrading(): if item.IsAntiFlag(item.ITEM_ANTIFLAG_GIVE): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) if uiPrivateShopBuilder.IsBuildingPrivateShop(True): if item.IsAntiFlag(item.ITEM_ANTIFLAG_MYSHOP): self.wndItem.SetUnusableSlot(True,i) else: self.wndItem.SetUsableSlot(False,i) else: self.wndItem.SetUsableSlot(False,i) Remove the constinfo though. Hey @Denis, thanks for replying I tried this and I got this syserr Spoiler 0725 01:19:20445 :: Traceback (most recent call last): 0725 01:19:20445 :: File "networkModule.py", line 247, in SetGamePhase 0725 01:19:20445 :: File "game.py", line 102, in __init__ 0725 01:19:20445 :: File "interfaceModule.py", line 298, in MakeInterface 0725 01:19:20445 :: File "interfaceModule.py", line 174, in __MakeWindows 0725 01:19:20445 :: File "uiInventory.py", line 267, in __init__ 0725 01:19:20445 :: File "uiInventory.py", line 408, in __LoadWindow 0725 01:19:20445 :: File "uiInventory.py", line 475, in SetInventoryPage 0725 01:19:20445 :: File "uiInventory.py", line 565, in RefreshBagSlotWindow 0725 01:19:20445 :: TypeError 0725 01:19:20445 :: : 0725 01:19:20445 :: SetUsableSlot() takes exactly 2 arguments (3 given) 0725 01:19:20445 :: Btw I don't know why I'm getting this syserr your function gives 2 args (False ,i) Link to comment Share on other sites More sharing options...
Denis 1474 Posted July 24, 2016 Share Posted July 24, 2016 Remove the False/True Link to comment Share on other sites More sharing options...
Active Member Mind Rapist 188 Posted July 24, 2016 Author Active Member Share Posted July 24, 2016 Well I made it to login to the game but it did not work... 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