diff --git a/docs/setup_factory.png b/docs/setup_factory.png index 7328b98..8811556 100644 Binary files a/docs/setup_factory.png and b/docs/setup_factory.png differ diff --git a/docs/setup_proxy.png b/docs/setup_proxy.png index 885e8ea..3ec0680 100644 Binary files a/docs/setup_proxy.png and b/docs/setup_proxy.png differ diff --git a/monarch/monarch.lua b/monarch/monarch.lua index a5c7735..3d46c52 100644 --- a/monarch/monarch.lua +++ b/monarch/monarch.lua @@ -20,6 +20,9 @@ local MSG_UNLOAD = hash("unload") local MSG_ENABLE = hash("enable") local MSG_DISABLE = hash("disable") + +local DEPRECATED = hash("/__DEPRECATED__") + -- transition messages M.TRANSITION = {} M.TRANSITION.DONE = hash("transition_done") @@ -269,12 +272,6 @@ end -- keep input focus when below a popup -- * others_keep_input_focus_when_below_screen - If screens below this -- 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 function M.register_proxy(id, proxy, settings) 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.receiver_url = settings and settings.receiver_url 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 M.preload(id) end @@ -306,10 +312,6 @@ M.register = M.register_proxy -- keep input focus when below a popup -- * others_keep_input_focus_when_below_screen - If screens below this -- 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 function M.register_factory(id, factory, settings) 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.focus_id = settings and settings.focus_id 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 M.preload(id) end diff --git a/monarch/screen_factory.script b/monarch/screen_factory.script index 15b515e..e63da84 100644 --- a/monarch/screen_factory.script +++ b/monarch/screen_factory.script @@ -6,8 +6,8 @@ go.property("popup", false) go.property("popup_on_popup", false) go.property("screen_keeps_input_focus_when_below_popup", false) go.property("others_keep_input_focus_when_below_screen", false) -go.property("transition_id", hash("")) -go.property("focus_id", hash("")) +go.property("transition_id", hash("__DEPRECATED__")) +go.property("focus_id", hash("__DEPRECATED__")) go.property("preload", false) @@ -15,7 +15,7 @@ function init(self) monarch = require "monarch.monarch" assert(not self.popup_on_popup or (self.popup_on_popup and self.popup), "Popup on Popups can only be set if the Popup flag is set") assert(self.screen_factory ~= msg.url(), "You must specify either a factory URL") - + local settings = { popup = self.popup, popup_on_popup = self.popup_on_popup, diff --git a/monarch/screen_proxy.script b/monarch/screen_proxy.script index d6ce5ea..7b362a3 100644 --- a/monarch/screen_proxy.script +++ b/monarch/screen_proxy.script @@ -7,9 +7,9 @@ go.property("popup_on_popup", false) go.property("timestep_below_popup", 1) go.property("screen_keeps_input_focus_when_below_popup", false) go.property("others_keep_input_focus_when_below_screen", false) -go.property("transition_url", msg.url()) -go.property("focus_url", msg.url()) -go.property("receiver_url", msg.url()) +go.property("transition_url", msg.url("__DEPRECATED__")) +go.property("focus_url", msg.url("__DEPRECATED__")) +go.property("receiver_url", msg.url("__DEPRECATED__")) go.property("preload", false) @@ -19,7 +19,7 @@ function init(self) assert(not self.popup_on_popup or (self.popup_on_popup and self.popup), "Popup on Popups can only be set if the Popup flag is set") assert(self.screen_proxy ~= url, "You must specify either a proxy URL") assert(self.timestep_below_popup >= 0, "Timestep must be positive") - + local settings = { popup = self.popup, popup_on_popup = self.popup_on_popup,