3
0
mirror of https://github.com/britzl/monarch.git synced 2025-06-26 18:07:46 +02:00

Removed backward comp fix for monarch.back()

This commit is contained in:
Björn Ritzl 2024-01-12 08:31:48 +01:00
parent 00c30792a9
commit 4c6e26fd71
4 changed files with 4 additions and 14 deletions

View File

@ -29,7 +29,7 @@ function on_input(self, action_id, action)
end
elseif gui.pick_node(self.no, action.x, action.y) then
print("no")
monarch.back(function()
monarch.back(nil, nil, function()
print("back from popup done")
end)
end

View File

@ -27,7 +27,7 @@ function on_input(self, action_id, action)
end)
elseif gui.pick_node(self.cancel, action.x, action.y) then
print("cancel")
monarch.back(function()
monarch.back(nil, nil, function()
print("back from popup done")
end)
elseif gui.pick_node(self.about, action.x, action.y) then

View File

@ -19,7 +19,7 @@ function on_input(self, action_id, action)
end)
elseif gui.pick_node(self.back, action.x, action.y) then
print("back")
monarch.back(function()
monarch.back(nil, nil, function()
print("back from pregame done")
end)
end

View File

@ -924,7 +924,7 @@ function M.hide(id, cb)
log("hide() you can only hide the screen at the top of the stack", id)
return false
end
return M.back(id, cb)
return M.back(nil, nil, cb)
else
log("hide() queuing action", id)
queue_action(function(action_done, action_error)
@ -986,16 +986,6 @@ end
-- @param cb (function) - Optional callback to invoke when the previous screen is visible again
function M.back(options, data, cb)
log("back() queuing action")
-- backwards compatibility with old version M.back(data, cb)
-- case when back(data, cb)
if type(data) == "function" then
cb = data
data = options
options = nil
-- case when back(data, nil)
elseif options ~= nil and data == nil and cb == nil then
data = options
end
queue_action(function(action_done)
local callbacks = callback_tracker()