From ef72b25660912ff247997089abfb93e9f0b52809 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 7 Mar 2024 10:59:03 +1100 Subject: use prototype inheritance for lua screens, rather than functions this gives us a way to give each screen nice little hooks, like 'onShown' and 'onHidden'. later we can use these hooks to disable bindings for screens that aren't in-use. --- src/ui/include/screen_lua.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ui/include/screen_lua.hpp') diff --git a/src/ui/include/screen_lua.hpp b/src/ui/include/screen_lua.hpp index ee9f6813..0ed3a508 100644 --- a/src/ui/include/screen_lua.hpp +++ b/src/ui/include/screen_lua.hpp @@ -18,6 +18,9 @@ class Lua : public Screen { Lua(); ~Lua(); + auto onShown() -> void override; + auto onHidden() -> void override; + auto SetObjRef(lua_State*) -> void; private: -- cgit v1.2.3 From 684ff50ef4931aeb8cfb15c5a2d62e55520f04a5 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 21 Mar 2024 10:50:23 +1100 Subject: Add support for screens declaring that they can't be popped Needed as prep for usb msc support; you really shouldn't leave the MSC settings screen until you've disabled usb msc. --- src/ui/include/screen_lua.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/include/screen_lua.hpp') diff --git a/src/ui/include/screen_lua.hpp b/src/ui/include/screen_lua.hpp index 0ed3a508..41d97a1e 100644 --- a/src/ui/include/screen_lua.hpp +++ b/src/ui/include/screen_lua.hpp @@ -21,6 +21,8 @@ class Lua : public Screen { auto onShown() -> void override; auto onHidden() -> void override; + auto canPop() -> bool override; + auto SetObjRef(lua_State*) -> void; private: -- cgit v1.2.3