Question about mouse clicks in inventory handling

Started by bx83, Mon 29/07/2019 04:11:28

Previous topic - Next topic

Laura Hunt

This is definitely starting to fall outside of my comfort zone, but I do know that in General Settings there's an option to automatically set the cursor graphic to the currently active inventory item, so you don't have to handle the change of graphic by yourself. Maybe remove/hide any code you have that manually changes the cursor graphic to the active inventory item and let AGS handle it? Or alternatively, do everything yourself and disable this option in general settings...

bx83

Perhaps I should have a mouse.Mode==eModeUseInv in UpdateMouseGraphic() below eModeInteract block?

bx83

All suggestions welcome, I'm afk for 8 hours sleeping in the darkened, freezing nighttime of Sydney Australia.

Dualnames

If I may I rather avoid using leftinv etc, and instead use a repeatedly_execute_always (if needed depending if the cycles are paused when the inventory is up) and a InventoryItem.GetAtScreenXY.

So for example.

Code: AGS


int MouseButtonPressed=-1;

function  repeatedly_execute_always()
{
 
  if (IsGamePaused() == 1) {                                            // do nothing if paused
 
  
  } 
else
  if (gInventory.Visible) {                                             // if inventory is visible...
    
    if (Mouse.IsButtonDown(eMouseWheelNorth) && Mouse.IsButtonDown(eMouseWheelSouth)
     && !Mouse.IsButtonDown(eMouseLeft) && !Mouse.IsButtonDown(eMouseRight))
    {
       MouseButtonPressed=-1;
    }
   else 
  {
     if (MouseButtonPressed!=-1)
    {
        return;
     }
   }

    //move up through inventory with mouse wheel
    if (Mouse.IsButtonDown(eMouseWheelNorth) 
    { //i think these don't get triggered here this way,so u might need to keep ur code on that mouse click for the wheel events
      MouseButtonPressed=eMouseWheelNorth;
      invCustomInv.ScrollUp();
    }    
    //move down through inventory with mouse wheel
    if (Mouse.IsButtonDown(eMouseWheelSouth))
   {
      MouseButtonPressed=eMouseWheelSouth;
      invCustomInv.ScrollDown();
    }
    
    InventoryItem *tInv;
    tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if Mouse.IsButtonDown(eMouseRight)
   {
      MouseButtonPressed=eMouseRight;
      if (player.ActiveInventory==null) {
        player.ActiveInventory=inventory[game.inv_activated];
      } else {
        tInv.RunInteraction(eModeUseinv);
      }
    }
   
    if Mouse.IsButtonDown(eMouseLeft) 
   {
      MouseButtonPressed=eMouseLeft;
      mouse.Mode=eModeLookat;
      player.ActiveInventory=null;
      tInv.RunInteraction(eModeLookat);
    }
}
}
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Khris

This looks like a bug in UpdateMouseGraphic(); can you post the entire function?
In general, in my experience it's best to separate concerns as far as possible, and repeatedly_execute(_always) should only deal with tasks where it is required. So I would recommend against detecting clicks in r_e, as opposed to mouse buttons / keys being held down.

bx83

Okay here's all the complete functions relating to Inventory stuff:

Code: ags

function show_inventory_window() 
{
  gInventory.Visible = true;

  PreviousMouseModeOutsideInventory = mouse.Mode;

  mouse.Mode=eModeLookat;
}



Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
  } else

  if (gInventory.Visible) {                                             // if inventory is visible...
    
    //move up through inventory with mouse wheel
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    //move down through inventory with mouse wheel
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
    
    InventoryItem *tInv;
    tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if (button == eMouseRightInv) {
      if (player.ActiveInventory==null) {
        player.ActiveInventory=inventory[game.inv_activated];
      } else {
        tInv.RunInteraction(eModeUseinv);
      }
    }
   
    if (button == eMouseLeftInv) {
      mouse.Mode=eModeLookat;
      player.ActiveInventory=null;
      tInv.RunInteraction(eModeLookat);
    }    

  } else {                          //if inventory *is not* visible

    if (button == eMouseLeft) {
      if (SamAndMaxInterface) {
        int lt = GetLocationType(mouse.x, mouse.y);
        if (lt == eLocationNothing) {
          Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
        } else {
          if (
            (mouse.Mode==eModeInteract && !IsInteractionAvailable(mouse.x, mouse.y, eModeInteract)) ||
            (mouse.Mode==eModeLookat && !IsInteractionAvailable(mouse.x, mouse.y, eModeLookat)) ||
            (mouse.Mode==eModeTalkto && !IsInteractionAvailable(mouse.x, mouse.y, eModeTalkto))
             )
          {
            Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
          } else {
            //if (player.Room!=RM_W_VIL_OS && 
            Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
          }
        }
      }
    }

    // cycle cursor 'forwards;
    if (button == eMouseWheelSouth) {
      mouse.SelectNextMode();
    }

    // Cycle the cursors 'backwards'
    if (button == eMouseWheelNorth) {
      if (SamAndMaxInterface) {
        if (mouse.Mode > 0) {                                                 // If mode isn't WALK, set the previous mode (notice usage of numbers instead of eNums)
          mouse.Mode = mouse.Mode-1; 
        } else { 
          if (player.ActiveInventory != null) {                               // WALK mode, and the player has a selected inventory item?
            mouse.Mode = eModeUseinv;                                         // Set mouse mode to UseInv
          } else {
            mouse.Mode = eModeTalkto;     // Otherwise just set it to mode TALK (change this line if you add more cursor modes)
          }
        }
      }
    }

  }
  
}


Code: ags

function UpdateMouseGraphic()
{
  int newGraphic;                                               // = 2054;
  int lt = GetLocationType(mouse.x, mouse.y);

  if (gInventory.Visible)
  {
    if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }
    
    if (mouse.Mode == eModeLookat) {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        newGraphic = 2056;                                    // eye open
      }
    }
    
    if (mouse.Mode==eModeInteract) {                             // INTERACTION
      newGraphic = 2;                                           // interact off
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        newGraphic = 286;                                      // interact on
        
      }
    }
  } else {
    if (mouse.Mode == eModeUseinv)
    {
      return;
    }
    if (mouse.Mode == eModeWalkto)
    {
      newGraphic = 3;                                           // stand still
      if (gInventory.Visible == true)
      {
      } else if (GetWalkableAreaAtRoom(mouse.x, mouse.y)!=0) {
        newGraphic = 2054;                                      // walking
      }
    } else
     if (mouse.Mode == eModeLookat)  {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    // Looking at item in inventory

      if (gInventory.Visible == true && inve != null) {
        if (inve.IsInteractionAvailable(eModeLookat)) {
          newGraphic = 2056;                                    // eye open
        }
      } else {
        if (lt == eLocationHotspot) {
          if (hs != hotspot[0]) {
            if (hs.GetProperty("hidden") == false) {
              if(hs.IsInteractionAvailable(eModeLookat)) {
                newGraphic = 2056;                              // eye open
              }
            }
          }
        } else
        if (lt == eLocationCharacter) {
          if (ch != null) {
            if (ch.IsInteractionAvailable(eModeLookat)) {
              newGraphic = 2056;
            }
          }
        } else
           if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true) {
          newGraphic = 2056;                                    // eye open
        }
      }
    } else
      if (mouse.Mode==eModeInteract)  {                            // INTERACTION
      newGraphic = 2;                                           // interact off
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null)  {
        if (inve.IsInteractionAvailable(eModeLookat))  {
          newGraphic = 286;
        }
      } else {

        if (hs != hotspot[0]) {
          if (hs.GetProperty("hidden") == false) {
            if (hs.IsInteractionAvailable(eModeInteract)) {
              newGraphic = 286;
            }
          }
        }

        else if (lt == eLocationObject) {
          if (ob.Visible) {
            if (ob.IsInteractionAvailable(eModeInteract)) {
              newGraphic = 286;
            }
          }
        } else
          if (lt == eLocationCharacter)  {
           if (ch != null)  {
             if (ch.IsInteractionAvailable(eModeInteract)) {
               newGraphic = 286;
             }
           }
         }
       }
    } else
      if (mouse.Mode == eModeTalkto)  {                              // TALKTO
      newGraphic = 2058;                                          // talk off
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null) {
      } else {
        if (lt == eLocationCharacter) {
          if (ch != null)  {
            if (ch.IsInteractionAvailable(eModeTalkto))  {
              if (ch.GetProperty("convodone")==0) {
                newGraphic = 213;                                   // talk on
              }
            }
          }
        }
        else
        if (lt == eLocationObject && ob.Visible && ob.IsInteractionAvailable(eModeTalkto))  {
          if (ob.GetProperty("convodone")==0) {
            newGraphic = 213;
          }
        }
      }
    }
  }

  if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
    mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
  }
  
}


I think that's it, if you want me to post other functions I will.
ps SamAndMaxInterface is a variable which is always true, it shouldn't be there now, but whatevs.

bx83

Here's a video of it happening.

https://redrom.ltd/img/mouseclickdemo.mp4

I start off by cycling forward and back in the walk/look/use/talk icons, with mouse wheel up/down.
I then demonstrate what happens when I press somewhere: If I press with look on a blank, does-not-have-a-look-interaction surface, Julius (main character) walks there. If I come on a visible surface with look interaction, it does this ('it's a bed of who's who of plant life').
I go to the inventory, and my last icon outside it saved. When I enter the inventory, my icon is Look; click left mouse button, it looks at an inventory item. Or if I right click, the icon goes (for about 20 cycles) to the cursor graphic of the item underneath the mouse, and then blank. If I move it around, I can still run a Use interaction on whatever inventory item I'm over (so, use rope on rope, use rope on knife, etc.) but the icon remains blank. Until I either a) left click something (and it goes back to Look icon), or I b) leave the inventory (in which case it defaults back to the last action I did before entering the inventory.



The Icon for useinv is Blank *anywhere in, around, or near the inventory object* - not just the inventory items:



Something to do with this line in UpdateMouseGraphic(), obviously:
Code: ags

  if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }


Here's my Default Setup:


Here's my General Settings:



As usual, answer's staring my in the face but I don't know what it is :/

bx83

Tried adding the line:
Code: ags

if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      if (player.ActiveInventory==null) mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }

And now coming back out of the inventory, the icon is the useinv activeintentory icon (use rope with plantlife etc.), rather than the last used icon outside of inventory, but the icon is *still blank*.
So the activeinventory icon is being made blank somehow. If I cycle with mousewheelnorth/south outside the inventory, it then goes to the other icons; when I come back to activeinventory icon, the icon is *restored* to the old. God knows why, but this is useful information to someone who isn't me I hope :P

Video: https://redrom.ltd/img/mouseclickdemo2.mp4

bx83


Khris

Add this to the room script:
Code: ags
void on_key_press(eKeyCode k) {
  if (key == ekeyM) {
    ClaimEvent();
    Display("The current mouse mode is %d.", mouse.Mode);
    Display("The current mouse cursor sprite is %d.", mouse.GetModeGraphic(mouse.Mode));
  }
}

In the room, press the M key and tell us what it says. This is basic debugging btw.

And also btw., your threads keep sounding like you paid for AGS and expect us to do the debugging we're contractually obligated to. Keep in my mind that we're doing this for free, in our spare time, as a favor to other forum people.

bx83

Sorry Khris, I provided lots of documentation about it; I wasn't frustrated, just surprised no one got back to me in a day.
That is basic; I was about to do something like that but thought I'd wait for a response which was going to be 'you forgot a semi colon' after doing hours of deugging last night and thisarvo.

It reports the mode is 4 (useinv) and graphic is 0 (ie. nothing - odd it's not a blue cup, so it must be 'null'). Something is making it 0; I managed to press M at the exact moment I right-clicked, it showed the standard icon and then said mode=4 and graphic=626.
Something is resetting it, I don't know what.

morganw

You are continually running this, right?

Code: ags

  if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
    mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
  }


Your if statements don't look lile you set a value for newGraphic under every circumstance, so you are likely setting it to 0 yourself and not realising.
(0 is the value of an uninitialised int)

bx83

I've solved it, mainly for seeing there was an error in UpdateMouseGraphic() which replaced it each time with a newly initiated int (which I thought always had a default value assigned somewhere in the function, but only in the if mode==something blocks).

Basically this system will:

Outside the inventory:
cycle up and down the inventory icons of activeinventory, walkto, lookat, use, and talk to with mousewheelup/down
Right clicking does nothing.
Left clicking applies the mouse mode to the surface below the cursor; or, if there is no surfaces you click on that will respond to this mode, then you walk there (same as Sam and Max and probably 400 other adventure games)

Inside inventory:
Left click looks at inventory items and give you a description of them
Right click will load an item as the activeinventory; then you can Left click on another item, it will runs the target item's itarget_useinv(), and then return the cursor to 'look at' and make activeinveory = null (right clicking with an activeinventory!=null does nothing)

Here's the code:

Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
 
  
  } else

  if (gInventory.Visible) {                                             // if inventory is visible...
    
    if (RemoveActiveInventory) {
      player.ActiveInventory=null;
      RemoveActiveInventory=false;
    }
    
    //move up through inventory with mouse wheel
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    //move down through inventory with mouse wheel
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
    
    InventoryItem *tInv;
    tInv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    
    if (button == eMouseRightInv) {
      if (tInv.IsInteractionAvailable(eModeUseinv)) {
        if (player.ActiveInventory==null) {
          player.ActiveInventory=inventory[game.inv_activated];
          mouse.ChangeModeGraphic(eModeUseinv, inventory[game.inv_activated].CursorGraphic);
        }
      }
    }
   
    if (button == eMouseLeftInv) {
      if (player.ActiveInventory!=null) {
        tInv.RunInteraction(eModeUseinv);
        mouse.Mode=eModeLookat;
        RemoveActiveInventory=true;
      } else {
        mouse.Mode=eModeLookat;
        player.ActiveInventory=null;
        tInv.RunInteraction(eModeLookat);
      }
    }    
    
  } else {                          //if inventory *is not* visible

    if (button == eMouseLeft) {
      if (SamAndMaxInterface) {
        int lt = GetLocationType(mouse.x, mouse.y);
        if (lt == eLocationNothing) {
          Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
        } else {
          if (
            (mouse.Mode==eModeInteract && !IsInteractionAvailable(mouse.x, mouse.y, eModeInteract)) ||
            (mouse.Mode==eModeLookat && !IsInteractionAvailable(mouse.x, mouse.y, eModeLookat)) ||
            (mouse.Mode==eModeTalkto && !IsInteractionAvailable(mouse.x, mouse.y, eModeTalkto))
             )
          {
            Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
          } else {
            Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
          }
        }
      }
    }

    // cycle cursor 'forwards;
    if (button == eMouseWheelSouth) {
      mouse.SelectNextMode();
    }

    // Cycle the cursors 'backwards'
    if (button == eMouseWheelNorth) {
      if (SamAndMaxInterface) {
        if (mouse.Mode > 0) {                                                 // If mode isn't WALK, set the previous mode (notice usage of numbers instead of eNums)
          mouse.Mode = mouse.Mode-1; 
        } else { 
          if (player.ActiveInventory != null) {                               // WALK mode, and the player has a selected inventory item?
            mouse.Mode = eModeUseinv;                                         // Set mouse mode to UseInv
          } else {
            mouse.Mode = eModeTalkto;     // Otherwise just set it to mode TALK (change this line if you add more cursor modes)
          }
        }
      }
    }

  }
  
}


Code: ags

function UpdateMouseGraphic()
{
  int newGraphic;                                               // = 2054;
  int lt = GetLocationType(mouse.x, mouse.y);

  if (gInventory.Visible)
  {
    if (mouse.y >= 175 && (mouse.x <= 140 || mouse.x >= 1200))
    {
      gInventory.Visible = false;
      if (player.ActiveInventory==null) mouse.Mode = PreviousMouseModeOutsideInventory;
      return;
    }
    
    if (mouse.Mode == eModeLookat) {                            // LOOKAT
      newGraphic = 105;                                         // eye close
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (inve != null) {
        if (player.ActiveInventory==null) {
          newGraphic = 2056;                                    // eye open
        }
      }
    } 
    
    if (mouse.Mode==eModeWalkto) {
      if (newGraphic==0) {
        player.ActiveInventory=null;
        mouse.Mode=eModeLookat;
      }
    }

  } else {
    if (mouse.Mode == eModeUseinv)
    {
    // Display("you clicked an inventory item");
      return;
    }
    if (mouse.Mode == eModeWalkto)
    {
      newGraphic = 3;                                           // stand still
      if (gInventory.Visible == true)
      {
      }
      else
      if (GetWalkableAreaAtRoom(mouse.x, mouse.y)!=0)
      {
        newGraphic = 2054;                                      // walking
      }
    }
    else if (mouse.Mode == eModeLookat)                              // LOOKAT
    {
      newGraphic = 105;                                         // eye close
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    // Looking at item in inventory

      if (gInventory.Visible == true && inve != null)
      {
        if (inve.IsInteractionAvailable(eModeLookat))
        {
          newGraphic = 2056;                                    // eye open
        }
      } else {
        if (lt == eLocationHotspot)
        {
          if (hs != hotspot[0])
          {
            if (hs.GetProperty("hidden") == false)
            {
              if(hs.IsInteractionAvailable(eModeLookat))
              {
                newGraphic = 2056;                              // eye open
              }
            }
          }
        }
        else if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeLookat))
            {
              newGraphic = 2056;
            }
          }
        }
        else if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true)
        {
          newGraphic = 2056;                                    // eye open
        }
      }
    }
    else if (mouse.Mode==eModeInteract)                              // INTERACTION
    {
      newGraphic = 2;                                           // interact off
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

    //  Interacting with inventory item

      if (gInventory.Visible == true && inve != null)
      {
        if (inve.IsInteractionAvailable(eModeLookat))
        {
          newGraphic = 286;
        }
      }
      else
      {

    // Interacting with hotspot

        if (hs != hotspot[0])
        {
          if (hs.GetProperty("hidden") == false)
          {
            if (hs.IsInteractionAvailable(eModeInteract))
            {
              newGraphic = 286;
            }
          }
        }

    // Interacting with object
    // else if ((mouse.x <=eLocationObject-5 || mouse.x>=eLocationObject+5) && (mouse.y<=eLocationObject-5 || mouse.y>=eLocationObject+5)) {

        else if (lt == eLocationObject)
        {
          if (ob.Visible)
          {
            if (ob.IsInteractionAvailable(eModeInteract))
            {
              newGraphic = 286;
            }
          }
        }
        
        //interacting with character
        else if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeInteract))
            {
              newGraphic = 286;
            }
          }
        }
      }
    }
    else if (mouse.Mode == eModeTalkto)                                // TALKTO
    {
      newGraphic = 2058;                                          // talk off
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null)
      {
      }
      else
      {
        if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeTalkto))
            {
              if (ch.GetProperty("convodone")==0) {
                newGraphic = 213;                                   // talk on
              }
            }
          }
        }
        else
        if (lt == eLocationObject && ob.Visible && ob.IsInteractionAvailable(eModeTalkto))
        {
          if (ob.GetProperty("convodone")==0) {
            newGraphic = 213;
          }
        }
      }
    }
  }

  if (mouse.Mode!=eModeUseinv) {
    if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
      mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
    }
  }
  
}


Code: ags

function show_inventory_window() 
{
  gInventory.Visible = true;
  PreviousMouseModeOutsideInventory = mouse.Mode;
  if (player.ActiveInventory==null) mouse.Mode=eModeLookat;
}


And also, General Settings -> Inventory -> Override built-in inventory clicking to TRUE

Hope this helps someone - thank you all for your time and problem solving :)

SMF spam blocked by CleanTalk