Right-click on INV windows

Started by Rui 'Trovatore' Pires, Fri 10/12/2004 09:04:09

Previous topic - Next topic

Rui 'Trovatore' Pires

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.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gilbert

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).

Rui 'Trovatore' Pires

#2
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 -

Code: ags

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?
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

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.

Rui 'Trovatore' Pires

Ah, that worked wonders! Thanks!
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SMF spam blocked by CleanTalk