Configure default hotkey, fix map release
This commit is contained in:
parent
839495fa9b
commit
95f79b45dc
|
@ -28,6 +28,7 @@ clearObjectButton = nil
|
||||||
useOnSelf = nil
|
useOnSelf = nil
|
||||||
useOnTarget = nil
|
useOnTarget = nil
|
||||||
useWith = nil
|
useWith = nil
|
||||||
|
defaultComboKeys = nil
|
||||||
hotkeyList = {}
|
hotkeyList = {}
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
|
@ -170,14 +171,24 @@ function reload()
|
||||||
end
|
end
|
||||||
|
|
||||||
function loadDefautComboKeys()
|
function loadDefautComboKeys()
|
||||||
for i=1,12 do
|
if not defaultComboKeys then
|
||||||
addKeyCombo(nil, 'F' .. i)
|
for i=1,12 do
|
||||||
end
|
addKeyCombo(nil, 'F' .. i)
|
||||||
for i=1,4 do
|
end
|
||||||
addKeyCombo(nil, 'Shift+F' .. i)
|
for i=1,4 do
|
||||||
|
addKeyCombo(nil, 'Shift+F' .. i)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for keyCombo, keySettings in pairs(defaultComboKeys) do
|
||||||
|
addKeyCombo(nil, keyCombo, keySettings)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function setDefaultComboKeys(combo)
|
||||||
|
defaultComboKeys = combo
|
||||||
|
end
|
||||||
|
|
||||||
-- private functions
|
-- private functions
|
||||||
function onGameStart()
|
function onGameStart()
|
||||||
reload()
|
reload()
|
||||||
|
|
|
@ -17,7 +17,7 @@ function UIGameMap:onDragEnter(mousePos)
|
||||||
|
|
||||||
self.currentDragThing = thing
|
self.currentDragThing = thing
|
||||||
g_mouse.setTargetCursor()
|
g_mouse.setTargetCursor()
|
||||||
self.cancelNextRelease = true
|
self.allowNextRelease = false
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -50,12 +50,11 @@ function UIGameMap:onDrop(widget, mousePos)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIGameMap:onMousePress()
|
function UIGameMap:onMousePress()
|
||||||
self.cancelNextRelease = false
|
self.allowNextRelease = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIGameMap:onMouseRelease(mousePosition, mouseButton)
|
function UIGameMap:onMouseRelease(mousePosition, mouseButton)
|
||||||
if self.cancelNextRelease then
|
if not self.allowNextRelease then
|
||||||
self.cancelNextRelease = false
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -86,7 +85,7 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton)
|
||||||
|
|
||||||
local ret = modules.game_interface.processMouseAction(mousePosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing)
|
local ret = modules.game_interface.processMouseAction(mousePosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing)
|
||||||
if ret then
|
if ret then
|
||||||
self.cancelNextRelease = true
|
self.allowNextRelease = false
|
||||||
end
|
end
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
Loading…
Reference in New Issue