This commit is contained in:
Insality
2024-11-20 23:36:04 +02:00
parent f2fa5320d2
commit 7ea8691fc5
104 changed files with 451 additions and 12743 deletions

View File

@@ -53,6 +53,14 @@ function M.get_examples()
end)
end,
},
{
name_id = "ui_example_widget_memory_panel",
information_text_id = "ui_example_widget_memory_panel_description",
template = "example_memory_panel",
root = "example_memory_panel/root",
code_url = "example/examples/widgets/memory_panel/example_memory_panel.lua",
component_class = require("example.examples.widgets.memory_panel.example_memory_panel"),
},
}
end

View File

@@ -3,8 +3,8 @@ fonts {
font: "/example/assets/fonts/text_regular.font"
}
textures {
name: "druid"
texture: "/example/assets/druid.atlas"
name: "druid_example"
texture: "/example/assets/druid_example.atlas"
}
nodes {
size {

View File

@@ -1,6 +1,6 @@
textures {
name: "druid"
texture: "/example/assets/druid.atlas"
name: "druid_example"
texture: "/example/assets/druid_example.atlas"
}
nodes {
size {

View File

@@ -0,0 +1,98 @@
nodes {
type: TYPE_TEMPLATE
id: "memory_panel"
inherit_alpha: true
template: "/druid/widget/memory_panel/memory_panel.gui"
}
nodes {
type: TYPE_BOX
id: "memory_panel/root"
parent: "memory_panel"
template_node_child: true
}
nodes {
type: TYPE_TEMPLATE
id: "memory_panel/mini_graph"
parent: "memory_panel/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/mini_graph/root"
parent: "memory_panel/mini_graph"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/mini_graph/header"
parent: "memory_panel/mini_graph/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "memory_panel/mini_graph/text_header"
parent: "memory_panel/mini_graph/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/mini_graph/icon_drag"
parent: "memory_panel/mini_graph/header"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/mini_graph/content"
parent: "memory_panel/mini_graph/root"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/mini_graph/prefab_line"
parent: "memory_panel/mini_graph/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/mini_graph/color_low"
parent: "memory_panel/mini_graph/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/content"
parent: "memory_panel/root"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "memory_panel/text_max_value"
parent: "memory_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "memory_panel/text_per_second"
parent: "memory_panel/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/line_second_1"
parent: "memory_panel/content"
template_node_child: true
}
nodes {
type: TYPE_BOX
id: "memory_panel/line_second_2"
parent: "memory_panel/content"
template_node_child: true
}
nodes {
type: TYPE_TEXT
id: "memory_panel/text_memory"
parent: "memory_panel/content"
template_node_child: true
}
material: "/builtins/materials/gui.material"
adjust_reference: ADJUST_REFERENCE_PARENT

View File

@@ -0,0 +1,12 @@
local memory_panel = require("druid.widget.memory_panel.memory_panel")
---@class widget.example_memory_panel: druid.widget
local M = {}
function M:init()
self.memory_panel = self.druid:new_widget(memory_panel, "memory_panel")
end
return M