Close Inventory by clicking outside window

Started by scourge, Thu 02/03/2006 23:44:34

Previous topic - Next topic

scourge

How would I specifically for version 2.7 close the inventory by clicking outside of the inventory window? Without going into window coordinates and without using repeatedly_exexute?

I tried using the interface_click method but i couldn't get it to work.

if (interface == 2) {
??
}

2 is number for inventory.

Ashen

interface_click only runs when you actually click on the interface, so that wouldn't work. (Never mind the fact that it's obsolete in 2.7...)

Try adding this to your on_mouse_click:
Code: ags

if (gui[2].Visible == true && GUI.GetAtScreenXY(mouse.x,  mouse.y) != gui[2]) gui[2].Visible = false;


That'll turn the GUI off with any click not on it, but you can fairly easily adapt it to just be Left.

I know what you're thinking ... Don't think that.

scourge

Thanks Ashen, that helps, very sensible :)

SMF spam blocked by CleanTalk