Cursorproblems with inventory

Started by Matti, Fri 01/02/2008 15:36:52

Previous topic - Next topic

Matti

Below is my inventory-script. It allows to cycle through the different cursor-modes in the inventory, if the cursor is located over an inventory item. Strange problem is, it doesn't work if the cursor's x-coordinate is below circa 120 (60 in the editor). I don't know if it has anything to do with the script, but I thought I'd better post it...

Perhaps someone has an idea what the problem could be about.


Code: ags

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton 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)
}

  if (button == eMouseLeftInv) { // left click on inventory item

    if (mouse.Mode == eModeInteract) { // select inventory item on eModeInteract:
        player.ActiveInventory = inventory[ game.inv_activated ];

    }

    else { // if your cursor isn't in interact mode, it will run the action wanted by the cursor selected
         inventory[ game.inv_activated ].RunInteraction( mouse.Mode );
    }

}

  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   // right-click, so cycle cursor
  
  character[EGO].ActiveInventory = null;

    mouse.SelectNextMode();
  }

}


SMF spam blocked by CleanTalk