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BROJP2KPRFJ3NFSEZQC VJKBAJWASCQWI6JDVJJHL4WL2IDZF4RUT33GNILSRSPA3A6E2MBAC Z2VZTIXYXUZXF4ZUVG54IOIRSMBGUZJZ2RTBPYOJC7NWBOUFU6YAC 7AKT7IKOP6VQW3CABAVXCEZTHYNAETVXGFIQWB2L6I7LM7T57HAAC APX2PY6GAMJSUH7SFSMBFOQJBSAWLLOCKH4L4ZQP2VLHNEXJPREAC 3XQROLSKN5GIROYOSBN2OW2DSG34PKDU4BGYV7DL6F3V5RNSHATQC AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC 7SICLTEDRE23UDA5RMYFRSODTYBDWAJCX3BSYLDHVAPMTMVGDZCAC 6VJTQKW7YJ7E3WRNSTFYULUDHHTYAE4JELX4J55LO75X4FDM3JZAC MGH5UZL44BLWWF627W6FZPP5QBPDJ72QVB27GMSRTLTCXHBHPMUAC ZZOKGOFBNESTYQPZW6ODBMC2C75UL4DYMSKVTUMOWVZW4UMNO4FAC DUQDA3U7VNWZSKRVACS6G3FTEB5VXRR7FJQU5NYZ4EFSGL3XUU5QC 2Y7YH7UPQWDNYDJN4BYY2MOHA36B2BIRX6DMIAKHJPQC7UP2R6NQC 2LZV4KUM5L44MKTGJA7IPSJPXRPDYCKHM63OHJIGIJNNA7UC2FMQC BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC RVVRBJFNEHF3WRQARNVTXM75PLL4UKJZISPWPK45D6TVY45VVOTAC FJIGUGECGBLEKXGERZ6GE3CZYGSFEBCKSAUYSS7PFLHXDAKAFNKQC 42A4LJCZ2PB4CIEEXQU5BHTHKGN7JTLB2P7JZGW3OKGMYILOBZKQC O5F6DNPGQPJII6CCUYRKW6DMF3OI22YSUNBFH5PC4HLZIM3YGYBQC 2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC function App.version_check()-- available modes: run, errorError_message = nilError_count = 0-- we'll reuse error mode on load for an initial version checklocal supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstlocal minor_versionMajor_version, minor_version = love.getVersion()Version = Major_version..'.'..minor_versionif array.find(supported_versions, Version) == nil thenCurrent_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 initializationendend
function App.initialize_globals()Supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstcheck_love_version_for_tests()
endfunction App.initialize(arg)love.keyboard.setTextInput(true) -- bring up keyboard on touch screenlove.keyboard.setKeyRepeat(true)love.graphics.setBackgroundColor(1,1,1)if Current_app == 'run' thenrun.initialize(arg)elseif Current_app == 'source' thensource.initialize(arg)elseif Current_app == 'error' thenelseassert(false, 'unknown app "'..Current_app..'"')end-- Current_app =-- | run-- | source-- | {name=warning message='...' next_app = run|source}
endelseif current_app_is_warning() then
-- 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 = nilendfunction check_love_version_for_tests()if array.find(Supported_versions, Version) == nil then-- warning to include in an error message if any tests failedWarning_before_tests = ("This app hasn't been tested with LÖVE version %s."):format(Version)endend
function App.initialize(arg)love.keyboard.setTextInput(true) -- bring up keyboard on touch screenlove.keyboard.setKeyRepeat(true)love.graphics.setBackgroundColor(1,1,1)if Current_app == 'run' thenrun.initialize(arg)elseif Current_app == 'source' thensource.initialize(arg)
check_love_version()function 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 initializationendend
function save_settings_and_reboot()love.filesystem.write('config', json.encode(Settings))-- rebootload_file_from_source_or_save_directory('main.lua')App.undo_initialize()App.run_tests_and_initialize()end
if current_app_is_warning() then return endif current_app_is_warning() then return endelseif current_app_is_warning() then
- start out running the note-taking app, move window, press ctrl+e twice; window is running note-taking app in same position+dimensions- start out editing source, move window, press ctrl+e twice; window is editing source in same position+dimensions
- start out running the note-taking app, move window, press ctrl+w twice; window is running note-taking app in same position+dimensions- start out editing source, move window, press ctrl+w twice; window is editing source in same position+dimensions
- 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.
* start out running the text editor, press ctrl+w to edit source, make a change to the source, press ctrl+e twice to return to the source editor; the change should be preserved.* 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+w to edit source. Source editor opens up without checking 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.
* start out in the note-taking app, press ctrl+w to edit source, make a change to the source, press ctrl+w twice to return to the source editor; the change should be preserved.* run with an untested version. Error message pops up. Press a key. App comes up, and doesn't receive the key. Press ctrl+w. Error pops up. Press a key. Source editor opens up. Press ctrl+w. Error pops up. Press a key. App returns.
- 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.