From 69ebb252e1c9d216a395a60cd5aadeb8447444b6 Mon Sep 17 00:00:00 2001 From: Insality Date: Thu, 21 Nov 2024 00:53:06 +0200 Subject: [PATCH] Remove no_auto_template and no_stencil_check settings --- docs_md/advanced-setup.md | 23 ----------------------- druid/base/button.lua | 2 +- druid/base/drag.lua | 2 +- druid/base/hover.lua | 2 +- druid/base/scroll.lua | 2 +- druid/component.lua | 3 +-- druid/const.lua | 2 -- druid/extended/swipe.lua | 2 +- 8 files changed, 6 insertions(+), 32 deletions(-) diff --git a/docs_md/advanced-setup.md b/docs_md/advanced-setup.md index ef95336..cf369d1 100644 --- a/docs_md/advanced-setup.md +++ b/docs_md/advanced-setup.md @@ -61,29 +61,6 @@ no_auto_input = 1 ``` -## Template Name Check - -By default, **Druid** automatically checks the parent component's template name to construct the full template name for the component. It's used in user custom components. - -If, for some reason, you want to pass the full template name manually, you can disable this feature by setting the `druid.no_auto_template` field in the _game.project_ file: - -``` -[druid] -no_auto_template = 1 -``` - - -## Stencil Check - -When creating input components inside stencil nodes, **Druid** automatically sets up `component:set_click_zone()` during the _late_init_ component step to restrict input clicks outside of the stencil zone. This is particularly useful for buttons inside scroll stencil nodes. - -To disable this feature, add the following field to your _game.project_ file: -``` -[druid] -no_stencil_check = 1 -``` - - ## Code Bindings Adjust **Druid** settings as needed: diff --git a/druid/base/button.lua b/druid/base/button.lua index ce93c85..d57a193 100755 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -347,7 +347,7 @@ end function M:on_late_init() - if not self.click_zone and const.IS_STENCIL_CHECK then + if not self.click_zone then local stencil_node = helper.get_closest_stencil_node(self.node) if stencil_node then self:set_click_zone(stencil_node) diff --git a/druid/base/drag.lua b/druid/base/drag.lua index de30165..da275d3 100644 --- a/druid/base/drag.lua +++ b/druid/base/drag.lua @@ -259,7 +259,7 @@ end function M:on_late_init() - if not self.click_zone and const.IS_STENCIL_CHECK then + if not self.click_zone then local stencil_node = helper.get_closest_stencil_node(self.node) if stencil_node then self:set_click_zone(stencil_node) diff --git a/druid/base/hover.lua b/druid/base/hover.lua index b3b3ed6..b1713b4 100644 --- a/druid/base/hover.lua +++ b/druid/base/hover.lua @@ -52,7 +52,7 @@ end function M:on_late_init() - if not self.click_zone and const.IS_STENCIL_CHECK then + if not self.click_zone then local stencil_node = helper.get_closest_stencil_node(self.node) if stencil_node then self:set_click_zone(stencil_node) diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index 22e3f4b..fd9d8ab 100755 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -212,7 +212,7 @@ end function M:on_late_init() - if not self.click_zone and const.IS_STENCIL_CHECK then + if not self.click_zone then local stencil_node = helper.get_closest_stencil_node(self.node) if stencil_node then self:set_click_zone(stencil_node) diff --git a/druid/component.lua b/druid/component.lua index 31890d4..000df35 100644 --- a/druid/component.lua +++ b/druid/component.lua @@ -40,7 +40,6 @@ local helper = require("druid.helper") local M = {} local INTERESTS = {} -- Cache interests per component class in runtime -local IS_AUTO_TEMPLATE = not (sys.get_config_int("druid.no_auto_template", 0) == 1) -- Component Interests M.ON_INPUT = const.ON_INPUT @@ -114,7 +113,7 @@ function M:set_template(template) template = template or "" local parent = self:get_parent_component() - if parent and IS_AUTO_TEMPLATE then + if parent then local parent_template = parent:get_template() if #parent_template > 0 then if #template > 0 then diff --git a/druid/const.lua b/druid/const.lua index 25d6b88..b1e5ea4 100755 --- a/druid/const.lua +++ b/druid/const.lua @@ -17,8 +17,6 @@ M.ACTION_LSHIFT = hash(sys.get_config_string("druid.input_key_lshift", "key_lshi M.ACTION_LCTRL = hash(sys.get_config_string("druid.input_key_lctrl", "key_lctrl")) M.ACTION_LCMD = hash(sys.get_config_string("druid.input_key_lsuper", "key_lsuper")) -M.IS_STENCIL_CHECK = not (sys.get_config_int("druid.no_stencil_check", 0) == 1) - M.ON_INPUT = "on_input" M.ON_UPDATE = "update" M.ON_MESSAGE = "on_message" diff --git a/druid/extended/swipe.lua b/druid/extended/swipe.lua index ed95364..ae2b2ee 100644 --- a/druid/extended/swipe.lua +++ b/druid/extended/swipe.lua @@ -111,7 +111,7 @@ end function M:on_late_init() - if not self.click_zone and const.IS_STENCIL_CHECK then + if not self.click_zone then local stencil_node = helper.get_closest_stencil_node(self.node) if stencil_node then self:set_click_zone(stencil_node)