Active+ Member blaxis 285 Posted March 7, 2022 Active+ Member Share Posted March 7, 2022 (edited) Hi. I'm working on a small edit, but I couldn't solve the problem you see. No syserr. My code: def SlotKontrol(self): if IsEditingOfflineShop(): return getItemID = shop.GetOfflineShopItemID for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT): if (getItemID(i) <= 0): # only empty slot self.itemSlotWindow.SetCoverButton(i, "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga",\ "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga",\ "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga",\ "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False) self.itemSlotWindow.SetAlwaysRenderCoverButton(i) Edited August 16, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium xTryhard 12 Posted March 7, 2022 Premium Share Posted March 7, 2022 (edited) 2 hours ago, blaxis said: Hi. I'm working on a small edit, but I couldn't solve the problem you see. No syserr. My code: def SlotKontrol(self): if IsEditingOfflineShop(): return getItemID = shop.GetOfflineShopItemID for i in xrange(shop.OFFLINE_SHOP_SLOT_COUNT): if (getItemID(i) <= 0): # only empty slot self.itemSlotWindow.SetCoverButton(i, "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga",\ "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga",\ "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga",\ "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False) self.itemSlotWindow.SetAlwaysRenderCoverButton(i) i dont know exactly what you want to do but : each item has a size of 1 even if they are 2 or 3 or whatever for example lets take the inventory you have in a row 5 slots if you want to disable a sword with 2 size on top left corner you have to disable slot 0 and slot 0 +5 if you have a inventory with 10 slots in a row it would be slot 0 and slot 0 +10 and so on for an item with 3 slots it is : slot 0 slot 0 +5 slot 0 +10 Edited August 16, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Active+ Member blaxis 285 Posted March 7, 2022 Author Active+ Member Share Posted March 7, 2022 (edited) 1 hour ago, xTryhard said: i dont know exactly what you want to do but : each item has a size of 1 even if they are 2 or 3 or whatever for example lets take the inventory you have in a row 5 slots if you want to disable a sword with 2 size on top left corner you have to disable slot 0 and slot 0 +5 if you have a inventory with 10 slots in a row it would be slot 0 and slot 0 +10 and so on for an item with 3 slots it is : slot 0 slot 0 +5 slot 0 +10 The screen in the image is the offline shop screen. What I want to do is lock all slots if offline store is not in edit mode and item count is 0. Can you show me how to do it through the code I gave? The shop screen has 80 slots and the initial value is 0. But when I first open the shop, no matter how many conditions I put, the item on the store screen looks like this. Edited March 7, 2022 by blaxis Link to comment Share on other sites More sharing options...
Premium xTryhard 12 Posted March 7, 2022 Premium Share Posted March 7, 2022 5 minutes ago, blaxis said: The screen in the image is the offline shop screen. What I want to do is lock all slots if offline store is not in edit mode and item count is 0. Can you show me how to do it through the code I gave? The shop screen has 80 slots and the initial value is 0. But when I first open the shop, no matter how many conditions I put, the item on the store screen looks like this. if you want to lock an item i recommend to do this on the serverside if someone moddify your client he can still move it if you lock it only on the clientside this is really important when you are done with locking you send a packet back to the client and update the locked slot Link to comment Share on other sites More sharing options...
Active+ Member blaxis 285 Posted March 7, 2022 Author Active+ Member Share Posted March 7, 2022 1 hour ago, xTryhard said: if you want to lock an item i recommend to do this on the serverside if someone moddify your client he can still move it if you lock it only on the clientside this is really important when you are done with locking you send a packet back to the client and update the locked slot No I want to lock the slots with "SetCoverButton", not the item. (As in the picture) But for some reason it shows the slot where the item is in as locked. I just want to lock slots that are empty except for the item. Link to comment Share on other sites More sharing options...
Premium xTryhard 12 Posted March 7, 2022 Premium Share Posted March 7, 2022 (edited) 8 minutes ago, blaxis said: No I want to lock the slots with "SetCoverButton", not the item. (As in the picture) But for some reason it shows the slot where the item is in as locked. I just want to lock slots that are empty except for the item. it is the same with empty slots lock it on the server and send a callback to the client to update the slots you should have a basic understanding in C++ and the network if you dont you should not touch an inventory anyway you can destroy alot if you moddify only python Edited March 7, 2022 by xTryhard Link to comment Share on other sites More sharing options...
Active+ Member blaxis 285 Posted March 7, 2022 Author Active+ Member Share Posted March 7, 2022 1 hour ago, xTryhard said: it is the same with empty slots lock it on the server and send a callback to the client to update the slots you should have a basic understanding in C++ and the network if you dont you should not touch an inventory anyway you can destroy alot if you moddify only python What I am talking about has nothing to do with the server, and there is no situation that will create any security weakness. There is already WJ_TRADABLE_ICON system and it does what it should. I just want it to appear as the lock of the slots as an image. 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