mirror of
https://github.com/britzl/monarch.git
synced 2025-11-26 19:00:53 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dec704047 | ||
|
|
9764c68475 | ||
|
|
d57d550859 |
@@ -650,10 +650,10 @@ local function back_out(screen, next_screen, wait_for_transition, cb)
|
|||||||
change_context(screen)
|
change_context(screen)
|
||||||
release_input(screen, next_screen)
|
release_input(screen, next_screen)
|
||||||
focus_lost(screen, next_screen)
|
focus_lost(screen, next_screen)
|
||||||
|
transition(screen, M.TRANSITION.BACK_OUT, { next_screen = next_screen and next_screen.id }, wait_for_transition)
|
||||||
if next_screen and screen.popup then
|
if next_screen and screen.popup then
|
||||||
reset_timestep(next_screen)
|
reset_timestep(next_screen)
|
||||||
end
|
end
|
||||||
transition(screen, M.TRANSITION.BACK_OUT, { next_screen = next_screen and next_screen.id }, wait_for_transition)
|
|
||||||
screen.visible = false
|
screen.visible = false
|
||||||
unload(screen)
|
unload(screen)
|
||||||
active_transition_count = active_transition_count - 1
|
active_transition_count = active_transition_count - 1
|
||||||
@@ -879,7 +879,7 @@ function M.clear(cb)
|
|||||||
local top = stack[#stack]
|
local top = stack[#stack]
|
||||||
while top and top.visible do
|
while top and top.visible do
|
||||||
stack[#stack] = nil
|
stack[#stack] = nil
|
||||||
await(back_out, top, screen, WAIT_FOR_TRANSITION, resume)
|
await(back_out, top, stack[#stack - 1], WAIT_FOR_TRANSITION, resume)
|
||||||
top = stack[#stack]
|
top = stack[#stack]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -921,9 +921,20 @@ function M.back(data, cb)
|
|||||||
if data then
|
if data then
|
||||||
top.data = data
|
top.data = data
|
||||||
end
|
end
|
||||||
back_in(top, screen, DO_NOT_WAIT_FOR_TRANSITION, function()
|
-- if the screen we are backing out from is a popup and the screen we go
|
||||||
back_out(screen, top, WAIT_FOR_TRANSITION, back_cb)
|
-- back to is not a popup we need to let the popup completely hide before
|
||||||
end)
|
-- we start working on the screen we go back to
|
||||||
|
-- we do this to ensure that we do not reset the times step of the screen
|
||||||
|
-- we go back to until it is no longer obscured by the popup
|
||||||
|
if screen.popup and not top.popup then
|
||||||
|
back_out(screen, top, WAIT_FOR_TRANSITION, function()
|
||||||
|
back_in(top, screen, WAIT_FOR_TRANSITION, back_cb)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
back_in(top, screen, DO_NOT_WAIT_FOR_TRANSITION, function()
|
||||||
|
back_out(screen, top, WAIT_FOR_TRANSITION, back_cb)
|
||||||
|
end)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
back_out(screen, top, WAIT_FOR_TRANSITION, back_cb)
|
back_out(screen, top, WAIT_FOR_TRANSITION, back_cb)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function M.create()
|
|||||||
|
|
||||||
local function invoke_if_done()
|
local function invoke_if_done()
|
||||||
if all_callbacks_done then
|
if all_callbacks_done then
|
||||||
print("Warning: The same callback will be invoked twice from the callback tracker!", id or "")
|
print("Warning: The same callback will be invoked twice from the callback tracker!")
|
||||||
end
|
end
|
||||||
if callback_count == 0 and callback then
|
if callback_count == 0 and callback then
|
||||||
all_callbacks_done = true
|
all_callbacks_done = true
|
||||||
@@ -52,6 +52,6 @@ end
|
|||||||
|
|
||||||
return setmetatable(M, {
|
return setmetatable(M, {
|
||||||
__call = function(_, ...)
|
__call = function(_, ...)
|
||||||
return M.create(...)
|
return M.create()
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user