From c0c1870ac5d06a07508720f412ed56305578d245 Mon Sep 17 00:00:00 2001 From: Insality Date: Wed, 16 Oct 2024 20:58:55 +0300 Subject: [PATCH] Solve #239 Remove button style --- druid/annotations.lua | 1 - druid/custom/rich_input/rich_input.lua | 18 ++++++++++++++++++ druid/extended/input.lua | 8 -------- druid/styles/default/style.lua | 6 ------ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/druid/annotations.lua b/druid/annotations.lua index 3e8be27b..4c9e4c71 100644 --- a/druid/annotations.lua +++ b/druid/annotations.lua @@ -777,7 +777,6 @@ function druid__input.unselect(self) end ---@field IS_LONGTAP_ERASE boolean Is long tap will erase current input data. Default: false ---@field IS_UNSELECT_ON_RESELECT boolean If true, call unselect on select selected input. Default: false ---@field MASK_DEFAULT_CHAR string Default character mask for password input. Default: *] ----@field button_style table Custom button style for input node ---@field on_input_wrong function (self, button_node) Callback on wrong user input ---@field on_select function (self, button_node) Callback on input field selecting ---@field on_unselect function (self, button_node) Callback on input field unselecting diff --git a/druid/custom/rich_input/rich_input.lua b/druid/custom/rich_input/rich_input.lua index a1c6987e..bffe3fa6 100644 --- a/druid/custom/rich_input/rich_input.lua +++ b/druid/custom/rich_input/rich_input.lua @@ -17,6 +17,24 @@ --- On input field text change to empty string callback(self, input_text) -- @tfield node cursor +--- On input field text change to empty string callback(self, input_text) +-- @tfield node cursor_text + +--- On input field text change to empty string callback(self, input_text) +-- @tfield vector3 cursor_position + +--- On input field text change to empty string callback(self, input_text) +-- @tfield druid.text input_text + +--- On input field text change to empty string callback(self, input_text) +-- @tfield druid.drag drag + +--- On input field text change to empty string callback(self, input_text) +-- @tfield druid.text placeholder + +--- On input field text change to empty string callback(self, input_text) +-- @tfield vector3 text_position + --- On input field text change to max length string callback(self, input_text) -- @tfield druid.text placeholder @{Text} diff --git a/druid/extended/input.lua b/druid/extended/input.lua index a48117ff..db608e16 100755 --- a/druid/extended/input.lua +++ b/druid/extended/input.lua @@ -132,7 +132,6 @@ end -- @tfield function on_select (self, button_node) Callback on input field selecting -- @tfield function on_unselect (self, button_node) Callback on input field unselecting -- @tfield function on_input_wrong (self, button_node) Callback on wrong user input --- @tfield table button_style Custom button style for input node function Input.on_style_change(self, style) self.style = {} @@ -143,12 +142,6 @@ function Input.on_style_change(self, style) self.style.on_select = style.on_select or function(_, button_node) end self.style.on_unselect = style.on_unselect or function(_, button_node) end self.style.on_input_wrong = style.on_input_wrong or function(_, button_node) end - - self.style.button_style = style.button_style or { - LONGTAP_TIME = 0.4, - AUTOHOLD_TRIGGER = 0.8, - DOUBLETAP_TIME = 0.4 - } end @@ -186,7 +179,6 @@ function Input.init(self, click_node, text_node, keyboard_type) self.keyboard_type = keyboard_type or gui.KEYBOARD_TYPE_DEFAULT self.button = self.druid:new_button(click_node, self.select) - self.button:set_style(self.button_style) self.button.on_click_outside:subscribe(self.unselect) self.button.on_long_click:subscribe(clear_and_select) diff --git a/druid/styles/default/style.lua b/druid/styles/default/style.lua index 7477e213..ca9121c9 100644 --- a/druid/styles/default/style.lua +++ b/druid/styles/default/style.lua @@ -141,12 +141,6 @@ M["input"] = { end) end) end, - - button = { - LONGTAP_TIME = 0.4, - AUTOHOLD_TRIGGER = 0.8, - DOUBLETAP_TIME = 0.4, - } }