mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Update
This commit is contained in:
@@ -69,6 +69,14 @@ function M.get_examples()
|
||||
code_url = "example/examples/widgets/fps_panel/example_fps_panel.lua",
|
||||
widget_class = require("example.examples.widgets.fps_panel.example_fps_panel"),
|
||||
},
|
||||
{
|
||||
name_id = "ui_example_widget_properties_panel",
|
||||
information_text_id = "ui_example_widget_properties_panel_description",
|
||||
template = "example_properties_panel",
|
||||
root = "example_properties_panel/root",
|
||||
code_url = "example/examples/widgets/properties_panel/example_properties_panel.lua",
|
||||
widget_class = require("example.examples.widgets.properties_panel.example_properties_panel"),
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
@@ -0,0 +1,368 @@
|
||||
nodes {
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
}
|
||||
type: TYPE_BOX
|
||||
id: "root"
|
||||
inherit_alpha: true
|
||||
size_mode: SIZE_MODE_AUTO
|
||||
visible: false
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel"
|
||||
parent: "root"
|
||||
inherit_alpha: true
|
||||
template: "/druid/widget/properties_panel/properties_panel.gui"
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/root"
|
||||
parent: "properties_panel"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/header"
|
||||
parent: "properties_panel/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/text_header"
|
||||
parent: "properties_panel/header"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/icon_drag"
|
||||
parent: "properties_panel/header"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/content"
|
||||
parent: "properties_panel/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/scroll_view"
|
||||
parent: "properties_panel/content"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/scroll_content"
|
||||
parent: "properties_panel/scroll_view"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/propeties"
|
||||
parent: "properties_panel/content"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_slider"
|
||||
parent: "properties_panel/propeties"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/root"
|
||||
parent: "properties_panel/property_slider"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_slider/text_name"
|
||||
parent: "properties_panel/property_slider/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/E_Anchor"
|
||||
parent: "properties_panel/property_slider/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/slider"
|
||||
parent: "properties_panel/property_slider/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/slider_back"
|
||||
parent: "properties_panel/property_slider/slider"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/slider_pin"
|
||||
parent: "properties_panel/property_slider/slider"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/button"
|
||||
parent: "properties_panel/property_slider/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_slider/selected"
|
||||
parent: "properties_panel/property_slider/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_slider/text_value"
|
||||
parent: "properties_panel/property_slider/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_checkbox"
|
||||
parent: "properties_panel/propeties"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_checkbox/root"
|
||||
parent: "properties_panel/property_checkbox"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_checkbox/text_name"
|
||||
parent: "properties_panel/property_checkbox/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_checkbox/E_Anchor"
|
||||
parent: "properties_panel/property_checkbox/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_checkbox/button"
|
||||
parent: "properties_panel/property_checkbox/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_checkbox/icon"
|
||||
parent: "properties_panel/property_checkbox/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_checkbox/selected"
|
||||
parent: "properties_panel/property_checkbox/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_button"
|
||||
parent: "properties_panel/propeties"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_button/root"
|
||||
parent: "properties_panel/property_button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_button/text_name"
|
||||
parent: "properties_panel/property_button/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_button/E_Anchor"
|
||||
parent: "properties_panel/property_button/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_button/button"
|
||||
parent: "properties_panel/property_button/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_button/selected"
|
||||
parent: "properties_panel/property_button/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_button/text_button"
|
||||
parent: "properties_panel/property_button/button"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_input"
|
||||
parent: "properties_panel/propeties"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_input/root"
|
||||
parent: "properties_panel/property_input"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_input/text_name"
|
||||
parent: "properties_panel/property_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_input/E_Anchor"
|
||||
parent: "properties_panel/property_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_input/rich_input"
|
||||
parent: "properties_panel/property_input/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_input/rich_input/root"
|
||||
parent: "properties_panel/property_input/rich_input"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_input/rich_input/button"
|
||||
parent: "properties_panel/property_input/rich_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_input/rich_input/placeholder_text"
|
||||
parent: "properties_panel/property_input/rich_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_input/rich_input/input_text"
|
||||
parent: "properties_panel/property_input/rich_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_input/rich_input/cursor_node"
|
||||
parent: "properties_panel/property_input/rich_input/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_input/rich_input/cursor_text"
|
||||
parent: "properties_panel/property_input/rich_input/cursor_node"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_input/selected"
|
||||
parent: "properties_panel/property_input/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_text"
|
||||
parent: "properties_panel/propeties"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_text/root"
|
||||
parent: "properties_panel/property_text"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_text/text_name"
|
||||
parent: "properties_panel/property_text/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_text/text_right"
|
||||
parent: "properties_panel/property_text/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEMPLATE
|
||||
id: "properties_panel/property_left_right_selector"
|
||||
parent: "properties_panel/propeties"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/root"
|
||||
parent: "properties_panel/property_left_right_selector"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_left_right_selector/text_name"
|
||||
parent: "properties_panel/property_left_right_selector/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/E_Anchor"
|
||||
parent: "properties_panel/property_left_right_selector/root"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/button_left"
|
||||
parent: "properties_panel/property_left_right_selector/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/icon_left"
|
||||
parent: "properties_panel/property_left_right_selector/button_left"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/button_right"
|
||||
parent: "properties_panel/property_left_right_selector/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/icon_right"
|
||||
parent: "properties_panel/property_left_right_selector/button_right"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_BOX
|
||||
id: "properties_panel/property_left_right_selector/selected"
|
||||
parent: "properties_panel/property_left_right_selector/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
nodes {
|
||||
type: TYPE_TEXT
|
||||
id: "properties_panel/property_left_right_selector/text_value"
|
||||
parent: "properties_panel/property_left_right_selector/E_Anchor"
|
||||
template_node_child: true
|
||||
}
|
||||
material: "/builtins/materials/gui.material"
|
||||
adjust_reference: ADJUST_REFERENCE_PARENT
|
@@ -0,0 +1,38 @@
|
||||
local properties_panel = require("druid.widget.properties_panel.properties_panel")
|
||||
|
||||
---@class widget.example_properties_panel: druid.widget
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
self.properties_panel = self.druid:new_widget(properties_panel, "properties_panel")
|
||||
|
||||
self.properties_panel:add_button("Button", function()
|
||||
print("Button clicked")
|
||||
end)
|
||||
|
||||
self.properties_panel:add_checkbox("Checkbox", false, function(value)
|
||||
print("Checkbox clicked", value)
|
||||
end)
|
||||
|
||||
self.properties_panel:add_input("Input", "Initial", function(value)
|
||||
print("Input value", value)
|
||||
end)
|
||||
|
||||
self.properties_panel:add_left_right_selector("Arrows Number", 0, function(value)
|
||||
print("Left Right Number value", value)
|
||||
end):set_number_type(0, 42, true, 1)
|
||||
|
||||
self.properties_panel:add_left_right_selector("Arrows Array", "Zero", function(value)
|
||||
print("Left Right Array value", value)
|
||||
end):set_array_type({"Zero", "One", "Two", "Three", "Four", "Five"}, false, 1)
|
||||
|
||||
self.properties_panel:add_slider("Slider", 0.5, function(value)
|
||||
print("Slider value", value)
|
||||
end)
|
||||
|
||||
self.properties_panel:add_text("Text", "Some text")
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user