mirror of
https://github.com/britzl/monarch.git
synced 2025-06-27 02:17:53 +02:00
Set focus, transition and receiver as deprecated
This commit is contained in:
parent
c601174b9d
commit
0191a4e540
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 83 KiB |
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 92 KiB |
@ -20,6 +20,9 @@ local MSG_UNLOAD = hash("unload")
|
|||||||
local MSG_ENABLE = hash("enable")
|
local MSG_ENABLE = hash("enable")
|
||||||
local MSG_DISABLE = hash("disable")
|
local MSG_DISABLE = hash("disable")
|
||||||
|
|
||||||
|
|
||||||
|
local DEPRECATED = hash("/__DEPRECATED__")
|
||||||
|
|
||||||
-- transition messages
|
-- transition messages
|
||||||
M.TRANSITION = {}
|
M.TRANSITION = {}
|
||||||
M.TRANSITION.DONE = hash("transition_done")
|
M.TRANSITION.DONE = hash("transition_done")
|
||||||
@ -269,12 +272,6 @@ end
|
|||||||
-- keep input focus when below a popup
|
-- keep input focus when below a popup
|
||||||
-- * others_keep_input_focus_when_below_screen - If screens below this
|
-- * others_keep_input_focus_when_below_screen - If screens below this
|
||||||
-- screen should keep input focus
|
-- screen should keep input focus
|
||||||
-- * transition_url - URL to a script that is responsible for the
|
|
||||||
-- screen transitions
|
|
||||||
-- * focus_url - URL to a script that is to be notified of focus
|
|
||||||
-- lost/gained events
|
|
||||||
-- * receiver_url - URL to a script that is to receive messages sent
|
|
||||||
-- using monarch.send()
|
|
||||||
-- * auto_preload - true if the screen should be automatically preloaded
|
-- * auto_preload - true if the screen should be automatically preloaded
|
||||||
function M.register_proxy(id, proxy, settings)
|
function M.register_proxy(id, proxy, settings)
|
||||||
assert(proxy, "You must provide a collection proxy URL")
|
assert(proxy, "You must provide a collection proxy URL")
|
||||||
@ -284,6 +281,15 @@ function M.register_proxy(id, proxy, settings)
|
|||||||
screen.focus_url = settings and settings.focus_url
|
screen.focus_url = settings and settings.focus_url
|
||||||
screen.receiver_url = settings and settings.receiver_url
|
screen.receiver_url = settings and settings.receiver_url
|
||||||
screen.auto_preload = settings and settings.auto_preload
|
screen.auto_preload = settings and settings.auto_preload
|
||||||
|
if screen.transition_url.path == DEPRECATED then
|
||||||
|
screen.transition_url = nil
|
||||||
|
end
|
||||||
|
if screen.focus_url.path == DEPRECATED then
|
||||||
|
screen.focus_url = nil
|
||||||
|
end
|
||||||
|
if screen.receiver_url.path == DEPRECATED then
|
||||||
|
screen.receiver_url = nil
|
||||||
|
end
|
||||||
if screen.auto_preload then
|
if screen.auto_preload then
|
||||||
M.preload(id)
|
M.preload(id)
|
||||||
end
|
end
|
||||||
@ -306,10 +312,6 @@ M.register = M.register_proxy
|
|||||||
-- keep input focus when below a popup
|
-- keep input focus when below a popup
|
||||||
-- * others_keep_input_focus_when_below_screen - If screens below this
|
-- * others_keep_input_focus_when_below_screen - If screens below this
|
||||||
-- screen should keep input focus
|
-- screen should keep input focus
|
||||||
-- * transition_id - Id of the game object in the collection that is responsible
|
|
||||||
-- for the screen transitions
|
|
||||||
-- * focus_id - Id of the game object in the collection that is to be notified
|
|
||||||
-- of focus lost/gained events
|
|
||||||
-- * auto_preload - true if the screen should be automatically preloaded
|
-- * auto_preload - true if the screen should be automatically preloaded
|
||||||
function M.register_factory(id, factory, settings)
|
function M.register_factory(id, factory, settings)
|
||||||
assert(factory, "You must provide a collection factory URL")
|
assert(factory, "You must provide a collection factory URL")
|
||||||
@ -318,6 +320,13 @@ function M.register_factory(id, factory, settings)
|
|||||||
screen.transition_id = settings and settings.transition_id
|
screen.transition_id = settings and settings.transition_id
|
||||||
screen.focus_id = settings and settings.focus_id
|
screen.focus_id = settings and settings.focus_id
|
||||||
screen.auto_preload = settings and settings.auto_preload
|
screen.auto_preload = settings and settings.auto_preload
|
||||||
|
|
||||||
|
if screen.transition_id == DEPRECATED then
|
||||||
|
screen.transition_id = nil
|
||||||
|
end
|
||||||
|
if screen.focus_id == DEPRECATED then
|
||||||
|
screen.focus_id = nil
|
||||||
|
end
|
||||||
if screen.auto_preload then
|
if screen.auto_preload then
|
||||||
M.preload(id)
|
M.preload(id)
|
||||||
end
|
end
|
||||||
|
@ -6,8 +6,8 @@ go.property("popup", false)
|
|||||||
go.property("popup_on_popup", false)
|
go.property("popup_on_popup", false)
|
||||||
go.property("screen_keeps_input_focus_when_below_popup", false)
|
go.property("screen_keeps_input_focus_when_below_popup", false)
|
||||||
go.property("others_keep_input_focus_when_below_screen", false)
|
go.property("others_keep_input_focus_when_below_screen", false)
|
||||||
go.property("transition_id", hash(""))
|
go.property("transition_id", hash("__DEPRECATED__"))
|
||||||
go.property("focus_id", hash(""))
|
go.property("focus_id", hash("__DEPRECATED__"))
|
||||||
go.property("preload", false)
|
go.property("preload", false)
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ go.property("popup_on_popup", false)
|
|||||||
go.property("timestep_below_popup", 1)
|
go.property("timestep_below_popup", 1)
|
||||||
go.property("screen_keeps_input_focus_when_below_popup", false)
|
go.property("screen_keeps_input_focus_when_below_popup", false)
|
||||||
go.property("others_keep_input_focus_when_below_screen", false)
|
go.property("others_keep_input_focus_when_below_screen", false)
|
||||||
go.property("transition_url", msg.url())
|
go.property("transition_url", msg.url("__DEPRECATED__"))
|
||||||
go.property("focus_url", msg.url())
|
go.property("focus_url", msg.url("__DEPRECATED__"))
|
||||||
go.property("receiver_url", msg.url())
|
go.property("receiver_url", msg.url("__DEPRECATED__"))
|
||||||
go.property("preload", false)
|
go.property("preload", false)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user