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H36MXCAC
ICUW7F3XQLURK4LSNPH5E3NDEFSRHKATEUHH2UPFJTMHYR3ZJF3QC
KC52TVUD2NB4OUFR75SR36CSDWOI3UTCNZ6S24RUIWK4SRLIM7JAC
A4BSGS2CX4JK7IELL655EC6HAY6ILCWTGIHWZXHRGQOKU3HSUPLAC
BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC
HMMUQOIY7EMGDJB6KWOWCSKA5OXBQXTT5PT3QXXQOMTA742LSGNAC
VMV4LBR4O26OBLEBKG5UD53H5JOIZOTSVVJ5PNZCPG54PHMLYEFAC
A7O6MZIUNUHW65ODP7GLYO37RQ26AOUDGP5Z6M2RG77VZWKL27BQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
function App.version_check()
-- available modes: run, error
Error_message = nil
Error_count = 0
-- we'll reuse error mode on load for an initial version check
local supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version first
local minor_version
Major_version, minor_version = love.getVersion()
Version = Major_version..'.'..minor_version
if array.find(supported_versions, Version) == nil then
Current_app = 'error'
Error_message = ("This app doesn't support version %s; please use version %s. Press any key to try it with this version anyway."):format(Version, supported_versions[1])
print(Error_message)
-- continue initializing everything; hopefully we won't have errors during initialization
end
end
function App.initialize_globals()
Supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version first
check_love_version_for_tests()
function App.initialize()
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
love.keyboard.setKeyRepeat(true)
love.graphics.setBackgroundColor(1,1,1)
if Current_app == 'pong' then
pong.initialize()
elseif Current_app == 'source' then
source.initialize()
elseif Current_app == 'error' then
else
assert(false, 'unknown app "'..Current_app..'"')
end
end
function App.resize(w,h)
if Current_app == 'pong' then
if pong.resize then pong.resize(w,h) end
elseif Current_app == 'source' then
if source.resize then source.resize(w,h) end
function App.initialize_globals()
Supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version first
check_love_version_for_tests()
if Current_app == 'run' then
run.initialize_globals()
elseif Current_app == 'source' then
source.initialize_globals()
elseif Current_app == 'error' then
elseif current_app_is_warning() then
else
assert(false, 'unknown app "'..Current_app..'"')
end
Last_resize_time = Current_time
-- Another weird bit for a class of corner cases. E.g.:
-- * I press ctrl+e, switch Current_app. I don't want the new app to receive
-- text_input and key_release events.
-- If I try to avoid text_input events by switching modes on key_release, I
-- hit a new problem:
-- * I press ctrl+e, am running an untested version, Current_app goes to
-- 'warning', and immediately rolls back out of 'warning' in the
-- key_release event.
-- Skip_rest_of_key_events is ugly, but feels cleaner than creating yet
-- another possible value for Current_app.
Skip_rest_of_key_events = nil
function check_love_version_for_tests()
if array.find(Supported_versions, Version) == nil then
-- warning to include in an error message if any tests failed
Warning_before_tests = ("This app hasn't been tested with LÖVE version %s."):format(Version)
end
end
check_love_version()
function check_love_version()
if array.find(Supported_versions, Version) == nil then
show_warning(
("This app hasn't been tested with LÖVE version %s; please switch to version %s if you run into issues. Press any key to continue."):format(Version, Supported_versions[1]))
-- continue initializing everything; hopefully we won't have errors during initialization
end
end
function App.resize(w,h)
elseif current_app_is_warning() then
love.graphics.printf(Current_app.message, 40,40, 600)
if current_app_is_warning() then return end
end
function current_app_is_warning()
return type(Current_app) == 'table' and Current_app.name == 'warning'
end
function show_warning(message)
assert(type(Current_app) == 'string')
Current_app = {
name = 'warning',
message = message,
next_app = Current_app,
}
function clear_warning()
assert(type(Current_app) == 'table')
Current_app = Current_app.next_app
end
if current_app_is_warning() then return end
if current_app_is_warning() then return end
function App.filedropped(file)
if Current_app == 'pong' then
if pong.file_drop then pong.file_drop(file) end
if current_app_is_warning() then return end
elseif Current_app == 'source' then
if source.file_drop then source.file_drop(file) end
elseif Current_app == 'error' then
else
assert(false, 'unknown app "'..Current_app..'"')
-- Current_app =
-- | run
-- | source
-- | {name=warning message='...' next_app = run|source}
elseif current_app_is_warning() then
if Current_app == nil then
Current_app = 'run'
error(('There were %d test failures:\n\n%s'):format(#Test_errors, table.concat(Test_errors)))
local error_message = ''
if Warning_before_tests then
error_message = Warning_before_tests..'\n\n'
end
error_message = error_message .. ('There were %d test failures:\n%s'):format(#Test_errors, table.concat(Test_errors))
error(error_message)
local error_message = ''
if Warning_before_tests then
error_message = Warning_before_tests..'\n\n'
end
error_message = error_message .. ('There were %d test failures:\n%s'):format(#Test_errors, table.concat(Test_errors))
error(error_message)
Version, Major_version = App.love_version()
- run with an unsupported version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key.
- run with an untested version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key.
- run with a LÖVE v12 release candidate. No errors; it is a supported version. All tests pass.
* run with an unsupported version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key. Press ctrl+e to edit source. Source editor opens up without checking version.
* run with an untested version. Error message pops up. Press a key. Pong comes up, and doesn't receive the key. Press ctrl+e. Error pops up. Press a key. Source editor opens up. Press ctrl+e. Error pops up. Press a key. Pong returns.
* create a couple of spuriously failing tests. Run with an untested version. Error message includes message about untested version.
* run with an untested version. Error message pops up. Press a key. Text editor comes up, and doesn't receive the key. Press ctrl+e. Error pops up. Press a key. Source editor opens up. Press ctrl+e. Error pops up. Press a key. Text editor returns.
* create a couple of spuriously failing tests. Run with an untested version. Error message includes message about untested version.