inventory gui

Started by andrea, Sun 29/08/2004 14:29:16

Previous topic - Next topic

andrea

Hi there,

I've got a problem with my inventory gui. My inventory gui pops up and closes on right mouse click. that's a good thing. the problem is, my left mouse click usually gets my character walking, but when the inventory is open, the character does not walk. I want him to walk or do anything else, whether the inventory is open or not. how can i do that?!

The second problem is, that when one inventory item is selected (item as cursor), there is no way to get rid of it except for closing the inventory (right click) and then another left click. I would like the item to go back into the inventory automatically on left click (to get a normal cursor and then left click used for walking). Can any body help me? This is my on mouse click script:

#sectionstart on_mouse_clickÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(int button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
Ã,  if ((button == RIGHT) && (IsGUIOn(2) ==1)) { // GUI is on so do this
Ã,  Ã,  Ã, GUIOff (2);
Ã,  }
Ã,  if ((button == RIGHT) && (IsGUIOn(1) ==1)) { // GUI is on so do this
Ã,  Ã,  Ã, GUIOff (1);
Ã,  }
Ã,  else 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());
Ã,  Ã,  Ã,  Ã,  Ã,  SetCursorMode(MODE_WALK);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  else if (button == RIGHT) {
Ã,  Ã,  Ã,  Ã,  Ã,  show_inventory_window(); // will turn on the inventoy window, whenever you right click
Ã,  }
}

#sectionend on_mouse_clickÃ,  // DO NOT EDIT OR REMOVE THIS LINE

can anybody help?

Barcik@Work

As far as I remember, when you turn on an inventory GUI it puts the game in paused mode. Therefore, your left-click script just doesn't work.

Sorry, no time right now for a proper script, but I believe it's pretty easy to manage now.

Mr Jake

set the GUI to 'normal' visabilty and put GUIoff (GUI) in the game_start section

andrea

wow. fast answer. and it works.

thanks!

SMF spam blocked by CleanTalk