Mouseclick question

Started by , Wed 24/03/2004 02:55:33

Previous topic - Next topic

Ensades

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.

Ensades

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.

TerranRich

Quick contest! Who can guess why it didn't work properly? I think I can figure it out. :)
Status: Trying to come up with some ideas...

Ishmael

#3
I know what is it...

Something to do with:

SetCursorMode (MODE_WALK);


;D
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk