From a81d49de9d74ad7872d9e834651a8a69880835dc Mon Sep 17 00:00:00 2001 From: Insality Date: Mon, 24 Feb 2020 00:03:29 +0300 Subject: [PATCH] Rename bounce -> default style, start make new example pages --- docs/index.html | 2 +- docs/modules/component.html | 2 +- docs/modules/druid.back_handler.html | 2 +- docs/modules/druid.blocker.html | 2 +- docs/modules/druid.button.html | 16 +++++++++++++++- docs/modules/druid.checkbox.html | 2 +- docs/modules/druid.checkbox_group.html | 2 +- docs/modules/druid.grid.html | 2 +- docs/modules/druid.helper.html | 2 +- docs/modules/druid.html | 2 +- docs/modules/druid.input.html | 2 +- docs/modules/druid.lang_text.html | 2 +- docs/modules/druid.progress.html | 2 +- docs/modules/druid.radio_group.html | 2 +- docs/modules/druid.scroll.html | 2 +- docs/modules/druid.slider.html | 2 +- docs/modules/druid.text.html | 2 +- docs/modules/druid.timer.html | 2 +- docs/modules/druid_event.html | 2 +- docs/modules/druid_instance.html | 2 +- druid/base/button.lua | 6 ++++++ druid/styles/{bounce => default}/anims.lua | 0 druid/styles/{bounce => default}/style.lua | 2 +- example/kenney/gui/main/main.gui_script | 8 +++++--- example/kenney/lang.lua | 4 ++++ 25 files changed, 50 insertions(+), 24 deletions(-) rename druid/styles/{bounce => default}/anims.lua (100%) rename druid/styles/{bounce => default}/style.lua (97%) diff --git a/docs/index.html b/docs/index.html index e865552..8e850b0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -145,7 +145,7 @@
generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
diff --git a/docs/modules/component.html b/docs/modules/component.html index a05a234..03ef47b 100644 --- a/docs/modules/component.html +++ b/docs/modules/component.html @@ -396,7 +396,7 @@
generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
diff --git a/docs/modules/druid.back_handler.html b/docs/modules/druid.back_handler.html index 66d587d..2943f1f 100644 --- a/docs/modules/druid.back_handler.html +++ b/docs/modules/druid.back_handler.html @@ -151,7 +151,7 @@
generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
diff --git a/docs/modules/druid.blocker.html b/docs/modules/druid.blocker.html index 46ce82d..ad72a4e 100644 --- a/docs/modules/druid.blocker.html +++ b/docs/modules/druid.blocker.html @@ -77,7 +77,7 @@
generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
diff --git a/docs/modules/druid.button.html b/docs/modules/druid.button.html index 82fe0ef..886be31 100644 --- a/docs/modules/druid.button.html +++ b/docs/modules/druid.button.html @@ -328,9 +328,23 @@ function (self, node) +
  • on_click_disabled + function + (self, node) +
  • on_hover function (self, node, hover_state) +
  • +
  • on_set_enabled + function + (self, node, enabled_state) +
  • +
  • IS_HOVER + bool + + +
  • @@ -346,7 +360,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.checkbox.html b/docs/modules/druid.checkbox.html index bfe3b2a..66054fe 100644 --- a/docs/modules/druid.checkbox.html +++ b/docs/modules/druid.checkbox.html @@ -77,7 +77,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.checkbox_group.html b/docs/modules/druid.checkbox_group.html index e492ef9..1c40d26 100644 --- a/docs/modules/druid.checkbox_group.html +++ b/docs/modules/druid.checkbox_group.html @@ -77,7 +77,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.grid.html b/docs/modules/druid.grid.html index 6914a07..69dee2b 100644 --- a/docs/modules/druid.grid.html +++ b/docs/modules/druid.grid.html @@ -75,7 +75,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.helper.html b/docs/modules/druid.helper.html index ae45827..c81e977 100644 --- a/docs/modules/druid.helper.html +++ b/docs/modules/druid.helper.html @@ -226,7 +226,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.html b/docs/modules/druid.html index 66d2c54..46038ef 100644 --- a/docs/modules/druid.html +++ b/docs/modules/druid.html @@ -171,7 +171,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.input.html b/docs/modules/druid.input.html index 3c37497..da6d315 100644 --- a/docs/modules/druid.input.html +++ b/docs/modules/druid.input.html @@ -151,7 +151,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.lang_text.html b/docs/modules/druid.lang_text.html index 2c02a82..9f52f6b 100644 --- a/docs/modules/druid.lang_text.html +++ b/docs/modules/druid.lang_text.html @@ -118,7 +118,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.progress.html b/docs/modules/druid.progress.html index 2b0ede6..e8e1115 100644 --- a/docs/modules/druid.progress.html +++ b/docs/modules/druid.progress.html @@ -296,7 +296,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.radio_group.html b/docs/modules/druid.radio_group.html index 082f70a..5d71a85 100644 --- a/docs/modules/druid.radio_group.html +++ b/docs/modules/druid.radio_group.html @@ -77,7 +77,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.scroll.html b/docs/modules/druid.scroll.html index 81b1019..551ceb5 100644 --- a/docs/modules/druid.scroll.html +++ b/docs/modules/druid.scroll.html @@ -276,7 +276,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.slider.html b/docs/modules/druid.slider.html index 03e14f1..a4abba6 100644 --- a/docs/modules/druid.slider.html +++ b/docs/modules/druid.slider.html @@ -77,7 +77,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.text.html b/docs/modules/druid.text.html index 41d09ef..6df4131 100644 --- a/docs/modules/druid.text.html +++ b/docs/modules/druid.text.html @@ -235,7 +235,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid.timer.html b/docs/modules/druid.timer.html index 242b9b2..8fef622 100644 --- a/docs/modules/druid.timer.html +++ b/docs/modules/druid.timer.html @@ -179,7 +179,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid_event.html b/docs/modules/druid_event.html index 37e3a1c..dc54081 100644 --- a/docs/modules/druid_event.html +++ b/docs/modules/druid_event.html @@ -162,7 +162,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/docs/modules/druid_instance.html b/docs/modules/druid_instance.html index f3df01a..732fba4 100644 --- a/docs/modules/druid_instance.html +++ b/docs/modules/druid_instance.html @@ -740,7 +740,7 @@
    generated by LDoc 1.4.6 -Last updated 2020-02-23 22:54:59 +Last updated 2020-02-24 00:03:02
    diff --git a/druid/base/button.lua b/druid/base/button.lua index 34f8f37..bacc089 100644 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -1,6 +1,9 @@ --- Component to handle basic GUI button -- @module druid.button +--- Button gui component +--@class druid + --- Component events -- @table Events -- @tfield druid_event on_click On release button callback @@ -22,7 +25,10 @@ --- Component style params -- @table Style -- @tfield function on_click (self, node) +-- @tfield function on_click_disabled (self, node) -- @tfield function on_hover (self, node, hover_state) +-- @tfield function on_set_enabled (self, node, enabled_state) +-- @tfield bool IS_HOVER local Event = require("druid.event") local const = require("druid.const") diff --git a/druid/styles/bounce/anims.lua b/druid/styles/default/anims.lua similarity index 100% rename from druid/styles/bounce/anims.lua rename to druid/styles/default/anims.lua diff --git a/druid/styles/bounce/style.lua b/druid/styles/default/style.lua similarity index 97% rename from druid/styles/bounce/style.lua rename to druid/styles/default/style.lua index e9d93bf..d9a7d46 100644 --- a/druid/styles/bounce/style.lua +++ b/druid/styles/default/style.lua @@ -1,5 +1,5 @@ local settings = require("druid.system.settings") -local anims = require("druid.styles.bounce.anims") +local anims = require("druid.styles.default.anims") local M = {} diff --git a/example/kenney/gui/main/main.gui_script b/example/kenney/gui/main/main.gui_script index 357e8b3..30fd8af 100644 --- a/example/kenney/gui/main/main.gui_script +++ b/example/kenney/gui/main/main.gui_script @@ -1,14 +1,16 @@ local druid = require("druid.druid") local empty_style = require("druid.styles.empty.style") -local bounce_style = require("druid.styles.bounce.style") +local default_style = require("druid.styles.default.style") local main_page = require("example.kenney.page.main") local text_page = require("example.kenney.page.texts") local pages = { "main_page", - "texts_page" + "texts_page", + "button_page", + "scroll_page", } local function on_control_button(self, delta) @@ -34,7 +36,7 @@ end function init(self) - druid.set_default_style(bounce_style) + druid.set_default_style(default_style) self.druid = druid.new(self) init_top_panel(self) diff --git a/example/kenney/lang.lua b/example/kenney/lang.lua index 43f0f91..c7eb298 100644 --- a/example/kenney/lang.lua +++ b/example/kenney/lang.lua @@ -5,6 +5,8 @@ local M = {} local en = { main_page = "Main page", texts_page = "Text page", + button_page = "Button page", + scroll_page = "Scroll page", ui_section_button = "Button", ui_section_text = "Text", ui_section_timer = "Timer", @@ -19,6 +21,8 @@ local en = { local ru = { main_page = "Основное", texts_page = "Текст", + button_page = "Кнопки", + scroll_page = "Скролл", ui_section_button = "Кнопка", ui_section_text = "Текст", ui_section_timer = "Таймер",