Jump to content

Recommended Posts

  • Active+ Member

Hi. I'm working on a small edit, but I couldn't solve the problem you see.

 

spacer.png

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 by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
2 hours ago, blaxis said:

Hi. I'm working on a small edit, but I couldn't solve the problem you see.

 

spacer.png

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 by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • Active+ Member
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 by blaxis
Link to comment
Share on other sites

  • Premium
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

  • Active+ Member
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

  • Premium
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 by xTryhard
Link to comment
Share on other sites

  • Active+ Member
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.