Thanks for your help. Your suggestions have been very useful.
I have managed however to solve the problem (actually go around it) with the following code:
In the repeatedly_execute function I put:
if (mouse.y>184) { // this checks if the cursor is over the inventory GUI
if (GetGlobalInt(499)==0) { // this ensures that the mode change happens only once
SetGlobalInt (499, 1);
SetCursorMode (MODE_USE);
SetMouseCursor (6);
}
}
if ((mouse.y<184) && (GetCursorMode()!=MODE_USEINV) && (GetGlobalInt(499)==1)) { // this reverts the cursor back to walk mode after leaving the inventory unless an item is selected
SetCursorMode (MODE_WALK);
SetGlobalInt(499, 0);
}
This goes in the on_mouse_click function:
if (button == RIGHTINV) {
RunInventoryInteraction (game.inv_activated, MODE_LOOK);
}
The script works fine, but the "Handle inventory clicks in script" must NOT be ticked.
I know this solution is a bit akward but it works.
I wait for your opinions.
I have managed however to solve the problem (actually go around it) with the following code:
In the repeatedly_execute function I put:
if (mouse.y>184) { // this checks if the cursor is over the inventory GUI
if (GetGlobalInt(499)==0) { // this ensures that the mode change happens only once
SetGlobalInt (499, 1);
SetCursorMode (MODE_USE);
SetMouseCursor (6);
}
}
if ((mouse.y<184) && (GetCursorMode()!=MODE_USEINV) && (GetGlobalInt(499)==1)) { // this reverts the cursor back to walk mode after leaving the inventory unless an item is selected
SetCursorMode (MODE_WALK);
SetGlobalInt(499, 0);
}
This goes in the on_mouse_click function:
if (button == RIGHTINV) {
RunInventoryInteraction (game.inv_activated, MODE_LOOK);
}
The script works fine, but the "Handle inventory clicks in script" must NOT be ticked.
I know this solution is a bit akward but it works.
I wait for your opinions.