Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: 6674576456786548678 on Wed 12/09/2018 13:25:37

Title: Mouse Mode In Inventory
Post by: 6674576456786548678 on Wed 12/09/2018 13:25:37
.
Title: Re: Mouse Mode In Inventory
Post by: Ghost on Wed 12/09/2018 18:12:02
My coding's a bit rusty but IIRC the problem is that you attempt to change a cursor mode ON clicking. AGS is a bit finniky in tht respect: You are in a mode when clicking and then you change to another mode which is then not processed because you already clicked and triggered the event.

Instead of setting the mouse.mode, try the command ProcessClick(mode), where mode would be eModeLookAt or eModeUseInv. The latter actually selects the inventory item. Should work alright.
Title: Re: Mouse Mode In Inventory
Post by: Khris on Wed 12/09/2018 22:49:33
AFAIK, the mouse cursor changing to the pointer graphic is hardcoded for PopupY GUIs, meaning the current cursor mode is retained.
The alternative is to implement the PopupY behavior yourself. Switch the GUI's visibility to "Normal, initially off", and use this:
int prevMode;

  // the following inside repeatedly_execute
  if (mouse.y < 10 && !gInventory.Visible) {
    gInventory.Visible = true;
    prevMove = mouse.Mode;
    mouse.Mode = eModePointer;
  }
  else if (gInventory.Visible && mouse.y > gInventory.Height) {
    if (mouse.Mode == eModePointer) mouse.Mode = prevMode;
    gInventory.Visible = false;
  }
Title: Re: Mouse Mode In Inventory
Post by: 6674576456786548678 on Thu 13/09/2018 18:33:07
OK great. Thanks frens.