Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ras_maxim on Tue 15/06/2004 13:30:45

Title: Can customize the graphics of default inventory?
Post by: ras_maxim on Tue 15/06/2004 13:30:45
??? Please answer
Title: Re: Can customize the graphics of default inventory?
Post by: Ashen on Tue 15/06/2004 14:21:27
Yes, but make sure AGS is actually using the inventory GUI. You need to check the 'function show_inventory_window' part of the global script, otherwise it uses the internal one you can't edit.
Change it to:

function show_inventory_window () {
  GUIOn (INVENTORY); 
  // switch to the Use cursor (to select items with)
  SetCursorMode (MODE_USE);
  // But, override the appearance to look like the arrow
  SetMouseCursor (6);
}
Title: Re: Can customize the graphics of default inventory?
Post by: TerranRich on Tue 15/06/2004 15:28:05
BFAQ'ed: http://www.rain-day.com/harbinger/faq/#guis08
Title: Re: Can customize the graphics of default inventory?
Post by: ras_maxim on Tue 15/06/2004 16:37:07
Thank you I'll try
Please don't lock this topic yet
Title: Re: Can customize the graphics of default inventory?
Post by: TerranRich on Tue 15/06/2004 16:39:18
We don't lock solved topics. :)
Title: Re: Can customize the graphics of default inventory?
Post by: ras_maxim on Wed 16/06/2004 19:57:01
ok that was simple
but i dont like the default inventory script
How do I change cursor from "inventory item" mode to "pick up an item from inventory" mode by clicking anywhere in the blank inventory GUI field?
Title: Re: Can customize the graphics of default inventory?
Post by: Scorpiorus on Thu 17/06/2004 21:41:03
Putting the following lines at the top of the main global script should do the trick:

function on_event(int event, int data) {

   if (event == GUI_MUP) {
      if (GetGuiAt(mouse.x, mouse.y)==INVENTORY) {
         if (GetGUIObjectAt(mouse.x, mouse.y)<=0) {
            if (GetInvAt (mouse.x, mouse.y)==-1) {
               if (character[GetPlayerCharacter()].activeinv!=-1) {
                  SetActiveInventory(-1);
                  SetCursorMode (MODE_USE);
                  SetMouseCursor (6);
               }
            }
         }
      }
   }

}

But keep in mind, it won't work if you click somewhere between the inventory items.
Title: Re: Can customize the graphics of default inventory?
Post by: ras_maxim on Thu 17/06/2004 21:55:20
Thanks! I am going to be permanent user of AGS..  :)
That wasnt too hard but I couldnt figure it out for myself.:P  Now I have one more question: can I make the game time "freeze" when invrntory GUI is on?
Title: Re: Can customize the graphics of default inventory?
Post by: Scorpiorus on Thu 17/06/2004 22:00:22
Well, if INVENTORY gui's visible property is set to PopUpModal then it automatically pauses the game.