mouse click events over my inventory GUI not being handled (SOLVED)

Started by Ionias, Sat 17/03/2007 12:44:39

Previous topic - Next topic

Ionias

Greetings, after some extensive forum searches and help file searches I can' nt seem to find what I'm looking for. Let me explain my situation...

My left mouse button does the default mouse mode action, while the right mouse button cycles the mouse modes. Except that when the mouse is over top of the inventory GUI the game doesn't detect any clicks. However, if the mouse is over top of an inventory ITEM, the game does detect the clicks, right or left respectively. Now I've set the inventory GUI to clickable and the game settings toggle of handle inventory clicks in script. My only cursor mode is MODE 0. I'm not using the standard AGS cursor modes. I am handling all the events in script.

Please help me, I can't figure out how to detect those vital mouse clicks over top of the inventory GUI itself. Again, if the mouse is over the inventory GUI but over an inventory ITEM everything works peachy.

I'm lost…

SSH

Yeah, its a bit wierd how AGS handles clicks like that. Ultimately, you can check the mouse button status and the GUI at the current X, Y and work things out from there...
12

Ionias

Quote from: SSH on Sat 17/03/2007 12:50:44
Yeah, its a bit wierd how AGS handles clicks like that. Ultimately, you can check the mouse button status and the GUI at the current X, Y and work things out from there...

Where at in the script can I detect that mouse click? I'm currently detecting all mouse clicks under the #sectionstart on_mouse_click section on my global script. This section detects all my mouse clicks and inventory clicks. It just doesn't detect any clicks if the mouse is over the inventory GUI and not over an actual inventory item.

Is this event sent some where else?

It's not sent to the #sectionstart interface_click section, because there are no controls present on the inventory GUI.

GarageGothic

Did you check "Handle inventory clicks in script" on the General Settings screen?

Ionias

Quote from: GarageGothic on Sat 17/03/2007 13:39:51
Did you check "Handle inventory clicks in script" on the General Settings screen?

Yes. The inventory GUI is also set to clickable.

To clarify I can detect the actual inventory GUI being clicked with the #sectionstart gInventgui_Click section. It is the inside of the actual control 0 (inventory) where there is no inventory item at that is causing the clicks not to be handled.

SSH

You may be able to use the on_event with event eEventGUIMouseUp (yes, not down... a click finishes on the up) to detect when someone clicks there... you'll also need to do if (GUIControl.GetAtScreenXY(mouse.x, mouse.y)==YOUR_INV_WINDOW_CONTROL_NAME) ...
12

Ionias


SMF spam blocked by CleanTalk