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.
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:
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.
Thanks Ashen, that helps, very sensible :)