Author Topic: ItemData::onUnUse  (Read 580 times)

Is there a way to register when a client has kind of 'unselected' a item?

function WeaponImage::onUnmount(%this,%obj,%slot)
{
    %client = %obj.client;
    //do stuff
}

What if I don't have a WeaponImage for it, only a ItemData?

Well I found an ItemData::onUse, but not an ItemData::onUnUse, so you'd have to use onUse, and then have it figure out whether or not it is the item you want.

What are you doing that has an item but not image, anways?

Well, a kind of 'ghost item' which is kinda used for selecting a action (setting %cl.hasTheToolSelected, and stuff).

What if I don't have a WeaponImage for it, only a ItemData?
How do you unuse a normal item?

How do you unuse a normal item?

Pressing Q (closing inventory), selecting bricks, selecting paint, scrolling to another item, or stuff like that. Whenever the item is no longer selected (aka has that white circle around it in inventory HUD).

You might as well use an image.