Inventory on right click

Started by , Sat 11/10/2003 11:11:53

Previous topic - Next topic

Nick

Is there a way to show a popup inventory GUI by right clicking? If so, how?

Scorpiorus

Yes, you can tweak the on_mouse_click() function in the global script; for example:

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) {
   ProcessClick(mouse.x, mouse.y, GetCursorMode() );
 }
 else {   // right-click, so cycle cursor
   //SetNextCursorMode();
   InventoryScreen();
 }
}

...on right click displays the built-in sierra style inventory dialog.

~Cheers

Nick

Thanks a lot!

But now I face another problem. Every time my character exits a room and goes to the next, he is facing the same direction he was in the previous room. However, some rooms have different angles. I don't know if FaceDirection would work because I don't know how it works with coordinates. What should I do?

ThunderStorm

I don't know why FaceLocation wouldn't work. If you want the player to face left for example, the script line
FaceLocation(EGO, character[EGO].x - 10, character[EGO].y); should do the job.
Assuming your character's script name is EGO, of course.

Nick

Oh. Nevermind I get it now. Thanks!

SMF spam blocked by CleanTalk