Skip to content

Commit

Permalink
Remove register and update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Nov 20, 2024
1 parent 4ef6557 commit bc0ada7
Show file tree
Hide file tree
Showing 44 changed files with 78 additions and 668 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ Here is full **Druid** components list.

### Extended components

> Extended components before usage should be registered in **Druid** with [`druid.register()`](https://insality.github.io/druid/modules/Druid.html#druid.register) function.
> On usage of unregistered **Druid** component the next log will be shown in the console.
```
local data_list = require("druid.extended.data_list")
druid.register("data_list", data_list)
```

| Name | Description | Example | <div style="width:200px">Preview</div> |
|------|-------------|---------|---------|
| **[Data List](https://insality.github.io/druid/modules/DataList.html)** | Logic over Scroll and Grid components. Create only visible GUI nodes or components to make "infinity" scroll befaviour | [Data List Example](https://insality.github.io/druid/druid/?example=ui_example_data_list_basic) | <img src="media/preview/data_list.gif" width="200" height="100"> |
Expand Down
4 changes: 1 addition & 3 deletions druid/custom/rich_input/rich_input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ local const = require("druid.const")
local utf8_lua = require("druid.system.utf8")
local utf8 = utf8 or utf8_lua

local input = require("druid.extended.input")

---@class druid.rich_input: druid.base_component
---@field root node
---@field input druid.input
Expand Down Expand Up @@ -209,7 +207,7 @@ function M:init(template, nodes)
self.is_lshift = false
self.is_lctrl = false

self.input = self.druid:new(input, "button", "input_text")
self.input = self.druid:new_input("button", "input_text")
self.is_button_input_enabled = gui.is_enabled(self.input.button.node)

self.cursor = self:get_node("cursor_node")
Expand Down
4 changes: 2 additions & 2 deletions druid/system/druid_instance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ end
local timer_component = require("druid.extended.timer")
---Create Timer component
---@param node string|node Gui text node
---@param seconds_from number Start timer value in seconds
---@param seconds_from number|nil Start timer value in seconds
---@param seconds_to number|nil End timer value in seconds
---@param callback function|nil Function on timer end
---@return druid.timer Timer component
Expand All @@ -690,7 +690,7 @@ end
local layout = require("druid.extended.layout")
---Create Layout component
---@param node string|node The_node id or gui.get_node(node_id).
---@param mode string vertical|horizontal|horizontal_wrap
---@param mode string|nil vertical|horizontal|horizontal_wrap. Default: horizontal
---@return druid.layout Layout component
function M:new_layout(node, mode)
return self:new(layout, node, mode)
Expand Down
Loading

0 comments on commit bc0ada7

Please sign in to comment.