Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Oreclios

#1
Hi all!

First of all, sorry if this is a very easy issue. I'm getting started with AGS and I have a problem with my custom inventory window.

I have made an inventory GUI that appears in the bottom of the screen when the mouse coordinate 'y' is greater than some value. That works fine. The problem is that I can't interact with inventory items. I have activated the option 'Override built-in inventory window click handling' and modified the 'on_mouse_click' in the global script to include eMouseLeftInv and eMouseRightInv functions. I want to use the left click to 'interact' and the right click to 'look at' in the inventory window.

Here is my 'on_mouse_click' code:

Code: ags


if (IsGamePaused()==1) 
     return; 
else if (button == eMouseLeft){
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) 
        ProcessClick(mouse.x, mouse.y, eModeWalkto);    
    else { 
      if (mouse.Mode==eModeUseinv) 
        ProcessClick(mouse.x, mouse.y, eModeUseinv);
      else 
        ProcessClick(mouse.x, mouse.y, eModeInteract);
    }
}
else if (button == eMouseRight){ 
    if (mouse.Mode==eModeUseinv) 
      mouse.Mode=eModeInteract;
    else 
      ProcessClick(mouse.x, mouse.y, eModeLookat);  
}
else if (button == eMouseLeftInv) 
    ProcessClick(mouse.x, mouse.y, eModeInteract);  
else if (button == eMouseRightInv) 
    ProcessClick(mouse.x, mouse.y, eModeLookat);



Using this code I can't neither look at inventory items using the right mouse click nor interact with them (to select an item) using the left mouse click. I'm pretty sure there is something very simple that I've missed.

Thanks in advance.
SMF spam blocked by CleanTalk