Added love.event.clearListeners.

This commit is contained in:
Alex Szpakowski
2015-12-12 14:19:37 -04:00
parent 44d4ce2c99
commit e5c0c49751
3 changed files with 11 additions and 2 deletions
+6
View File
@@ -93,5 +93,11 @@ function event.removeListener(func)
return success return success
end end
function event.clearListeners()
for k in pairs(listeners) do
listeners[k] = nil
end
end
-- DO NOT REMOVE THE NEXT LINE. It is used to load this file as a C++ string. -- DO NOT REMOVE THE NEXT LINE. It is used to load this file as a C++ string.
--)luastring"--" --)luastring"--"
+2 -1
View File
@@ -591,6 +591,7 @@ function love.errhand(msg)
v:setVibration() v:setVibration()
end end
end end
love.event.clearListeners()
if love.audio then love.audio.stop() end if love.audio then love.audio.stop() end
love.graphics.reset() love.graphics.reset()
local font = love.graphics.setNewFont(math.floor(love.window.toPixels(14))) local font = love.graphics.setNewFont(math.floor(love.window.toPixels(14)))
@@ -635,7 +636,7 @@ function love.errhand(msg)
return return
elseif e == "keypressed" and a == "escape" then elseif e == "keypressed" and a == "escape" then
return return
elseif e == "touchreleased" then elseif e == "touchpressed" then
local name = love.window.getTitle() local name = love.window.getTitle()
if #name == 0 or name == "Untitled" then name = "Game" end if #name == 0 or name == "Untitled" then name = "Game" end
local buttons = {"OK", "Cancel"} local buttons = {"OK", "Cancel"}
+3 -1
View File
@@ -1076,6 +1076,8 @@ const unsigned char boot_lua[] =
0x29, 0x0a, 0x29, 0x0a,
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x4c,
0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x28, 0x29, 0x0a,
0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x20, 0x74, 0x68, 0x65,
0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x28, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x28,
0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
@@ -1156,7 +1158,7 @@ const unsigned char boot_lua[] =
0x20, 0x22, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x22, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x74, 0x6f, 0x09, 0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x74, 0x6f,
0x75, 0x63, 0x68, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x75, 0x63, 0x68, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x6c,
0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x74, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x74, 0x6c,
0x65, 0x28, 0x29, 0x0a, 0x65, 0x28, 0x29, 0x0a,