mirror of
https://github.com/britzl/monarch.git
synced 2025-11-26 19:00:53 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c6e26fd71 | ||
|
|
00c30792a9 | ||
|
|
b01f5d28c3 | ||
|
|
43e847dacc | ||
|
|
ce5ca26b6c |
@@ -114,7 +114,7 @@ end
|
|||||||
|
|
||||||
function on_message(self, message_id, message, sender)
|
function on_message(self, message_id, message, sender)
|
||||||
if message_id == hash("my_resize_message") then
|
if message_id == hash("my_resize_message") then
|
||||||
self.transition.window_resized(message.width, message.height)
|
transition.window_resized(message.width, message.height)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function on_input(self, action_id, action)
|
|||||||
end
|
end
|
||||||
elseif gui.pick_node(self.no, action.x, action.y) then
|
elseif gui.pick_node(self.no, action.x, action.y) then
|
||||||
print("no")
|
print("no")
|
||||||
monarch.back(function()
|
monarch.back(nil, nil, function()
|
||||||
print("back from popup done")
|
print("back from popup done")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function on_input(self, action_id, action)
|
|||||||
end)
|
end)
|
||||||
elseif gui.pick_node(self.cancel, action.x, action.y) then
|
elseif gui.pick_node(self.cancel, action.x, action.y) then
|
||||||
print("cancel")
|
print("cancel")
|
||||||
monarch.back(function()
|
monarch.back(nil, nil, function()
|
||||||
print("back from popup done")
|
print("back from popup done")
|
||||||
end)
|
end)
|
||||||
elseif gui.pick_node(self.about, action.x, action.y) then
|
elseif gui.pick_node(self.about, action.x, action.y) then
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function on_input(self, action_id, action)
|
|||||||
end)
|
end)
|
||||||
elseif gui.pick_node(self.back, action.x, action.y) then
|
elseif gui.pick_node(self.back, action.x, action.y) then
|
||||||
print("back")
|
print("back")
|
||||||
monarch.back(function()
|
monarch.back(nil, nil, function()
|
||||||
print("back from pregame done")
|
print("back from pregame done")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -520,8 +520,12 @@ local function load(screen)
|
|||||||
msg.post(screen.proxy, MSG_ENABLE)
|
msg.post(screen.proxy, MSG_ENABLE)
|
||||||
elseif screen.factory then
|
elseif screen.factory then
|
||||||
screen.factory_ids = collectionfactory.create(screen.factory)
|
screen.factory_ids = collectionfactory.create(screen.factory)
|
||||||
screen.transition_url = screen.factory_ids[screen.transition_id]
|
if screen.transition_id then
|
||||||
screen.focus_url = screen.factory_ids[screen.focus_id]
|
screen.transition_url = screen.factory_ids[screen.transition_id]
|
||||||
|
end
|
||||||
|
if screen.focus_id then
|
||||||
|
screen.focus_url = screen.factory_ids[screen.focus_id]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
screen.loaded = true
|
screen.loaded = true
|
||||||
screen.preloaded = false
|
screen.preloaded = false
|
||||||
@@ -920,7 +924,7 @@ function M.hide(id, cb)
|
|||||||
log("hide() you can only hide the screen at the top of the stack", id)
|
log("hide() you can only hide the screen at the top of the stack", id)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return M.back(id, cb)
|
return M.back(nil, nil, cb)
|
||||||
else
|
else
|
||||||
log("hide() queuing action", id)
|
log("hide() queuing action", id)
|
||||||
queue_action(function(action_done, action_error)
|
queue_action(function(action_done, action_error)
|
||||||
@@ -982,17 +986,6 @@ end
|
|||||||
-- @param cb (function) - Optional callback to invoke when the previous screen is visible again
|
-- @param cb (function) - Optional callback to invoke when the previous screen is visible again
|
||||||
function M.back(options, data, cb)
|
function M.back(options, data, cb)
|
||||||
log("back() queuing action")
|
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
|
|
||||||
options = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
queue_action(function(action_done)
|
queue_action(function(action_done)
|
||||||
local callbacks = callback_tracker()
|
local callbacks = callback_tracker()
|
||||||
|
|||||||
Reference in New Issue
Block a user