Ryan cf22651949 Added intergration loveManager
Adds multi.intergrations.loveManager,lua
Created an example file for you to look at
2017-06-24 22:46:44 -04:00

24 lines
573 B
Plaintext

function gui:setHotKey(key)
local tab=key:split("+")
self.hotkeys=tab
self.cooldown=false
self.Alarm=multi:newAlarm(1)
self.Alarm.parent=self
self.args={}
self.funcHK=multi:newConnection()
self.Alarm:OnRing(function(alarm) alarm.parent.cooldown=false end)
function self:OnHotKey(func)
self.funcHK:connect(func)
end
self:OnUpdate(function(self)
if self.cooldown then return end
for i=1,#self.hotkeys do
if not(love.keyboard.isDown(self.hotkeys[i])) then
return
end
end
self.cooldown=true
self.funcHK:Fire(self)
self.Alarm:Reset()
end)
end