Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rui 'Trovatore' Pires on Fri 10/12/2004 09:04:09

Title: Right-click on INV windows
Post by: Rui 'Trovatore' Pires on Fri 10/12/2004 09:04:09
Correct me if I'm wrong, but you can't right-click on a custom INV window that has no item on the mouse coordinates, right?

I mean, if you click on a custom INV window and the PLACE you clicked has no INV item, your click does NOT get passed in any way. Even LEFTINV and RIGHTINV only get passed IF we're clicking on an inventory item.

This is very inconvenient, and it's also proved inconvenient to me in the past. Is there any way this could be changed? I mean, even the ability to do

if (interface==INV) {
  if (button==0 && GetInvAt(mouse.x,mouse.y) {

...where button is the inventory window, naturally, would be extremely helpful.
Title: Re: Right-click on INV windows
Post by: Gilbert on Fri 10/12/2004 09:13:29
I know this can be inconvenient, but I think currently it may be possible to work around this by checking it with on_mouse_click() (I'm not sure).
Title: Re: Right-click on INV windows
Post by: Rui 'Trovatore' Pires on Fri 10/12/2004 09:16:31
Hmmm, lemme try it out.

EDIT - Didn't try it out, but I'm sure it wouldn't work. Here's a bit of my code from On_Mouse_Click -


else if (button==RIGHT || button==RIGHTINV) {   // right-click, bring shortcut
  if (IsGUIOn(ACTION)) { (do some stuff) }
  GUIOn(SHORT);
  }


According to this, whenever the player right clicks the GUI SHORT should pop up. It doesn't when I right click on the inv window with no items, meaning the click isn't being processed at all... right?
Title: Re: Right-click on INV windows
Post by: Pumaman on Fri 10/12/2004 09:48:24
I believe the workaround is to use the  on_event  GUI_MDOWN  to find out this situation. I agree it's rather messy though, I'll see what I can do.
Title: Re: Right-click on INV windows
Post by: Rui 'Trovatore' Pires on Fri 10/12/2004 16:10:17
Ah, that worked wonders! Thanks!