This commit is contained in:
Insality
2024-11-21 00:18:43 +02:00
parent c0abfd350e
commit 4ef65579a6
12 changed files with 817 additions and 6 deletions

View File

@@ -4128,6 +4128,373 @@ nodes {
parent: "example_fps_panel/fps_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel"
parent: "widgets"
inherit_alpha: true
template: "/example/examples/widgets/properties_panel/example_properties_panel.gui"
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/root"
parent: "example_properties_panel"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel"
parent: "example_properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/root"
parent: "example_properties_panel/properties_panel"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/header"
parent: "example_properties_panel/properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/text_header"
parent: "example_properties_panel/properties_panel/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/icon_drag"
parent: "example_properties_panel/properties_panel/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/content"
parent: "example_properties_panel/properties_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/scroll_view"
parent: "example_properties_panel/properties_panel/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/scroll_content"
parent: "example_properties_panel/properties_panel/scroll_view"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/propeties"
parent: "example_properties_panel/properties_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_slider"
parent: "example_properties_panel/properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/root"
parent: "example_properties_panel/properties_panel/property_slider"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_slider/text_name"
parent: "example_properties_panel/properties_panel/property_slider/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/E_Anchor"
parent: "example_properties_panel/properties_panel/property_slider/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/slider"
parent: "example_properties_panel/properties_panel/property_slider/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/slider_back"
parent: "example_properties_panel/properties_panel/property_slider/slider"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/slider_pin"
parent: "example_properties_panel/properties_panel/property_slider/slider"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/button"
parent: "example_properties_panel/properties_panel/property_slider/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_slider/selected"
parent: "example_properties_panel/properties_panel/property_slider/button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_slider/text_value"
parent: "example_properties_panel/properties_panel/property_slider/button"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_checkbox"
parent: "example_properties_panel/properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_checkbox/root"
parent: "example_properties_panel/properties_panel/property_checkbox"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_checkbox/text_name"
parent: "example_properties_panel/properties_panel/property_checkbox/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_checkbox/E_Anchor"
parent: "example_properties_panel/properties_panel/property_checkbox/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_checkbox/button"
parent: "example_properties_panel/properties_panel/property_checkbox/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_checkbox/icon"
parent: "example_properties_panel/properties_panel/property_checkbox/button"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_checkbox/selected"
parent: "example_properties_panel/properties_panel/property_checkbox/button"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_button"
parent: "example_properties_panel/properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_button/root"
parent: "example_properties_panel/properties_panel/property_button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_button/text_name"
parent: "example_properties_panel/properties_panel/property_button/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_button/E_Anchor"
parent: "example_properties_panel/properties_panel/property_button/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_button/button"
parent: "example_properties_panel/properties_panel/property_button/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_button/selected"
parent: "example_properties_panel/properties_panel/property_button/button"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_button/text_button"
parent: "example_properties_panel/properties_panel/property_button/button"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_input"
parent: "example_properties_panel/properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_input/root"
parent: "example_properties_panel/properties_panel/property_input"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_input/text_name"
parent: "example_properties_panel/properties_panel/property_input/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_input/E_Anchor"
parent: "example_properties_panel/properties_panel/property_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_input/rich_input"
parent: "example_properties_panel/properties_panel/property_input/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_input/rich_input/root"
parent: "example_properties_panel/properties_panel/property_input/rich_input"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_input/rich_input/button"
parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_input/rich_input/placeholder_text"
parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_input/rich_input/input_text"
parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_input/rich_input/cursor_node"
parent: "example_properties_panel/properties_panel/property_input/rich_input/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_input/rich_input/cursor_text"
parent: "example_properties_panel/properties_panel/property_input/rich_input/cursor_node"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_input/selected"
parent: "example_properties_panel/properties_panel/property_input/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_text"
parent: "example_properties_panel/properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_text/root"
parent: "example_properties_panel/properties_panel/property_text"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_text/text_name"
parent: "example_properties_panel/properties_panel/property_text/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_text/text_right"
parent: "example_properties_panel/properties_panel/property_text/root"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "example_properties_panel/properties_panel/property_left_right_selector"
parent: "example_properties_panel/properties_panel/propeties"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/root"
parent: "example_properties_panel/properties_panel/property_left_right_selector"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_left_right_selector/text_name"
parent: "example_properties_panel/properties_panel/property_left_right_selector/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
parent: "example_properties_panel/properties_panel/property_left_right_selector/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/button_left"
parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/icon_left"
parent: "example_properties_panel/properties_panel/property_left_right_selector/button_left"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/button_right"
parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/icon_right"
parent: "example_properties_panel/properties_panel/property_left_right_selector/button_right"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "example_properties_panel/properties_panel/property_left_right_selector/selected"
parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "example_properties_panel/properties_panel/property_left_right_selector/text_value"
parent: "example_properties_panel/properties_panel/property_left_right_selector/E_Anchor"
template_node_child: true
}
nodes {
position {
x: -20.0
@@ -4260,4 +4627,4 @@ layers {
}
material: "/builtins/materials/gui.material"
adjust_reference: ADJUST_REFERENCE_PARENT
max_nodes: 2048
max_nodes: 4096

View File

@@ -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

View File

@@ -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

View File

@@ -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