Changes/Fixes to Channels/Hotkeys/Inventory Slots.

- Fixed issue with opening multiple instances of the same message channels (will focus the channel if already exists).
- Added tooltip to the 'Clear message window' button.
- Added keyboard Up/Down press for hotkeys.
- Added inventory slots/images.
- Started on adding soul
This commit is contained in:
BeniS
2012-07-11 00:15:31 +12:00
parent 77648a2ffa
commit 82233dc655
17 changed files with 140 additions and 54 deletions

View File

@@ -38,7 +38,7 @@ end
-- public functions
function Minimap.init()
connect(g_game, { onGameStart = Minimap.reset,
onForceWalk = Minimap.center } )
onForceWalk = Minimap.center })
g_keyboard.bindKeyDown('Ctrl+M', Minimap.toggle)
@@ -78,7 +78,7 @@ end
function Minimap.terminate()
disconnect(g_game, { onGameStart = Minimap.reset,
onForceWalk = Minimap.center } )
onForceWalk = Minimap.center })
g_keyboard.unbindKeyDown('Ctrl+M')
@@ -104,19 +104,6 @@ function Minimap.onMiniWindowClose()
minimapButton:setOn(false)
end
function Minimap.reset()
local player = g_game.getLocalPlayer()
if not player then return end
minimapWidget:followCreature(player)
minimapWidget:setZoom(DEFAULT_ZOOM)
end
function Minimap.center()
local player = g_game.getLocalPlayer()
if not player then return end
minimapWidget:followCreature(player)
end
function Minimap.isClickInRange(position, fromPosition, toPosition)
return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.x <= toPosition.x and position.y <= toPosition.y)
end
@@ -159,4 +146,18 @@ function Minimap.onButtonClick(id)
pos.z = pos.z + 1
minimapWidget:setCameraPosition(pos)
end
end
-- hooked events
function Minimap.reset()
local player = g_game.getLocalPlayer()
if not player then return end
minimapWidget:followCreature(player)
minimapWidget:setZoom(DEFAULT_ZOOM)
end
function Minimap.center()
local player = g_game.getLocalPlayer()
if not player then return end
minimapWidget:followCreature(player)
end