Fixed #165, Fine tune fixes!

* Fixed an issue with the cooldown timing.
* Fixed issue with 'right click' using items under players.
* Some changes to the minimap control (ctrl + mouse wheel to
  change floors and tweaked the zoom/move speeds).
* Fixed some bugs in the trade module.
* Added new Spells table for spell related functions
  (Also added getSpellByName and getSpellByWords).
* Fixed an issue with follow/attack cancelling (wasn't calling
  onFollowChanged for updates in battle, etc).
This commit is contained in:
BeniS
2013-01-07 04:04:49 +13:00
parent 3fa5993177
commit fddbafebd3
8 changed files with 124 additions and 66 deletions

View File

@@ -34,6 +34,7 @@ function init()
mouseWidget = g_ui.createWidget('UIButton')
mouseWidget:setVisible(false)
mouseWidget:setFocusable(false)
mouseWidget.cancelNextRelease = false
battleWindow:setContentMinimumHeight(80)
--battleWindow:setContentMaximumHeight(384)
@@ -220,21 +221,27 @@ function addCreature(creature)
end
function onMouseRelease(self, mousePosition, mouseButton)
if mouseButton == MouseRightButton then
if mouseWidget.cancelNextRelease then
mouseWidget.cancelNextRelease = false
return false
end
if ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton)
or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then
mouseWidget.cancelNextRelease = true
g_game.look(self.creature)
return true
elseif mouseButton == MouseRightButton and g_keyboard.isCtrlPressed() and not g_mouse.isPressed(MouseLeftButton) then
modules.game_interface.createThingMenu(mousePosition, nil, nil, self.creature)
return true
elseif mouseButton == MouseLeftButton then
if g_keyboard.isShiftPressed() then
g_game.look(self.creature)
elseif mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
if self.isTarget then
g_game.cancelAttack()
else
if self.isTarget then
g_game.cancelAttack()
else
g_game.attack(self.creature)
end
g_game.attack(self.creature)
end
return true
end
return false
end
function removeAllCreatures()