Jump to content

How to create Inventory Context Menus


RoboMat

Recommended Posts

Heyho,

 

I've created another tutorial over at pz-mods.net which explains how to use inventory context menus.

 

How to create Inventory Context Menus

 

 

It especially shows you how to differentiate between single items, stacks and multiple stacks of items.

 

 

Hope it helps!

 

P.S.: http://thecodinglove.com/post/47120159615/when-my-code-works-on-the-first-try

Link to comment
Share on other sites

Great tutorial! I learned some useful info from it. By the way, I would put

        if #clickedItems > 1 then            return;        end

Above the for loop to get rid of redundant tests.

 

Although... I guess it only executes once anyhow. :)

 

Also, this function is broken:

function UIDestroyItems.onDestroyItem(_items, _player, _item)    _item:getContainer():Remove(_item);    _player:Say("I end
Link to comment
Share on other sites

  • 10 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...