And here is my process_click
Code: ags
The part I'm most concerned with is the button==LEFT code block The first part checks if it is in walk mode, that worked fine unless the hotspot reacted to walking (like walking between the upstairs and downstairs floors on a certain room). So, I added the second part which checks if the mouse is over a hotspot. The downside to doing it this way is by clicking walk on anything that is a hotspot and no interaction for it, it does nothing.
I've tried different ways, but nothing seems to give me the best of both worlds (unless I really want to add a moveCharacter command to EVERY hotspot, which I really don't want to).
Just putting this out there in case anyone else can think of something that I haven't already
function 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) {
if ((GetCursorMode()==0) && (GetHotspotAt(mouse.x, mouse.y) == 0)){
MoveCharacter(0, GetViewportX()+mouse.x, GetViewportY()+mouse.y);
}
else {
ProcessClick(mouse.x, mouse.y, GetCursorMode());
}
}
else { // right-click, so cycle cursor
if ((character[0].room != 1) || (IsGUIOn(4)==1)){
SetNextCursorMode();
}
}
}
The part I'm most concerned with is the button==LEFT code block The first part checks if it is in walk mode, that worked fine unless the hotspot reacted to walking (like walking between the upstairs and downstairs floors on a certain room). So, I added the second part which checks if the mouse is over a hotspot. The downside to doing it this way is by clicking walk on anything that is a hotspot and no interaction for it, it does nothing.
I've tried different ways, but nothing seems to give me the best of both worlds (unless I really want to add a moveCharacter command to EVERY hotspot, which I really don't want to).
Just putting this out there in case anyone else can think of something that I haven't already
