Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ultra Magnus on Mon 02/03/2009 08:13:08

Title: Inventory clicks not clicking [SOLVED]
Post by: Ultra Magnus on Mon 02/03/2009 08:13:08
My inventory has stopped responding, and I don't know what I did to it.
The cancel button works, so it's not that it's not clickable, but the actual inv items do nothing.

Also, I had it so that clicking off of the window would close it, but that's stopped working, too.


function on_mouse_click(MouseButton button) {
  if (IsGamePaused() == 1) {
  // Doing nothing
  }

  else if (mouse.Mode!=eModePointer && isguiopen==true && GUIControl.GetAtScreenXY(mouse.x, mouse.y)==null) {
    if (button==eMouseLeft) {
      gInventory.Visible=false;
      lblInventoryStatus.Text=" ";
      isguiopen=false;
      if (mouse.Mode == eModeInteract) {
        mouse.Mode=eModeLookat;
      }
    }
  }

  else if (button==eMouseLeftInv) {
    if (InventoryItem.GetAtScreenXY(mouse.x, mouse.y)==iMap) {
      gMap.Visible=true;
      gInventory.Visible=false;
      mouse.Mode=eModePointer;
      lblInventoryStatus.Text=" ";
    }

    else if (player.ActiveInventory!=null) {
      inventory[game.inv_activated].RunInteraction(eModeUseinv);
    }

    else {
      player.ActiveInventory=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
      mouse.Mode=eModeUseinv;
    }
  }

  else if (button==eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
}


Help.

Disregard.
Title: Re: Inventory clicks not clicking
Post by: Trent R on Mon 02/03/2009 08:17:13
Ummm.... not sure, but what's the Visibilty setting? Such as 'Normal initially off' and such. I ask because of the IsGamePaused call at the beginning.


~Trent
Title: Re: Inventory clicks not clicking [SOLVED]
Post by: Ultra Magnus on Mon 02/03/2009 08:25:28
You're a genius.
I'm an idiot. ::)

It was "Pause game while shown", and it obviously works now that I've changed it.
I thank you, sir.

I guess what threw me off was that the cancel button still worked.

False alarm, people.
Nothing to see here.