Here's code that switches the cursor mode as opposed to the graphic:
Code: ags
Switching to the woman should call
Code: ags
and switching to the man should call
Code: ags
To recap: moving the mouse only switches cursor modes between walking and interacting, switching the player character changes the sprite of the eModeInteract cursor.
(As an aside, I find the Mouse.UseModeGraphic() command quite problematic. It essentially fools the player, and is used as a quick fix instead of properly coding mouse behavior. It shouldn't be used.)
bool wasOverActiveArea;
void HandleCursor() {
if (Mouse.Mode == eModeUseinv) return; // do nothing
bool isOverActiveArea = GetLocationType(mouse.x, mouse.y) != eLocationNothing; // compare to enum!
if (isOverActiveArea && !wasOverActiveArea) {
// mouse just moved over active area
Mouse.Mode = eModeInteract;
else if (!isOverActiveArea && wasOverActiveArea) {
// mouse just left active area
Mouse.Mode = eModeWalkto;
}
}
Switching to the woman should call
Mouse.ChangeModeGraphic(eModeInteract, SPRITE_SLOT_OF_RED_HAND);
and switching to the man should call
Mouse.ChangeModeGraphic(eModeInteract, SPRITE_SLOT_OF_BLUE_HAND);
To recap: moving the mouse only switches cursor modes between walking and interacting, switching the player character changes the sprite of the eModeInteract cursor.
(As an aside, I find the Mouse.UseModeGraphic() command quite problematic. It essentially fools the player, and is used as a quick fix instead of properly coding mouse behavior. It shouldn't be used.)