add settings API
This commit is contained in:
@@ -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
18
samples/settings-test.lua
Normal 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
|
||||
Reference in New Issue
Block a user