Remove no_auto_template and no_stencil_check settings

This commit is contained in:
Insality 2024-11-21 00:53:06 +02:00
parent 9c03c950ad
commit 69ebb252e1
8 changed files with 6 additions and 32 deletions

View File

@ -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 ## Code Bindings
Adjust **Druid** settings as needed: Adjust **Druid** settings as needed:

View File

@ -347,7 +347,7 @@ end
function M:on_late_init() 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) local stencil_node = helper.get_closest_stencil_node(self.node)
if stencil_node then if stencil_node then
self:set_click_zone(stencil_node) self:set_click_zone(stencil_node)

View File

@ -259,7 +259,7 @@ end
function M:on_late_init() 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) local stencil_node = helper.get_closest_stencil_node(self.node)
if stencil_node then if stencil_node then
self:set_click_zone(stencil_node) self:set_click_zone(stencil_node)

View File

@ -52,7 +52,7 @@ end
function M:on_late_init() 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) local stencil_node = helper.get_closest_stencil_node(self.node)
if stencil_node then if stencil_node then
self:set_click_zone(stencil_node) self:set_click_zone(stencil_node)

View File

@ -212,7 +212,7 @@ end
function M:on_late_init() 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) local stencil_node = helper.get_closest_stencil_node(self.node)
if stencil_node then if stencil_node then
self:set_click_zone(stencil_node) self:set_click_zone(stencil_node)

View File

@ -40,7 +40,6 @@ local helper = require("druid.helper")
local M = {} local M = {}
local INTERESTS = {} -- Cache interests per component class in runtime 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 -- Component Interests
M.ON_INPUT = const.ON_INPUT M.ON_INPUT = const.ON_INPUT
@ -114,7 +113,7 @@ function M:set_template(template)
template = template or "" template = template or ""
local parent = self:get_parent_component() local parent = self:get_parent_component()
if parent and IS_AUTO_TEMPLATE then if parent then
local parent_template = parent:get_template() local parent_template = parent:get_template()
if #parent_template > 0 then if #parent_template > 0 then
if #template > 0 then if #template > 0 then

View File

@ -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_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.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_INPUT = "on_input"
M.ON_UPDATE = "update" M.ON_UPDATE = "update"
M.ON_MESSAGE = "on_message" M.ON_MESSAGE = "on_message"

View File

@ -111,7 +111,7 @@ end
function M:on_late_init() 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) local stencil_node = helper.get_closest_stencil_node(self.node)
if stencil_node then if stencil_node then
self:set_click_zone(stencil_node) self:set_click_zone(stencil_node)