I'm trying to set up an interface where left clicking walks/interacts and right clicking looks. I tried tweaking the mouse function but I'm not having any luck:
Quotefunction on_mouse_click(int button) {
// called when a mouse button is clicked. button is either LEFT or RIGHT
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button==LEFT) {
ProcessClick(mouse.x, mouse.y, SetCursorMode(MODE_USE));
if (GetLocationType(mouse.x,mouse.y)==0) //cursor not over hotspot/character/object
SetCursorMode (MODE_WALK);
}
else { // right-click, look
ProcessClick(mouse.x, mouse.y, SetCursorMode(MODE_LOOK));
}
}
This changes the cursor appropriately but doesn't use it. Is there a command I'm overlooking here? Thanks in advance for any help.
Wow, after puzzling over that for a day I find out how to fix it all of ten minutes after I post. Don't I feel stupid. Feel free to delete this topic.
Quick contest! Who can guess why it didn't work properly? I think I can figure it out. :)
I know what is it...
Something to do with:
SetCursorMode (MODE_WALK);
;D