Use a more familiar lua snake_hour

This commit is contained in:
Evgeny
2021-08-01 19:57:41 +03:00
parent 6e24536f99
commit f24288af99
26 changed files with 208 additions and 184 deletions

View File

@@ -1,27 +1,27 @@
function onResume()
ui:showLines({
function on_resume()
ui:show_lines({
"Click to open dialog",
"Click to open dialog with custom buttons",
"Click to open edit dialog",
})
end
function onClick(idx)
function on_click(idx)
if idx == 1 then
ui:showDialog("Dialog title", "This is dialog")
ui:show_dialog("Dialog title", "This is dialog")
elseif idx == 2 then
ui:showDialog("Dialog title", "This is dialog", "Button 1", "Button 2")
ui:show_dialog("Dialog title", "This is dialog", "Button 1", "Button 2")
elseif idx == 3 then
ui:showEditDialog("Dialog title", "Write any text", "default text")
ui:show_edit_dialog("Dialog title", "Write any text", "default text")
end
end
function onDialogAction(value)
function on_dialog_action(value)
if value == 1 then
ui:showToast("Button 1 clicked!")
ui:show_toast("Button 1 clicked!")
elseif value == 2 then
ui:showToast("Button 2 clicked!")
ui:show_toast("Button 2 clicked!")
elseif type(value) == "string" then
ui:showToast("Text: "..value)
ui:show_toast("Text: "..value)
end
end