Inventory Gui doesn't work. No inventory action possible.

Started by Arcangelo Bonaparte, Sat 07/01/2017 13:17:31

Previous topic - Next topic

Arcangelo Bonaparte

When I left Click on my inventory GUI the item doesn't get picked up. I get no reaction at all.
Can someone please help me?

The code I used is:

Code: ags
if (button == eMouseLeftInv) {if (character[GetPlayerCharacter()].activeinv==-1){SetCursorMode(4); SetMouseCursor(GetCursorMode());SetActiveInventory(game.inv_activated);}
                                                                           else {RunInventoryInteraction(game.inv_activated, GetCursorMode());SetCursorMode(0);}}

Crimson Wizard

#1
First of all, make sure the "Override built-in inventory window click handling" option is enabled in General Settings.



On a side note, I noticed that you are using lots of obsolete functions. Are you restoring some old script, or were watching a very old tutorial?
I may not know something about your intentions, but if you are working in latest version of AGS I recommend use code like:
Code: ags

if (button == eMouseLeftInv)
{
    if (player.ActiveInventory == null)
    {
        Mouse.Mode = eModeUseinv;
        player.ActiveInventory = inventory[game.inv_activated];
    }
    else
    {
        player.ActiveInventory.RunInteraction(Mouse.Mode);
        Mouse.Mode = eModeWalkTo;
    }
}

SMF spam blocked by CleanTalk