This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
#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 (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (mouse.IsButtonDown(eMouseLeft)) {
// if player has an item then unselect:
if (character[EGO].ActiveInventory != -1)
character[EGO].ActiveInventory = -1;
// otherwise process look or walk:
else ProcessClickSpecial(mouse.x, mouse.y, MODE_LOOK, MODE_WALK);
}
else if (mouse.IsButtonDown(eMouseRight)) {
// if player has an item then try to use it:
if (character[EGO].ActiveInventory != -1)
ProcessClickSpecial(mouse.x, mouse.y, MODE_USEINV, MODE_WALK);
// otherwise just interact as usual:
else ProcessClickSpecial(mouse.x, mouse.y, MODE_USE, MODE_WALK);
}
// handling inventory clicks: (Handle inventory clicks in script must be on!)
else if (mouse.IsButtonDown(eMouseRightInv)) {//for right inv. click:
// select the item player has clicked on
SetActiveInventory(game.inv_activated);
}
else if (mouse.IsButtonDown(eMouseLeftInv)) { //for left inv. click:
// run look at inventory interaction
RunInventoryInteraction (game.inv_activated, MODE_LOOK);
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.088 seconds with 14 queries.