diff --git a/.gitignore b/.gitignore index fb6af1f..8e0296c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ Thumbs.db .cproject builtins dist +deployer_version_settings.txt +.deployer_cache diff --git a/deployer_build_stats.csv b/deployer_build_stats.csv new file mode 100644 index 0000000..20e6861 --- /dev/null +++ b/deployer_build_stats.csv @@ -0,0 +1,6 @@ +date,sha,version,build_size,build_time,platform,mode,is_cache_using,commits_count +2022-02-28T19:06:43Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,68,armv7-android,debug,true,521 +2022-02-28T19:14:56Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,51,armv7-android,debug,true,521 +2022-02-28T19:16:23Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,11,armv7-android,debug,true,521 +2022-02-28T19:19:46Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,11,armv7-android,debug,true,521 +2022-02-28T19:22:51Z,3b329f9c25c9672e4030edb039b0225fa46f7ce1,0.8.521,4356,11,armv7-android,debug,true,521 diff --git a/druid/component.lua b/druid/component.lua index 3c32e64..b18e1a0 100644 --- a/druid/component.lua +++ b/druid/component.lua @@ -40,11 +40,11 @@ BaseComponent.ALL_INTERESTS = { -- Mapping from on_message method to specific method name BaseComponent.SPECIFIC_UI_MESSAGES = { - [hash(BaseComponent.ON_FOCUS_LOST)] = "on_focus_lost", - [hash(BaseComponent.ON_FOCUS_GAINED)] = "on_focus_gained", - [hash(BaseComponent.ON_LAYOUT_CHANGE)] = "on_layout_change", - [hash(BaseComponent.ON_MESSAGE_INPUT)] = "on_message_input", - [hash(BaseComponent.ON_LANGUAGE_CHANGE)] = "on_language_change", + [hash("layout_changed")] = BaseComponent.ON_LAYOUT_CHANGE, -- The message_id from Defold + [hash(BaseComponent.ON_FOCUS_LOST)] = BaseComponent.ON_FOCUS_LOST, + [hash(BaseComponent.ON_FOCUS_GAINED)] = BaseComponent.ON_FOCUS_GAINED, + [hash(BaseComponent.ON_MESSAGE_INPUT)] = BaseComponent.ON_MESSAGE_INPUT, + [hash(BaseComponent.ON_LANGUAGE_CHANGE)] = BaseComponent.ON_LANGUAGE_CHANGE, } diff --git a/druid/const.lua b/druid/const.lua index f05cb90..c04896c 100755 --- a/druid/const.lua +++ b/druid/const.lua @@ -38,7 +38,7 @@ M.ON_MESSAGE = "on_message" M.ON_LATE_INIT = "on_late_init" M.ON_FOCUS_LOST = "on_focus_lost" M.ON_FOCUS_GAINED = "on_focus_gained" -M.ON_LAYOUT_CHANGE = "on_layout_changed" +M.ON_LAYOUT_CHANGE = "on_layout_change" M.ON_MESSAGE_INPUT = "on_message_input" M.ON_LANGUAGE_CHANGE = "on_language_change" diff --git a/druid/extended/slider.lua b/druid/extended/slider.lua index a71a930..b5a3198 100644 --- a/druid/extended/slider.lua +++ b/druid/extended/slider.lua @@ -78,7 +78,7 @@ end function Slider.on_layout_change(self) - self:set(self.value, true) + self:set(self.value) end diff --git a/druid/extended/timer.lua b/druid/extended/timer.lua index 8e82981..307e7c0 100644 --- a/druid/extended/timer.lua +++ b/druid/extended/timer.lua @@ -87,6 +87,12 @@ function Timer.update(self, dt) end end + +function Timer.on_layout_change(self) + self:set_to(self.last_value) +end + + --- Set text to text field -- @tparam Timer self -- @tparam number set_to Value in seconds diff --git a/example/custom.display_profiles b/example/custom.display_profiles new file mode 100644 index 0000000..921fa6a --- /dev/null +++ b/example/custom.display_profiles @@ -0,0 +1,14 @@ +profiles { + name: "Landscape" + qualifiers { + width: 900 + height: 600 + } +} +profiles { + name: "Portrait" + qualifiers { + width: 600 + height: 900 + } +} diff --git a/example/examples/general/overview/overview.gui b/example/examples/general/overview/overview.gui index d78289b..2d51076 100644 --- a/example/examples/general/overview/overview.gui +++ b/example/examples/general/overview/overview.gui @@ -3012,5 +3012,467 @@ layers { name: "text" } material: "/builtins/materials/gui.material" +layouts { + name: "Landscape" + nodes { + position { + x: -50.0 + y: 60.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_button" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: -50.0 + y: -30.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_text" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: -50.0 + y: -120.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_timer" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: -50.0 + y: -210.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_progress" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: 350.0 + y: 60.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_slider" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: 350.0 + y: -30.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_radio" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: 350.0 + y: -120.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_checkbox" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } + nodes { + position { + x: 350.0 + y: -210.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.75 + y: 0.75 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/empty" + id: "section_input" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "anchor" + layer: "image" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + overridden_fields: 1 + overridden_fields: 3 + template_node_child: false + size_mode: SIZE_MODE_AUTO + } +} +layouts { + name: "Portrait" +} adjust_reference: ADJUST_REFERENCE_PARENT max_nodes: 512 diff --git a/game.project b/game.project index 3ec651b..e38280c 100644 --- a/game.project +++ b/game.project @@ -7,10 +7,12 @@ shared_state = 1 [display] width = 600 height = 900 +display_profiles = /example/custom.display_profilesc +dynamic_orientation = 1 [project] title = druid -version = 0.8.0 +version = 0.8.1 publisher = Insality developer = Insality dependencies#0 = https://github.com/insalitygames/deftest/archive/master.zip