diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-03-21 10:50:23 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-03-21 10:50:23 +1100 |
| commit | 684ff50ef4931aeb8cfb15c5a2d62e55520f04a5 (patch) | |
| tree | d7dc003eb1fd7b1a4960cb05d8084f18ddf64b72 /src/lua | |
| parent | 21ae6a962623c9128fbb4a599cc50a2c616e9884 (diff) | |
| download | tangara-fw-684ff50ef4931aeb8cfb15c5a2d62e55520f04a5.tar.gz | |
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.
Diffstat (limited to 'src/lua')
| -rw-r--r-- | src/lua/lua_screen.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lua/lua_screen.cpp b/src/lua/lua_screen.cpp index 27843bc7..f17f6b1a 100644 --- a/src/lua/lua_screen.cpp +++ b/src/lua/lua_screen.cpp @@ -50,11 +50,15 @@ static auto screen_noop(lua_State* state) -> int { return 0; } -static const struct luaL_Reg kScreenFuncs[] = {{"new", screen_new}, - {"createUi", screen_noop}, - {"onShown", screen_noop}, - {"onHidden", screen_noop}, - {NULL, NULL}}; +static auto screen_true(lua_State* state) -> int { + lua_pushboolean(state, true); + return 1; +} + +static const struct luaL_Reg kScreenFuncs[] = { + {"new", screen_new}, {"createUi", screen_noop}, + {"onShown", screen_noop}, {"onHidden", screen_noop}, + {"canPop", screen_true}, {NULL, NULL}}; static auto lua_screen(lua_State* state) -> int { luaL_newlib(state, kScreenFuncs); |
