Inventory window help

Started by MoonDog, Fri 07/08/2015 17:26:00

Previous topic - Next topic

MoonDog

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.

Grok

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.

MoonDog

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.

Khris

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:

Code: ags
  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)   

MoonDog

Will try this out. Thank you.

SMF spam blocked by CleanTalk