Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MoonDog on Fri 07/08/2015 17:26:00

Title: Inventory window help
Post by: MoonDog on Fri 07/08/2015 17:26:00
Ok so I got a second inventory window working but is it possible to make it so that a player doesn't select the inventory when clicking on it? So if I had this inventory open and I clicked on an item my mouse icon wouldn't change to the item icon or even pick that item up.
Title: Re: Inventory window help
Post by: Grok on Sat 08/08/2015 06:37:15
Could  invWindow.Clickable=False or invWindow.Enabled=False give you what your looking for? Never tried them myself but from the description in the Help-function in the editor it sounds like one or the other could do the job.
Title: Re: Inventory window help
Post by: MoonDog on Sat 08/08/2015 09:04:32
Sort of worked but then I can't look at inventory with the look icon. I think just disabling all the mouse modes except for the look and changing the look icon to a different graphic will do.
Title: Re: Inventory window help
Post by: Khris on Sat 08/08/2015 16:13:49
The proper way is to handle inv clicks yourself. Activate the option in Global settings -> Inventory, then add this to your on_mouse_click, after the last "else if" block:

  else if (button == eMouseRightInv) on_mouse_click(eMouseRight);
  else if (button == eMouseLeftInv) {
    GUI *g = GUI.GetAtScreenXY(mouse.x, mouse.y);
    int mode = mouse.Mode;
    // secondary inventory?
    if (g == gSecondInv) mode = eModeLookat;
    inventory[game.inv_activated].RunInteraction(mode);
  }


(untested)   
Title: Re: Inventory window help
Post by: MoonDog on Sun 09/08/2015 09:03:00
Will try this out. Thank you.