From 99930149044300dc8f92c8a07e33ea1669e9d37d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 3 Dec 2023 12:11:17 -0800 Subject: bugfix: version check --- Manual_tests.md | 2 ++ app.lua | 1 + main.lua | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Manual_tests.md b/Manual_tests.md index fcc3a29..4aa3897 100644 --- a/Manual_tests.md +++ b/Manual_tests.md @@ -17,6 +17,8 @@ Initializing settings: - start out editing source, move window, press ctrl+e twice; window is editing source in same position+dimensions - no log file; switching to source works + - 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. + Code loading: * run love with directory; text editor runs * run love with zip file; text editor runs diff --git a/app.lua b/app.lua index 35350d4..4142380 100644 --- a/app.lua +++ b/app.lua @@ -107,6 +107,7 @@ function App.run_tests_and_initialize() App.disable_tests() App.initialize_globals() App.initialize(love.arg.parseGameArguments(arg), arg) + App.version_check() end function App.run_tests() diff --git a/main.lua b/main.lua index 4570800..e68d7cb 100644 --- a/main.lua +++ b/main.lua @@ -254,13 +254,14 @@ function App.textinput(t) end function App.keyreleased(key, scancode) - if Current_app == 'error' then return end -- ignore events for some time after window in focus (mostly alt-tab) if Current_time < Last_focus_time + 0.01 then return end -- - if Current_app == 'run' then + if Current_app == 'error' then + Current_app = 'run' + elseif Current_app == 'run' then if run.key_release then run.key_release(key, scancode) end elseif Current_app == 'source' then if source.key_release then source.key_release(key, scancode) end -- cgit 1.4.1-2-gfad0 From f37b45196aff116bd1df68e82aebd94e99ab7725 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 3 Dec 2023 12:12:56 -0800 Subject: speculatively recommend new LÖVE v11.5 in all forks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.lua b/main.lua index e68d7cb..034953e 100644 --- a/main.lua +++ b/main.lua @@ -77,7 +77,7 @@ function App.version_check() Error_message = nil Error_count = 0 -- we'll reuse error mode on load for an initial version check - local supported_versions = {'11.4', '12.0'} -- put the recommended version first + 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 -- cgit 1.4.1-2-gfad0 From f6bc670ef689aa6485f3e3ad242efb5271b48f58 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 3 Dec 2023 12:30:16 -0800 Subject: yet another bugfix to the version check We could now get test failures before the version check, which might be confusing. --- Manual_tests.md | 1 + app.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Manual_tests.md b/Manual_tests.md index 4aa3897..c874610 100644 --- a/Manual_tests.md +++ b/Manual_tests.md @@ -29,6 +29,7 @@ Code loading: - analogously, how a shape precisely looks as you draw it * start out running the text editor, press ctrl+e 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+e to edit source. Source editor opens up without checking version. ### Other compromises diff --git a/app.lua b/app.lua index 4142380..e4b67cc 100644 --- a/app.lua +++ b/app.lua @@ -8,10 +8,10 @@ -- and a source editor, while giving each the illusion of complete -- control. function love.run() - App.version_check() App.snapshot_love() -- Tests always run at the start. App.run_tests_and_initialize() + App.version_check() --? print('==') love.timer.step() @@ -107,7 +107,6 @@ function App.run_tests_and_initialize() App.disable_tests() App.initialize_globals() App.initialize(love.arg.parseGameArguments(arg), arg) - App.version_check() end function App.run_tests() -- cgit 1.4.1-2-gfad0