Mouse Mode In Inventory

Started by 6674576456786548678, Wed 12/09/2018 13:25:37

Previous topic - Next topic

6674576456786548678

.

Ghost

#1
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.

Khris

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:
Code: ags
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;
  }


SMF spam blocked by CleanTalk