mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
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:
@@ -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
|
Reference in New Issue
Block a user