diff --git a/druid/base/static_grid.lua b/druid/base/static_grid.lua index 6e228fb..c32d4c0 100644 --- a/druid/base/static_grid.lua +++ b/druid/base/static_grid.lua @@ -262,7 +262,6 @@ function StaticGrid.get_size(self) end - function StaticGrid.get_size_for(self, count) if not count or count == 0 then return vmath.vector3(0) @@ -475,5 +474,4 @@ function StaticGrid:_get_zero_offset_x(row_index) end - return StaticGrid diff --git a/druid/component.lua b/druid/component.lua index 719fafa..93ad033 100644 --- a/druid/component.lua +++ b/druid/component.lua @@ -12,6 +12,8 @@ local helper = require("druid.helper") local BaseComponent = class("druid.component") +local IS_AUTO_TEMPLATE = not (sys.get_config("druid.no_auto_template") == "1") + --- Component Interests BaseComponent.ON_INPUT = const.ON_INPUT @@ -79,7 +81,7 @@ function BaseComponent.set_template(self, template) template = template or const.EMPTY_STRING local parent = self:get_parent_component() - if parent then + if parent and IS_AUTO_TEMPLATE then local parent_template = parent:get_template() if #parent_template > 0 then if #template > 0 then @@ -138,7 +140,6 @@ function BaseComponent.increase_input_priority(self) end - --- Get node for component by name. -- If component has nodes, node_or_name should be string -- It auto pick node by template name or from nodes by clone_tree @@ -154,18 +155,25 @@ function BaseComponent.get_node(self, node_or_name) template_name = template_name .. "/" end + local node local node_type = type(node_or_name) if nodes then assert(node_type == const.STRING, "You should pass node name instead of node") - return nodes[template_name .. node_or_name] + node = nodes[template_name .. node_or_name] else if node_type == const.STRING then - return gui.get_node(template_name .. node_or_name) + node = gui.get_node(template_name .. node_or_name) else -- Assume it's already node from gui.get_node - return node_or_name + node = node_or_name end end + + if not node then + assert(node, "No component with name: " .. template_name .. node_or_name) + end + + return node end diff --git a/druid/extended/data_list.lua b/druid/extended/data_list.lua index 3481c39..b216cbb 100644 --- a/druid/extended/data_list.lua +++ b/druid/extended/data_list.lua @@ -312,7 +312,6 @@ function DataList._check_elements_from(self, index, step) end - --- Update actual data params -- @tparam DataList self @{DataList} -- @local diff --git a/druid/extended/dynamic_grid.lua b/druid/extended/dynamic_grid.lua index 7b0c249..0593715 100644 --- a/druid/extended/dynamic_grid.lua +++ b/druid/extended/dynamic_grid.lua @@ -410,7 +410,6 @@ function DynamicGrid._get_next_node_pos(self, origin_node_index, new_node, place end - function DynamicGrid._get_node_size(self, node) return vmath.mul_per_elem(gui.get_size(node), gui.get_scale(node)) end diff --git a/druid/helper.lua b/druid/helper.lua index 6383971..c3ffe74 100644 --- a/druid/helper.lua +++ b/druid/helper.lua @@ -173,7 +173,6 @@ function M.is_enabled(node) end - --- Return closest non inverted clipping parent node for node -- @function helper.get_closest_stencil_node -- @tparam node node Gui node diff --git a/druid/system/druid_instance.lua b/druid/system/druid_instance.lua index 88c2573..dc69876 100755 --- a/druid/system/druid_instance.lua +++ b/druid/system/druid_instance.lua @@ -140,7 +140,6 @@ local function check_sort_input_stack(self, components) end - --- Check whitelists and blacklists for input components local function can_use_input_component(self, component) local can_by_whitelist = true diff --git a/game.project b/game.project index e38280c..221b23d 100644 --- a/game.project +++ b/game.project @@ -28,6 +28,7 @@ use_accelerometer = 0 [druid] no_auto_input = 0 stencil_check = 0 +no_auto_template = 0 input_text = text input_touch = touch input_marked_text = marked_text