mirror of
https://github.com/britzl/monarch.git
synced 2025-09-27 10:02:21 +02:00
Added queue support to Monarch (#49)
* Created queue and added show() as a queuable action * Improved logic in confirm popup - It should not crash if there is no next screen in data * Fixed indentation * Made the new queue a lot more stable. Fixed tests. * Removed debug output * Fixed issue with html5 builds
This commit is contained in:
@@ -18,9 +18,13 @@ function on_input(self, action_id, action)
|
||||
if action_id == hash("touch") and action.released then
|
||||
if gui.pick_node(self.yes, action.x, action.y) then
|
||||
print("yes")
|
||||
monarch.show(monarch.data("confirm").next, nil, nil, function()
|
||||
print("next screen show done")
|
||||
end)
|
||||
if monarch.data("confirm").next then
|
||||
monarch.show(monarch.data("confirm").next, nil, nil, function()
|
||||
print("next screen show done")
|
||||
end)
|
||||
else
|
||||
print("no next screen in data")
|
||||
end
|
||||
elseif gui.pick_node(self.no, action.x, action.y) then
|
||||
print("no")
|
||||
monarch.back(function()
|
||||
|
@@ -8,8 +8,7 @@ end
|
||||
|
||||
function on_message(self, message_id, message, sender)
|
||||
if message_id == hash("init_monarch") then
|
||||
monarch.show(hash("background"), { no_stack = true }, nil, function()
|
||||
monarch.show(hash("menu"))
|
||||
end)
|
||||
monarch.show(hash("background"), { no_stack = true })
|
||||
monarch.show(hash("menu"))
|
||||
end
|
||||
end
|
@@ -19,7 +19,7 @@ function on_input(self, action_id, action)
|
||||
end)
|
||||
elseif gui.pick_node(gui.get_node("about_button"), action.x, action.y) then
|
||||
monarch.show(hash("about"), nil, nil, function()
|
||||
print("showing about done")
|
||||
print("showing about done")
|
||||
end)
|
||||
elseif gui.pick_node(gui.get_node("back_button"), action.x, action.y) then
|
||||
monarch.back()
|
||||
|
Reference in New Issue
Block a user