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5QS22JEO52EF4VTLMB4CDK4RLSCK7HCAC 2Y7YH7UPQWDNYDJN4BYY2MOHA36B2BIRX6DMIAKHJPQC7UP2R6NQC 2CK5QI7WA7M4IVSACFGOJYAIDKRUTZVMMPSFWEJTUNMWTN7AX4NAC 3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC JCXL74WVQ23V53EOCKA2NXQIYA5NNOXGN5WYC7ZW42EI2I6D5IJAC PESSMQBJCOIA5PYNVKUG4D25VTFIG44QVCAOFRD4PKOJNW2AIHKAC KRLRRLVGMTN66AWJ3EB6P6ZLFSGVBMMGACA7I4FXCGVRNTKOYV7AC CUFW4EJL75OAA5BS5EXGTM5RMRNJOBBPAXUJADGZ3VLP2ZMKFOTAC A4BSGS2CX4JK7IELL655EC6HAY6ILCWTGIHWZXHRGQOKU3HSUPLAC ECBDENZ4ZEIYS3FJQNTIW2NITDIQLYUFPIPA7KV4Z5TYVI5EECPAC VMV4LBR4O26OBLEBKG5UD53H5JOIZOTSVVJ5PNZCPG54PHMLYEFAC BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC QFOQPDDW2C7TDPDNT67VU76HGZGTFXQY52R3BNONU5C4F5NYPAOQC 2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC function App.version_check()Mode = 'version_check'Supported_versions = {'11.5', '11.4', '11.3', '11.2', '11.1', '11.0', '12.0'} -- put the recommended version firstlocal minor_versionMajor_version, minor_version = love.getVersion()Version = Major_version..'.'..minor_versionif array.find(Supported_versions, Version) thenMode = 'run'endend
if Current_app == nil thenCurrent_app = 'run'elseif current_app_is_warning() thenif Current_app == 'run' thenrun.initialize_globals()elseif Current_app == 'source' thensource.initialize_globals()elseif current_app_is_warning() thenelseassert(false, 'unknown app "'..Current_app..'"')endfunction App.initialize_globals()Supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstcheck_love_version_for_tests()
-- 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
endcheck_love_version()endfunction check_love_version()if array.find(Supported_versions, Version) == nil thenMode = 'version_check'-- continue initializing everything; hopefully we won't have errors during initialization
love.graphics.printf(("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]), 40,40, 400)
love.graphics.printf(("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]), 40,40, 400)
elseif current_app_is_warning() thenlove.graphics.printf(Current_app.message, 40,40, 600)
Skip_rest_of_key_events = nilif current_app_is_warning() thenelseclear_warning()Skip_rest_of_key_events = trueSkip_rest_of_key_events = true
endif Skip_rest_of_key_events then return endif Current_app == 'run' thenif current_app_is_warning() then return endif current_app_is_warning() then return endif current_app_is_warning() then return endif current_app_is_warning() then return endendfunction current_app_is_warning()return type(Current_app) == 'table' and Current_app.name == 'warning'endfunction 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
if current_app_is_warning() then return endfunction check_love_version()if array.find(Supported_versions, Version) == nil thenshow_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 initializationendendif current_app_is_warning() then return end
error('There were test failures:\n\n'..table.concat(Test_errors))
local error_message = ''if Warning_before_tests thenerror_message = Warning_before_tests..'\n\n'enderror_message = error_message .. ('There were %d test failures:\n%s'):format(#Test_errors, table.concat(Test_errors))error(error_message)
function App.love_version()local major_version, minor_version = love.getVersion()local version = major_version..'.'..minor_versionreturn version, major_versionendApp = {}
App = {}function App.love_version()local major_version, minor_version = love.getVersion()local version = major_version..'.'..minor_versionreturn version, major_versionend
local error_message = ''if Warning_before_tests thenerror_message = Warning_before_tests..'\n\n'enderror_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 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.