I want to make it, so that when mouse mode is set to for example look at, whenever mouse clicks anywhere, that doesn't perform a task (i.e. anywhere, that is not a hotspot, a character, an object...),
it changes back to mode walk to.
I take it, that should be fairly easy, but I haven't been able to find the function.
My best guess would be to make a "mouse.IsButtonDown(eMouseLeft)" command and then describe the exceptions, but I don't know how to do that?
Thanks for any help!
I've slightly altered the default mouse click handler (denoted by white spaces):
function on_mouse_click(MouseButton button)
{
if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
{
}
else if (button == eMouseLeft)
{
Hotspot *hotspot = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
if (hotspot.ID)
ProcessClick(mouse.x,mouse.y, mouse.Mode);
else
ProcessClick(mouse.x,mouse.y, eModeWalkto);
}
else // right-click, so cycle cursor
{
mouse.SelectNextMode();
}
}
Oooh, right - that's quite clever :)
Thanks!
This will disable almost all interaction clicks on objects and characters.
What you need is
if (GetLocationType(mouse.x, mouse.y) == eLocationNothing) ProcessClick(mouse.x,mouse.y, eModeWalkto);
else ProcessClick(mouse.x,mouse.y, mouse.Mode);
@Khris: Yeah, I spotted that too, however I tried changing it to fit my needs - but this one is even better for this purpose. Thanks!