Replace treturn

This commit is contained in:
Insality
2024-11-07 18:35:06 +01:00
parent 620facbe1f
commit b5ccd80215
13 changed files with 77 additions and 77 deletions

View File

@@ -97,7 +97,7 @@ end
--- Set refresh function for DataList component
---@param self DataList DataList
---@param is_use_cache boolean Use cache version of DataList. Requires make setup of components in on_element_add callback and clean in on_element_remove
-- @treturn druid.data_list Current DataList instance
---@return druid.data_list Current DataList instance
function M:set_use_cache(is_use_cache)
self._is_use_cache = is_use_cache
return self
@@ -107,7 +107,7 @@ end
--- Set new data set for DataList component
---@param self DataList DataList
---@param data table The new data array
-- @treturn druid.data_list Current DataList instance
---@return druid.data_list Current DataList instance
function M:set_data(data)
self._data = data or {}
self:_refresh()
@@ -118,7 +118,7 @@ end
--- Return current data from DataList component
---@param self DataList DataList
-- @treturn table The current data array
---@return table The current data array
function M:get_data()
return self._data
end
@@ -185,7 +185,7 @@ end
--- Return all currenly created nodes in DataList
---@param self DataList DataList
-- @treturn node[] List of created nodes
---@return node[] List of created nodes
function M:get_created_nodes()
local nodes = {}
@@ -199,7 +199,7 @@ end
--- Return all currenly created components in DataList
---@param self DataList DataList
-- @treturn druid.base_component[] List of created nodes
---@return druid.base_component[] List of created nodes
function M:get_created_components()
local components = {}

View File

@@ -76,7 +76,7 @@ end
---@param self Hotkey Hotkey
---@param keys string[]|hash[]|string|hash that have to be pressed before key pressed to activate
---@param callback_argument any|nil The argument to pass into the callback function
-- @treturn Hotkey Current instance
---@return Hotkey Current instance
function M:add_hotkey(keys, callback_argument)
keys = keys or {}
if type(keys) == "string" then
@@ -176,7 +176,7 @@ end
--- If true, the callback will be triggered on action.repeated
---@param self Hotkey Hotkey
---@param is_enabled_repeated bool The flag value
-- @treturn Hotkey
---@return Hotkey
function M:set_repeat(is_enabled_repeated)
self._is_process_repeated = is_enabled_repeated
return self

View File

@@ -111,7 +111,7 @@ M.ALLOWED_ACTIONS = {
--- Mask text by replacing every character with a mask character
---@param text string
---@param mask string
-- @treturn string Masked text
---@return string Masked text
local function mask_text(text, mask)
mask = mask or "*"
local masked_text = ""
@@ -330,7 +330,7 @@ end
--- Replace selected text with new text
---@param self Input Input
---@param text string The text to replace selected text
-- @treturn string New input text
---@return string New input text
function M:get_text_selected_replaced(text)
local left_part = utf8.sub(self.value, 1, self.start_index)
local right_part = utf8.sub(self.value, self.end_index + 1, utf8.len(self.value))
@@ -440,7 +440,7 @@ end
--- Return current input field text
---@param self Input Input
-- @treturn string The current input field text
---@return string The current input field text
function M:get_text()
if self.marked_value ~= "" then
return self.value .. self.marked_value
@@ -454,7 +454,7 @@ end
-- Pass nil to make input field unliminted (by default)
---@param self Input Input
---@param max_length number Maximum length for input text field
-- @treturn druid.input Current input instance
---@return druid.input Current input instance
function M:set_max_length(max_length)
self.max_length = max_length
return self
@@ -466,7 +466,7 @@ end
-- ex: [%a%d] for alpha and numeric
---@param self Input Input
---@param characters string Regulax exp. for validate user input
-- @treturn druid.input Current input instance
---@return druid.input Current input instance
function M:set_allowed_characters(characters)
self.allowed_characters = characters
return self
@@ -475,7 +475,7 @@ end
--- Reset current input selection and return previous value
---@param self Input Input
-- @treturn druid.input Current input instance
---@return druid.input Current input instance
function M:reset_changes()
self:set_text(self.previous_value)
self:unselect()
@@ -488,7 +488,7 @@ end
---@param cursor_index number|nil Cursor index for cursor position, if nil - will be set to the end of the text
---@param start_index number|nil Start index for cursor position, if nil - will be set to the end of the text
---@param end_index number|nil End index for cursor position, if nil - will be set to the start_index
-- @treturn druid.input Current input instance
---@return druid.input Current input instance
function M:select_cursor(cursor_index, start_index, end_index)
local len = utf8.len(self.value)

View File

@@ -71,7 +71,7 @@ end
--- Setup raw text to lang_text component
---@param self LangText LangText
---@param text string Text for text node
-- @treturn LangText Current instance
---@return LangText Current instance
function M:set_to(text)
self.last_locale = false
self.text:set_to(text)
@@ -91,7 +91,7 @@ end
---@param e string|nil Optional param to string.format
---@param f string|nil Optional param to string.format
---@param g string|nil Optional param to string.format
-- @treturn LangText Current instance
---@return LangText Current instance
function M:translate(locale_id, a, b, c, d, e, f, g)
self.last_locale_args = { a, b, c, d, e, f, g }
self.last_locale = locale_id or self.last_locale
@@ -110,7 +110,7 @@ end
---@param e string|nil Optional param to string.format
---@param f string|nil Optional param to string.format
---@param g string|nil Optional param to string.format
-- @treturn LangText Current instance
---@return LangText Current instance
function M:format(a, b, c, d, e, f, g)
self.last_locale_args = { a, b, c, d, e, f, g }
self.text:set_to(settings.get_text(self.last_locale, a, b, c, d, e, f, g) or "")

View File

@@ -255,7 +255,7 @@ end
--- Set progress bar max node size
---@param self Progress Progress
---@param max_size vector3 The new node maximum (full) size
-- @treturn Progress Progress
---@return Progress Progress
function M:set_max_size(max_size)
self.max_size[self.key] = max_size[self.key]
self:set_to(self.last_value)

View File

@@ -215,7 +215,7 @@ end
---@param self Slider Slider
---@param steps number[] Array of steps
-- @usage slider:set_steps({0, 0.2, 0.6, 1})
-- @treturn Slider Slider
---@return Slider Slider
function M:set_steps(steps)
self.steps = steps
return self
@@ -228,7 +228,7 @@ end
-- This function require the Defold version 1.3.0+
---@param self Slider Slider
---@param input_node node|string|nil
-- @treturn Slider Slider
---@return Slider Slider
function M:set_input_node(input_node)
self._input_node = self:get_node(input_node)
return self
@@ -245,7 +245,7 @@ end
--- Check if Slider component is enabled
---@param self Slider Slider
-- @treturn boolean
---@return boolean
function M:is_enabled()
return self._is_enabled
end