Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Mon 30/12/2013 08:53:33

Title: Return mouse mode after active inventory = null to Hand interact
Post by: Slasher on Mon 30/12/2013 08:53:33
Hi,

I am using a lot of return old mouse mode from arrow pointer for my gui's, except Inventory.

The one area that I think could do with a brush up is returning old mouse mode once an inventory is used and becomes null. At the moment the mode always returns to WalkTo. I would much prefer mode to return to Hand interact after it becomes null.

Could you assist please?

Thank you



Title: Re: Return mouse mode after active inventory = null to Hand interact
Post by: Khris on Mon 30/12/2013 09:58:38
The way to do that is always the same: keep track of the thing that changes.

Code (ags) Select
// above rep_exe
InventoryItem *old_ai;

// inside
  // player lost active inv item during last frame
  if (player.ActiveInventory == null && old_ai != null) mouse.Mode = eModeInteract;
  old_ai = player.ActiveInventory;
Title: SOLVED: Return mouse mode after active inventory = null to Hand interact
Post by: Slasher on Mon 30/12/2013 11:34:36
Perfect.

Thank you so much Khris ;)