add settings API

This commit is contained in:
Evgeny
2021-08-31 19:43:38 +03:00
parent 7d03496bfc
commit 74d101c673
11 changed files with 92 additions and 72 deletions

View File

@@ -1,12 +0,0 @@
-- arguments_help = "The word recorded here will be displayed on the screen."
-- arguments_default = "Word"
function on_resume()
local args = aio:get_args()
if args == nil then
ui:show_text("args is empty")
else
ui:show_text("arg1: "..args[1])
end
end

18
samples/settings-test.lua Normal file
View File

@@ -0,0 +1,18 @@
function on_resume()
local s1 = {
key1 = "value1",
key2 = "value2",
}
settings:set_kv(s1)
local s2 = settings:get_kv()
ui:show_text("key1="..s2.key1.." ".."key2="..s2.key2)
end
function on_settings()
local s = settings:get_kv()
ui:show_dialog("Settings", "key1="..s.key1.." ".."key2="..s.key2)
end