From f7b85934651e2111d60c4cc70f301414ec21fc2d Mon Sep 17 00:00:00 2001 From: Insality Date: Tue, 3 Nov 2020 19:49:00 +0300 Subject: [PATCH] Rename input.selected to input.is_selected (according to the docs) --- docs_md/changelog.md | 7 +++++++ druid/extended/input.lua | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs_md/changelog.md b/docs_md/changelog.md index ba1351b..d26860a 100644 --- a/docs_md/changelog.md +++ b/docs_md/changelog.md @@ -131,3 +131,10 @@ Also check _component.template.lua_ what you can use for your own custom compone - Add `component.template.lua` as template for Druid custom component - Update the example app + +### Druid 0.6.0: + +Desc + +- Input component: rename field _selected_ to _is_selected_ (according to the docs) +- Add EmmyLua annotations. See how to use it FAQ diff --git a/druid/extended/input.lua b/druid/extended/input.lua index bf6ac80..0ea8f23 100644 --- a/druid/extended/input.lua +++ b/druid/extended/input.lua @@ -71,11 +71,11 @@ end local function select(self) gui.reset_keyboard() self.marked_value = "" - if not self.selected then + if not self.is_selected then self:increase_input_priority() self.button:increase_input_priority() self.previous_value = self.value - self.selected = true + self.is_selected = true gui.show_keyboard(self.keyboard_type, false) self.on_input_select:trigger(self:get_context()) @@ -88,10 +88,10 @@ end local function unselect(self) gui.reset_keyboard() self.marked_value = "" - if self.selected then + if self.is_selected then self:reset_input_priority() self.button:reset_input_priority() - self.selected = false + self.is_selected = false gui.hide_keyboard() self.on_input_unselect:trigger(self:get_context()) @@ -145,7 +145,7 @@ function Input.init(self, click_node, text_node, keyboard_type) self.druid = self:get_druid(self) self.text = self.druid:new_text(text_node) - self.selected = false + self.is_selected = false self.value = self.text.last_value self.previous_value = self.text.last_value self.current_value = self.text.last_value @@ -176,7 +176,7 @@ end function Input.on_input(self, action_id, action) - if self.selected then + if self.is_selected then local input_text = nil if action_id == const.ACTION_TEXT then -- ignore return key @@ -235,7 +235,7 @@ function Input.on_input(self, action_id, action) end end - return self.selected + return self.is_selected end