mirror of
https://github.com/Insality/druid
synced 2025-06-27 18:37:45 +02:00
Basic examples done
This commit is contained in:
parent
e1339a2ca8
commit
45493bc9dd
@ -3,6 +3,7 @@
|
|||||||
---@field blocker druid.blocker
|
---@field blocker druid.blocker
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
|
||||||
function M:init()
|
function M:init()
|
||||||
self.root = self:get_node("root")
|
self.root = self:get_node("root")
|
||||||
|
|
||||||
@ -12,12 +13,26 @@ function M:init()
|
|||||||
self.button = self.druid:new_button("button/root", self.on_button_click)
|
self.button = self.druid:new_button("button/root", self.on_button_click)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:on_root_click()
|
function M:on_root_click()
|
||||||
print("Root click")
|
print("Root click")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:on_button_click()
|
function M:on_button_click()
|
||||||
print("Button click")
|
print("Button click")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.button_root.on_click:subscribe(function()
|
||||||
|
output_log:add_log_text("Root Clicked")
|
||||||
|
end)
|
||||||
|
self.button.on_click:subscribe(function()
|
||||||
|
output_log:add_log_text("Button Clicked")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -42,4 +42,12 @@ function M:get_state()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.button.on_click:subscribe(function()
|
||||||
|
output_log:add_log_text("Checkbox Clicked: " .. tostring(self.is_enabled))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -32,4 +32,12 @@ function M:on_checkbox_click()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.on_state_changed:subscribe(function(state1, state2, state3)
|
||||||
|
output_log:add_log_text("State: " .. tostring(state1) .. " " .. tostring(state2) .. " " .. tostring(state3))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
local const = require("druid.const")
|
|
||||||
local helper = require("druid.helper")
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.get_examples()
|
function M.get_examples()
|
||||||
@ -44,55 +42,6 @@ function M.get_examples()
|
|||||||
root = "multiline_text/root",
|
root = "multiline_text/root",
|
||||||
code_url = "example/examples/basic/text/multiline_text.lua",
|
code_url = "example/examples/basic/text/multiline_text.lua",
|
||||||
widget_class = require("example.examples.basic.text.multiline_text"),
|
widget_class = require("example.examples.basic.text.multiline_text"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.multiline_text
|
|
||||||
|
|
||||||
local adjust_index = 1
|
|
||||||
local adjust_types = {
|
|
||||||
"downscale",
|
|
||||||
"downscale_limited",
|
|
||||||
--"scale_then_scroll", -- works bad with container for some reason
|
|
||||||
--"scroll", -- works bad with container for some reason
|
|
||||||
"trim",
|
|
||||||
}
|
|
||||||
properties_panel:add_button("ui_adjust_next", function()
|
|
||||||
adjust_index = adjust_index + 1
|
|
||||||
if adjust_index > #adjust_types then
|
|
||||||
adjust_index = 1
|
|
||||||
end
|
|
||||||
instance.text:set_text_adjust(adjust_types[adjust_index], 0.8)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local pivot_index = 1
|
|
||||||
local pivot_list = {
|
|
||||||
gui.PIVOT_CENTER,
|
|
||||||
gui.PIVOT_W,
|
|
||||||
gui.PIVOT_SW,
|
|
||||||
gui.PIVOT_S,
|
|
||||||
gui.PIVOT_SE,
|
|
||||||
gui.PIVOT_E,
|
|
||||||
gui.PIVOT_NE,
|
|
||||||
gui.PIVOT_N,
|
|
||||||
gui.PIVOT_NW,
|
|
||||||
}
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_pivot_next", function()
|
|
||||||
pivot_index = pivot_index + 1
|
|
||||||
if pivot_index > #pivot_list then
|
|
||||||
pivot_index = 1
|
|
||||||
end
|
|
||||||
instance:set_pivot(pivot_list[pivot_index])
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.multiline_text
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
info = info .. "Text Adjust: " .. instance.text.adjust_type .. "\n"
|
|
||||||
info = info .. "Pivot: " .. gui.get_pivot(instance.text.node) .. "\n"
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_hover",
|
name_id = "ui_example_basic_hover",
|
||||||
@ -125,13 +74,6 @@ function M.get_examples()
|
|||||||
root = "basic_slider/root",
|
root = "basic_slider/root",
|
||||||
code_url = "example/examples/basic/slider/basic_slider.lua",
|
code_url = "example/examples/basic/slider/basic_slider.lua",
|
||||||
widget_class = require("example.examples.basic.slider.basic_slider"),
|
widget_class = require("example.examples.basic.slider.basic_slider"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_slider
|
|
||||||
instance.slider.on_change_value:subscribe(function(_, value)
|
|
||||||
local value = helper.round(value, 2)
|
|
||||||
output_log:add_log_text("Slider Value: " .. value)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_slider_vertical",
|
name_id = "ui_example_basic_slider_vertical",
|
||||||
@ -140,13 +82,6 @@ function M.get_examples()
|
|||||||
root = "basic_slider_vertical/root",
|
root = "basic_slider_vertical/root",
|
||||||
code_url = "example/examples/basic/slider/basic_slider_vertical.lua",
|
code_url = "example/examples/basic/slider/basic_slider_vertical.lua",
|
||||||
widget_class = require("example.examples.basic.slider.basic_slider_vertical"),
|
widget_class = require("example.examples.basic.slider.basic_slider_vertical"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_slider_vertical
|
|
||||||
instance.slider.on_change_value:subscribe(function(_, value)
|
|
||||||
local value = helper.round(value, 2)
|
|
||||||
output_log:add_log_text("Slider Value: " .. value)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_slider_stepped",
|
name_id = "ui_example_basic_slider_stepped",
|
||||||
@ -155,13 +90,6 @@ function M.get_examples()
|
|||||||
root = "basic_slider_stepped/root",
|
root = "basic_slider_stepped/root",
|
||||||
code_url = "example/examples/basic/slider/basic_slider_stepped.lua",
|
code_url = "example/examples/basic/slider/basic_slider_stepped.lua",
|
||||||
widget_class = require("example.examples.basic.slider.basic_slider_stepped"),
|
widget_class = require("example.examples.basic.slider.basic_slider_stepped"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_slider_stepped
|
|
||||||
instance.slider.on_change_value:subscribe(function(_, value)
|
|
||||||
local value = helper.round(value, 2)
|
|
||||||
output_log:add_log_text("Slider Value: " .. value)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_progress_bar",
|
name_id = "ui_example_basic_progress_bar",
|
||||||
@ -170,12 +98,6 @@ function M.get_examples()
|
|||||||
root = "basic_progress_bar/root",
|
root = "basic_progress_bar/root",
|
||||||
code_url = "example/examples/basic/progress_bar/basic_progress_bar.lua",
|
code_url = "example/examples/basic/progress_bar/basic_progress_bar.lua",
|
||||||
widget_class = require("example.examples.basic.progress_bar.basic_progress_bar"),
|
widget_class = require("example.examples.basic.progress_bar.basic_progress_bar"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.basic_progress_bar
|
|
||||||
properties_panel:add_slider("ui_value", 1, function(value)
|
|
||||||
instance:set_value(value)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_progress_bar_slice9",
|
name_id = "ui_example_basic_progress_bar_slice9",
|
||||||
@ -184,12 +106,6 @@ function M.get_examples()
|
|||||||
root = "basic_progress_bar_slice9/root",
|
root = "basic_progress_bar_slice9/root",
|
||||||
code_url = "example/examples/basic/progress_bar/basic_progress_bar_slice9.lua",
|
code_url = "example/examples/basic/progress_bar/basic_progress_bar_slice9.lua",
|
||||||
widget_class = require("example.examples.basic.progress_bar.basic_progress_bar_slice9"),
|
widget_class = require("example.examples.basic.progress_bar.basic_progress_bar_slice9"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.basic_progress_bar_slice9
|
|
||||||
properties_panel:add_slider("ui_value", 1, function(value)
|
|
||||||
instance:set_value(value)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_blocker",
|
name_id = "ui_example_basic_blocker",
|
||||||
@ -198,15 +114,6 @@ function M.get_examples()
|
|||||||
root = "basic_blocker/root",
|
root = "basic_blocker/root",
|
||||||
code_url = "example/examples/basic/blocker/basic_blocker.lua",
|
code_url = "example/examples/basic/blocker/basic_blocker.lua",
|
||||||
widget_class = require("example.examples.basic.blocker.basic_blocker"),
|
widget_class = require("example.examples.basic.blocker.basic_blocker"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_blocker
|
|
||||||
instance.button_root.on_click:subscribe(function()
|
|
||||||
output_log:add_log_text("Root Clicked")
|
|
||||||
end)
|
|
||||||
instance.button.on_click:subscribe(function()
|
|
||||||
output_log:add_log_text("Button Clicked")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_back_handler",
|
name_id = "ui_example_basic_back_handler",
|
||||||
@ -223,12 +130,6 @@ function M.get_examples()
|
|||||||
root = "basic_timer/root",
|
root = "basic_timer/root",
|
||||||
code_url = "example/examples/basic/timer/basic_timer.lua",
|
code_url = "example/examples/basic/timer/basic_timer.lua",
|
||||||
widget_class = require("example.examples.basic.timer.basic_timer"),
|
widget_class = require("example.examples.basic.timer.basic_timer"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_timer
|
|
||||||
instance.on_cycle_end:subscribe(function()
|
|
||||||
output_log:add_log_text("Timer Cycle End")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_hotkey",
|
name_id = "ui_example_basic_hotkey",
|
||||||
@ -237,12 +138,6 @@ function M.get_examples()
|
|||||||
root = "basic_hotkey/root",
|
root = "basic_hotkey/root",
|
||||||
code_url = "example/examples/basic/hotkey/basic_hotkey.lua",
|
code_url = "example/examples/basic/hotkey/basic_hotkey.lua",
|
||||||
widget_class = require("example.examples.basic.hotkey.basic_hotkey"),
|
widget_class = require("example.examples.basic.hotkey.basic_hotkey"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_hotkey
|
|
||||||
instance.hotkey.on_hotkey_released:subscribe(function()
|
|
||||||
output_log:add_log_text("Hotkey Released")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_scroll",
|
name_id = "ui_example_basic_scroll",
|
||||||
@ -251,70 +146,6 @@ function M.get_examples()
|
|||||||
root = "scroll/root",
|
root = "scroll/root",
|
||||||
code_url = "example/examples/basic/scroll/scroll.lua",
|
code_url = "example/examples/basic/scroll/scroll.lua",
|
||||||
widget_class = require("example.examples.basic.scroll.scroll"),
|
widget_class = require("example.examples.basic.scroll.scroll"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.scroll
|
|
||||||
instance.button_tutorial.on_click:subscribe(function()
|
|
||||||
output_log:add_log_text("Button Tutorial Clicked")
|
|
||||||
end)
|
|
||||||
instance.button_stencil.on_click:subscribe(function()
|
|
||||||
output_log:add_log_text("Button Stencil Clicked")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.scroll
|
|
||||||
local scroll = instance.scroll
|
|
||||||
local is_stretch = instance.scroll.style.EXTRA_STRETCH_SIZE > 0
|
|
||||||
properties_panel:add_checkbox("ui_elastic_scroll", is_stretch, function(value)
|
|
||||||
instance.scroll:set_extra_stretch_size(value and 100 or 0)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local view_node = instance.scroll.view_node
|
|
||||||
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
|
||||||
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
|
||||||
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local slider_frict = properties_panel:add_slider("ui_slider_friction", 0, function(value)
|
|
||||||
scroll.style.FRICT = 1 - ((1 - value) * 0.1)
|
|
||||||
end)
|
|
||||||
slider_frict:set_text_function(function(value)
|
|
||||||
return string.format("%.2f", 1 - ((1 - value) * 0.1))
|
|
||||||
end)
|
|
||||||
slider_frict:set_value(1 - (1 - scroll.style.FRICT) / 0.1)
|
|
||||||
|
|
||||||
local slider_speed = properties_panel:add_slider("ui_slider_speed", 0, function(value)
|
|
||||||
scroll.style.INERT_SPEED = value * 50
|
|
||||||
end)
|
|
||||||
slider_speed:set_value(scroll.style.INERT_SPEED / 50)
|
|
||||||
slider_speed:set_text_function(function(value)
|
|
||||||
return string.format("%.1f", value * 50)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local slider_wheel_speed = properties_panel:add_slider("ui_slider_wheel_speed", 0, function(value)
|
|
||||||
scroll.style.WHEEL_SCROLL_SPEED = value * 30
|
|
||||||
end)
|
|
||||||
slider_wheel_speed:set_value(scroll.style.WHEEL_SCROLL_SPEED / 30)
|
|
||||||
slider_wheel_speed:set_text_function(function(value)
|
|
||||||
return string.format("%.1f", value * 30)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local wheel_by_inertion = properties_panel:add_checkbox("ui_wheel_by_inertion", scroll.style.WHEEL_SCROLL_BY_INERTION, function(value)
|
|
||||||
scroll.style.WHEEL_SCROLL_BY_INERTION = value
|
|
||||||
end)
|
|
||||||
wheel_by_inertion:set_value(scroll.style.WHEEL_SCROLL_BY_INERTION)
|
|
||||||
end,
|
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.scroll
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
local s = instance.scroll
|
|
||||||
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
|
||||||
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_scroll_slider",
|
name_id = "ui_example_basic_scroll_slider",
|
||||||
@ -323,18 +154,6 @@ function M.get_examples()
|
|||||||
root = "scroll_slider/root",
|
root = "scroll_slider/root",
|
||||||
code_url = "example/examples/basic/scroll_slider/scroll_slider.lua",
|
code_url = "example/examples/basic/scroll_slider/scroll_slider.lua",
|
||||||
widget_class = require("example.examples.basic.scroll_slider.scroll_slider"),
|
widget_class = require("example.examples.basic.scroll_slider.scroll_slider"),
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.scroll_slider
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
local s = instance.scroll
|
|
||||||
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
|
||||||
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_grid",
|
name_id = "ui_example_basic_grid",
|
||||||
@ -343,86 +162,6 @@ function M.get_examples()
|
|||||||
root = "grid/root",
|
root = "grid/root",
|
||||||
code_url = "example/examples/basic/grid/grid.lua",
|
code_url = "example/examples/basic/grid/grid.lua",
|
||||||
widget_class = require("example.examples.basic.grid.grid"),
|
widget_class = require("example.examples.basic.grid.grid"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.grid
|
|
||||||
|
|
||||||
local grid = instance.grid
|
|
||||||
|
|
||||||
local slider = properties_panel:add_slider("ui_grid_in_row", 0.3, function(value)
|
|
||||||
local in_row_amount = math.ceil(value * 10)
|
|
||||||
in_row_amount = math.max(1, in_row_amount)
|
|
||||||
grid:set_in_row(in_row_amount)
|
|
||||||
end)
|
|
||||||
slider:set_text_function(function(value)
|
|
||||||
return tostring(math.ceil(value * 10))
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_add_element", function()
|
|
||||||
if #instance.created_nodes >= 36 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
instance:add_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_remove_element", function()
|
|
||||||
instance:remove_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_clear_elements", function()
|
|
||||||
instance:clear()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_checkbox("ui_dynamic_pos", grid.style.IS_DYNAMIC_NODE_POSES, function()
|
|
||||||
grid.style.IS_DYNAMIC_NODE_POSES = not grid.style.IS_DYNAMIC_NODE_POSES
|
|
||||||
grid:refresh()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_checkbox("ui_align_last_row", grid.style.IS_ALIGN_LAST_ROW, function()
|
|
||||||
grid.style.IS_ALIGN_LAST_ROW = not grid.style.IS_ALIGN_LAST_ROW
|
|
||||||
grid:refresh()
|
|
||||||
end)
|
|
||||||
|
|
||||||
local pivot_index = 1
|
|
||||||
local pivot_list = {
|
|
||||||
gui.PIVOT_CENTER,
|
|
||||||
gui.PIVOT_W,
|
|
||||||
gui.PIVOT_SW,
|
|
||||||
gui.PIVOT_S,
|
|
||||||
gui.PIVOT_SE,
|
|
||||||
gui.PIVOT_E,
|
|
||||||
gui.PIVOT_NE,
|
|
||||||
gui.PIVOT_N,
|
|
||||||
gui.PIVOT_NW,
|
|
||||||
}
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_pivot_next", function()
|
|
||||||
pivot_index = pivot_index + 1
|
|
||||||
if pivot_index > #pivot_list then
|
|
||||||
pivot_index = 1
|
|
||||||
end
|
|
||||||
grid:set_pivot(pivot_list[pivot_index])
|
|
||||||
end)
|
|
||||||
|
|
||||||
local slider_size = properties_panel:add_slider("ui_item_size", 0.5, function(value)
|
|
||||||
local size = 50 + value * 100
|
|
||||||
grid:set_item_size(size, size)
|
|
||||||
end)
|
|
||||||
slider_size:set_text_function(function(value)
|
|
||||||
return tostring(50 + math.ceil(value * 100))
|
|
||||||
end)
|
|
||||||
slider_size:set_value(0.5)
|
|
||||||
end,
|
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.grid
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
local grid = instance.grid
|
|
||||||
info = info .. "Grid Items: " .. #grid.nodes .. "\n"
|
|
||||||
info = info .. "Grid Item Size: " .. grid.node_size.x .. " x " .. grid.node_size.y .. "\n"
|
|
||||||
info = info .. "Pivot: " .. tostring(grid.pivot)
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_scroll_bind_grid",
|
name_id = "ui_example_basic_scroll_bind_grid",
|
||||||
@ -431,51 +170,6 @@ function M.get_examples()
|
|||||||
root = "scroll_bind_grid/root",
|
root = "scroll_bind_grid/root",
|
||||||
code_url = "example/examples/basic/scroll_bind_grid/scroll_bind_grid.lua",
|
code_url = "example/examples/basic/scroll_bind_grid/scroll_bind_grid.lua",
|
||||||
widget_class = require("example.examples.basic.scroll_bind_grid.scroll_bind_grid"),
|
widget_class = require("example.examples.basic.scroll_bind_grid.scroll_bind_grid"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.scroll_bind_grid
|
|
||||||
|
|
||||||
local view_node = instance.scroll.view_node
|
|
||||||
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
|
||||||
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
|
||||||
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_add_element", function()
|
|
||||||
if #instance.created_nodes >= 100 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
instance:add_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_remove_element", function()
|
|
||||||
instance:remove_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_clear_elements", function()
|
|
||||||
instance:clear()
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.scroll_bind_grid
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
local s = instance.scroll
|
|
||||||
local view_node_size = gui.get(s.view_node, "size.y")
|
|
||||||
local scroll_position = -s.position
|
|
||||||
local scroll_bottom_position = vmath.vector3(scroll_position.x, scroll_position.y - view_node_size, scroll_position.z)
|
|
||||||
|
|
||||||
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
|
||||||
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
|
||||||
info = info .. "Grid Items: " .. #instance.grid.nodes .. "\n"
|
|
||||||
info = info .. "Grid Item Size: " .. instance.grid.node_size.x .. " x " .. instance.grid.node_size.y .. "\n"
|
|
||||||
info = info .. "Top Scroll Pos Grid Index: " .. instance.grid:get_index(scroll_position) .. "\n"
|
|
||||||
info = info .. "Bottm Scroll Pos Grid Index: " .. instance.grid:get_index(scroll_bottom_position) .. "\n"
|
|
||||||
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_scroll_bind_grid_horizontal",
|
name_id = "ui_example_basic_scroll_bind_grid_horizontal",
|
||||||
@ -484,52 +178,6 @@ function M.get_examples()
|
|||||||
root = "scroll_bind_grid_horizontal/root",
|
root = "scroll_bind_grid_horizontal/root",
|
||||||
code_url = "example/examples/basic/scroll_bind_grid/scroll_bind_grid_horizontal.lua",
|
code_url = "example/examples/basic/scroll_bind_grid/scroll_bind_grid_horizontal.lua",
|
||||||
widget_class = require("example.examples.basic.scroll_bind_grid.scroll_bind_grid_horizontal"),
|
widget_class = require("example.examples.basic.scroll_bind_grid.scroll_bind_grid_horizontal"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.scroll_bind_grid_horizontal
|
|
||||||
|
|
||||||
local view_node = instance.scroll.view_node
|
|
||||||
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
|
||||||
|
|
||||||
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
|
||||||
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_add_element", function()
|
|
||||||
if #instance.created_nodes >= 100 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
instance:add_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_remove_element", function()
|
|
||||||
instance:remove_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_clear_elements", function()
|
|
||||||
instance:clear()
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.scroll_bind_grid_horizontal
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
local s = instance.scroll
|
|
||||||
local view_node_size = gui.get(s.view_node, "size.x")
|
|
||||||
local scroll_position = -s.position
|
|
||||||
local scroll_bottom_position = vmath.vector3(scroll_position.x + view_node_size, scroll_position.y, scroll_position.z)
|
|
||||||
|
|
||||||
info = info .. "View Size X: " .. gui.get(s.view_node, "size.x") .. "\n"
|
|
||||||
info = info .. "Content Size X: " .. gui.get(s.content_node, "size.x") .. "\n"
|
|
||||||
info = info .. "Content position X: " .. math.ceil(s.position.x) .. "\n"
|
|
||||||
info = info .. "Content Range X: " .. s.available_pos.x .. " - " .. s.available_pos.z .. "\n"
|
|
||||||
info = info .. "Grid Items: " .. #instance.grid.nodes .. "\n"
|
|
||||||
info = info .. "Grid Item Size: " .. instance.grid.node_size.x .. " x " .. instance.grid.node_size.y .. "\n"
|
|
||||||
info = info .. "Left Scroll Pos Grid Index: " .. instance.grid:get_index(scroll_position) .. "\n"
|
|
||||||
info = info .. "Right Scroll Pos Grid Index: " .. instance.grid:get_index(scroll_bottom_position) .. "\n"
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_scroll_bind_grid_points",
|
name_id = "ui_example_basic_scroll_bind_grid_points",
|
||||||
@ -538,51 +186,6 @@ function M.get_examples()
|
|||||||
root = "scroll_bind_grid_points/root",
|
root = "scroll_bind_grid_points/root",
|
||||||
code_url = "example/examples/basic/scroll_bind_grid/scroll_bind_grid_points.lua",
|
code_url = "example/examples/basic/scroll_bind_grid/scroll_bind_grid_points.lua",
|
||||||
widget_class = require("example.examples.basic.scroll_bind_grid.scroll_bind_grid_points"),
|
widget_class = require("example.examples.basic.scroll_bind_grid.scroll_bind_grid_points"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
---@cast instance examples.scroll_bind_grid_points
|
|
||||||
|
|
||||||
local view_node = instance.scroll.view_node
|
|
||||||
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
|
||||||
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
|
||||||
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_add_element", function()
|
|
||||||
if #instance.created_nodes >= 100 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
instance:add_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_remove_element", function()
|
|
||||||
instance:remove_element()
|
|
||||||
end)
|
|
||||||
|
|
||||||
properties_panel:add_button("ui_clear_elements", function()
|
|
||||||
instance:clear()
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
get_debug_info = function(instance)
|
|
||||||
---@cast instance examples.scroll_bind_grid_points
|
|
||||||
local info = ""
|
|
||||||
|
|
||||||
local s = instance.scroll
|
|
||||||
local view_node_size = gui.get(s.view_node, "size.y")
|
|
||||||
local scroll_position = -s.position
|
|
||||||
local scroll_bottom_position = vmath.vector3(scroll_position.x, scroll_position.y - view_node_size, scroll_position.z)
|
|
||||||
|
|
||||||
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
|
||||||
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
|
||||||
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
|
||||||
info = info .. "Grid Items: " .. #instance.grid.nodes .. "\n"
|
|
||||||
info = info .. "Grid Item Size: " .. instance.grid.node_size.x .. " x " .. instance.grid.node_size.y .. "\n"
|
|
||||||
info = info .. "Top Scroll Pos Grid Index: " .. instance.grid:get_index(scroll_position) .. "\n"
|
|
||||||
info = info .. "Bottm Scroll Pos Grid Index: " .. instance.grid:get_index(scroll_bottom_position) .. "\n"
|
|
||||||
|
|
||||||
|
|
||||||
return info
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_input",
|
name_id = "ui_example_basic_input",
|
||||||
@ -591,21 +194,6 @@ function M.get_examples()
|
|||||||
root = "basic_input/root",
|
root = "basic_input/root",
|
||||||
code_url = "example/examples/basic/input/basic_input.lua",
|
code_url = "example/examples/basic/input/basic_input.lua",
|
||||||
widget_class = require("example.examples.basic.input.basic_input"),
|
widget_class = require("example.examples.basic.input.basic_input"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_input
|
|
||||||
instance.input.on_input_select:subscribe(function()
|
|
||||||
output_log:add_log_text("Input Selected")
|
|
||||||
end)
|
|
||||||
instance.input_2.on_input_select:subscribe(function()
|
|
||||||
output_log:add_log_text("Input 2 Selected")
|
|
||||||
end)
|
|
||||||
instance.input.on_input_unselect:subscribe(function(_, text)
|
|
||||||
output_log:add_log_text("Input Deselected. Text: " .. text)
|
|
||||||
end)
|
|
||||||
instance.input_2.on_input_unselect:subscribe(function(_, text)
|
|
||||||
output_log:add_log_text("Input Deselected. Text: " .. text)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_input_password",
|
name_id = "ui_example_input_password",
|
||||||
@ -614,12 +202,6 @@ function M.get_examples()
|
|||||||
root = "input_password/root",
|
root = "input_password/root",
|
||||||
code_url = "example/examples/basic/input/input_password.lua",
|
code_url = "example/examples/basic/input/input_password.lua",
|
||||||
widget_class = require("example.examples.basic.input.input_password"),
|
widget_class = require("example.examples.basic.input.input_password"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.input_password
|
|
||||||
instance.input.on_input_unselect:subscribe(function(_, text)
|
|
||||||
output_log:add_log_text("Input: " .. text)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_rich_input",
|
name_id = "ui_example_basic_rich_input",
|
||||||
@ -628,15 +210,6 @@ function M.get_examples()
|
|||||||
root = "basic_rich_input/root",
|
root = "basic_rich_input/root",
|
||||||
code_url = "example/examples/basic/input/rich_input.lua",
|
code_url = "example/examples/basic/input/rich_input.lua",
|
||||||
widget_class = require("example.examples.basic.input.rich_input"),
|
widget_class = require("example.examples.basic.input.rich_input"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.rich_input
|
|
||||||
instance.rich_input.input.on_input_unselect:subscribe(function(_, text)
|
|
||||||
output_log:add_log_text("Input: " .. text)
|
|
||||||
end)
|
|
||||||
instance.rich_input_2.input.on_input_unselect:subscribe(function(_, text)
|
|
||||||
output_log:add_log_text("Input 2: " .. text)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_basic_rich_text",
|
name_id = "ui_example_basic_rich_text",
|
||||||
@ -653,29 +226,6 @@ function M.get_examples()
|
|||||||
root = "rich_text_tags/root",
|
root = "rich_text_tags/root",
|
||||||
code_url = "example/examples/basic/rich_text/rich_text_tags.lua",
|
code_url = "example/examples/basic/rich_text/rich_text_tags.lua",
|
||||||
widget_class = require("example.examples.basic.rich_text.rich_text_tags"),
|
widget_class = require("example.examples.basic.rich_text.rich_text_tags"),
|
||||||
properties_control = function(instance, properties_panel)
|
|
||||||
local pivot_index = 1
|
|
||||||
local pivot_list = {
|
|
||||||
gui.PIVOT_CENTER,
|
|
||||||
gui.PIVOT_W,
|
|
||||||
gui.PIVOT_SW,
|
|
||||||
gui.PIVOT_S,
|
|
||||||
gui.PIVOT_SE,
|
|
||||||
gui.PIVOT_E,
|
|
||||||
gui.PIVOT_NE,
|
|
||||||
gui.PIVOT_N,
|
|
||||||
gui.PIVOT_NW,
|
|
||||||
}
|
|
||||||
|
|
||||||
---@cast instance examples.rich_text_tags
|
|
||||||
properties_panel:add_button("ui_pivot_next", function()
|
|
||||||
pivot_index = pivot_index + 1
|
|
||||||
if pivot_index > #pivot_list then
|
|
||||||
pivot_index = 1
|
|
||||||
end
|
|
||||||
instance:set_pivot(pivot_list[pivot_index])
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
--{
|
--{
|
||||||
-- name_id = "ui_example_rich_text_tags_custom",
|
-- name_id = "ui_example_rich_text_tags_custom",
|
||||||
@ -722,12 +272,6 @@ function M.get_examples()
|
|||||||
root = "basic_swipe/root",
|
root = "basic_swipe/root",
|
||||||
code_url = "example/examples/basic/swipe/basic_swipe.lua",
|
code_url = "example/examples/basic/swipe/basic_swipe.lua",
|
||||||
widget_class = require("example.examples.basic.swipe.basic_swipe"),
|
widget_class = require("example.examples.basic.swipe.basic_swipe"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.basic_swipe
|
|
||||||
instance.swipe.on_swipe:subscribe(function(_, side, dist, delta_time)
|
|
||||||
output_log:add_log_text("Swipe Side: " .. side)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_checkbox",
|
name_id = "ui_example_checkbox",
|
||||||
@ -736,12 +280,6 @@ function M.get_examples()
|
|||||||
root = "checkbox/root",
|
root = "checkbox/root",
|
||||||
code_url = "example/examples/basic/checkbox/checkbox.lua",
|
code_url = "example/examples/basic/checkbox/checkbox.lua",
|
||||||
widget_class = require("example.examples.basic.checkbox.checkbox"),
|
widget_class = require("example.examples.basic.checkbox.checkbox"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.checkbox
|
|
||||||
instance.button.on_click:subscribe(function()
|
|
||||||
output_log:add_log_text("Checkbox Clicked: " .. tostring(instance.is_enabled))
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_checkbox_group",
|
name_id = "ui_example_checkbox_group",
|
||||||
@ -750,12 +288,6 @@ function M.get_examples()
|
|||||||
root = "checkbox_group/root",
|
root = "checkbox_group/root",
|
||||||
code_url = "example/examples/basic/checkbox_group/checkbox_group.lua",
|
code_url = "example/examples/basic/checkbox_group/checkbox_group.lua",
|
||||||
widget_class = require("example.examples.basic.checkbox_group.checkbox_group"),
|
widget_class = require("example.examples.basic.checkbox_group.checkbox_group"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.checkbox_group
|
|
||||||
instance.on_state_changed:subscribe(function(state1, state2, state3)
|
|
||||||
output_log:add_log_text("State: " .. tostring(state1) .. " " .. tostring(state2) .. " " .. tostring(state3))
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name_id = "ui_example_radio_group",
|
name_id = "ui_example_radio_group",
|
||||||
@ -764,12 +296,6 @@ function M.get_examples()
|
|||||||
root = "radio_group/root",
|
root = "radio_group/root",
|
||||||
code_url = "example/examples/basic/radio_group/radio_group.lua",
|
code_url = "example/examples/basic/radio_group/radio_group.lua",
|
||||||
widget_class = require("example.examples.basic.radio_group.radio_group"),
|
widget_class = require("example.examples.basic.radio_group.radio_group"),
|
||||||
on_create = function(instance, output_log)
|
|
||||||
---@cast instance examples.radio_group
|
|
||||||
instance.on_state_changed:subscribe(function(selected)
|
|
||||||
output_log:add_log_text("Selected: " .. selected)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -55,4 +55,86 @@ function M:clear()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local grid = self.grid
|
||||||
|
|
||||||
|
local slider = properties_panel:add_slider("ui_grid_in_row", 0.3, function(value)
|
||||||
|
local in_row_amount = math.ceil(value * 10)
|
||||||
|
in_row_amount = math.max(1, in_row_amount)
|
||||||
|
grid:set_in_row(in_row_amount)
|
||||||
|
end)
|
||||||
|
slider:set_text_function(function(value)
|
||||||
|
return tostring(math.ceil(value * 10))
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_add_element", function()
|
||||||
|
if #self.created_nodes >= 36 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self:add_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_remove_element", function()
|
||||||
|
self:remove_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_clear_elements", function()
|
||||||
|
self:clear()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_checkbox("ui_dynamic_pos", grid.style.IS_DYNAMIC_NODE_POSES, function()
|
||||||
|
grid.style.IS_DYNAMIC_NODE_POSES = not grid.style.IS_DYNAMIC_NODE_POSES
|
||||||
|
grid:refresh()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_checkbox("ui_align_last_row", grid.style.IS_ALIGN_LAST_ROW, function()
|
||||||
|
grid.style.IS_ALIGN_LAST_ROW = not grid.style.IS_ALIGN_LAST_ROW
|
||||||
|
grid:refresh()
|
||||||
|
end)
|
||||||
|
|
||||||
|
local pivot_index = 1
|
||||||
|
local pivot_list = {
|
||||||
|
gui.PIVOT_CENTER,
|
||||||
|
gui.PIVOT_W,
|
||||||
|
gui.PIVOT_SW,
|
||||||
|
gui.PIVOT_S,
|
||||||
|
gui.PIVOT_SE,
|
||||||
|
gui.PIVOT_E,
|
||||||
|
gui.PIVOT_NE,
|
||||||
|
gui.PIVOT_N,
|
||||||
|
gui.PIVOT_NW,
|
||||||
|
}
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_pivot_next", function()
|
||||||
|
pivot_index = pivot_index + 1
|
||||||
|
if pivot_index > #pivot_list then
|
||||||
|
pivot_index = 1
|
||||||
|
end
|
||||||
|
grid:set_pivot(pivot_list[pivot_index])
|
||||||
|
end)
|
||||||
|
|
||||||
|
local slider_size = properties_panel:add_slider("ui_item_size", 0.5, function(value)
|
||||||
|
local size = 50 + value * 100
|
||||||
|
grid:set_item_size(size, size)
|
||||||
|
end)
|
||||||
|
slider_size:set_text_function(function(value)
|
||||||
|
return tostring(50 + math.ceil(value * 100))
|
||||||
|
end)
|
||||||
|
slider_size:set_value(0.5)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
info = info .. "Grid Items: " .. #self.grid.nodes .. "\n"
|
||||||
|
info = info .. "Grid Item Size: " .. self.grid.node_size.x .. " x " .. self.grid.node_size.y .. "\n"
|
||||||
|
info = info .. "Pivot: " .. tostring(self.grid.pivot)
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -16,4 +16,12 @@ function M:on_hotkey()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.hotkey.on_hotkey_released:subscribe(function()
|
||||||
|
output_log:add_log_text("Hotkey Released")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -14,4 +14,21 @@ function M:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.input.on_input_select:subscribe(function()
|
||||||
|
output_log:add_log_text("Input Selected")
|
||||||
|
end)
|
||||||
|
self.input_2.on_input_select:subscribe(function()
|
||||||
|
output_log:add_log_text("Input 2 Selected")
|
||||||
|
end)
|
||||||
|
self.input.on_input_unselect:subscribe(function(_, text)
|
||||||
|
output_log:add_log_text("Input Deselected. Text: " .. text)
|
||||||
|
end)
|
||||||
|
self.input_2.on_input_unselect:subscribe(function(_, text)
|
||||||
|
output_log:add_log_text("Input Deselected. Text: " .. text)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -15,4 +15,12 @@ function M:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.input.on_input_unselect:subscribe(function(_, text)
|
||||||
|
output_log:add_log_text("Input: " .. text)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -13,4 +13,15 @@ function M:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.rich_input.input.on_input_unselect:subscribe(function(_, text)
|
||||||
|
output_log:add_log_text("Input: " .. text)
|
||||||
|
end)
|
||||||
|
self.rich_input_2.input.on_input_unselect:subscribe(function(_, text)
|
||||||
|
output_log:add_log_text("Input 2: " .. text)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -16,4 +16,12 @@ function M:set_value(value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
properties_panel:add_slider("ui_value", 1, function(value)
|
||||||
|
self:set_value(value)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -16,4 +16,12 @@ function M:set_value(value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
properties_panel:add_slider("ui_value", 1, function(value)
|
||||||
|
self:set_value(value)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -47,4 +47,12 @@ function M:on_checkbox_click()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.on_state_changed:subscribe(function(selected)
|
||||||
|
output_log:add_log_text("Selected: " .. selected)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -71,4 +71,29 @@ function M:set_pivot(pivot)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local pivot_index = 1
|
||||||
|
local pivot_list = {
|
||||||
|
gui.PIVOT_CENTER,
|
||||||
|
gui.PIVOT_W,
|
||||||
|
gui.PIVOT_SW,
|
||||||
|
gui.PIVOT_S,
|
||||||
|
gui.PIVOT_SE,
|
||||||
|
gui.PIVOT_E,
|
||||||
|
gui.PIVOT_NE,
|
||||||
|
gui.PIVOT_N,
|
||||||
|
gui.PIVOT_NW,
|
||||||
|
}
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_pivot_next", function()
|
||||||
|
pivot_index = pivot_index + 1
|
||||||
|
if pivot_index > #pivot_list then
|
||||||
|
pivot_index = 1
|
||||||
|
end
|
||||||
|
self:set_pivot(pivot_list[pivot_index])
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -13,4 +13,74 @@ function M:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.button_tutorial.on_click:subscribe(function()
|
||||||
|
output_log:add_log_text("Button Tutorial Clicked")
|
||||||
|
end)
|
||||||
|
self.button_stencil.on_click:subscribe(function()
|
||||||
|
output_log:add_log_text("Button Stencil Clicked")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local scroll = self.scroll
|
||||||
|
local is_stretch = self.scroll.style.EXTRA_STRETCH_SIZE > 0
|
||||||
|
properties_panel:add_checkbox("ui_elastic_scroll", is_stretch, function(value)
|
||||||
|
self.scroll:set_extra_stretch_size(value and 100 or 0)
|
||||||
|
end)
|
||||||
|
|
||||||
|
local view_node = self.scroll.view_node
|
||||||
|
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
||||||
|
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
||||||
|
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
||||||
|
end)
|
||||||
|
|
||||||
|
local slider_frict = properties_panel:add_slider("ui_slider_friction", 0, function(value)
|
||||||
|
scroll.style.FRICT = 1 - ((1 - value) * 0.1)
|
||||||
|
end)
|
||||||
|
slider_frict:set_text_function(function(value)
|
||||||
|
return string.format("%.2f", 1 - ((1 - value) * 0.1))
|
||||||
|
end)
|
||||||
|
slider_frict:set_value(1 - (1 - scroll.style.FRICT) / 0.1)
|
||||||
|
|
||||||
|
local slider_speed = properties_panel:add_slider("ui_slider_speed", 0, function(value)
|
||||||
|
scroll.style.INERT_SPEED = value * 50
|
||||||
|
end)
|
||||||
|
slider_speed:set_value(scroll.style.INERT_SPEED / 50)
|
||||||
|
slider_speed:set_text_function(function(value)
|
||||||
|
return string.format("%.1f", value * 50)
|
||||||
|
end)
|
||||||
|
|
||||||
|
local slider_wheel_speed = properties_panel:add_slider("ui_slider_wheel_speed", 0, function(value)
|
||||||
|
scroll.style.WHEEL_SCROLL_SPEED = value * 30
|
||||||
|
end)
|
||||||
|
slider_wheel_speed:set_value(scroll.style.WHEEL_SCROLL_SPEED / 30)
|
||||||
|
slider_wheel_speed:set_text_function(function(value)
|
||||||
|
return string.format("%.1f", value * 30)
|
||||||
|
end)
|
||||||
|
|
||||||
|
local wheel_by_inertion = properties_panel:add_checkbox("ui_wheel_by_inertion", scroll.style.WHEEL_SCROLL_BY_INERTION, function(value)
|
||||||
|
scroll.style.WHEEL_SCROLL_BY_INERTION = value
|
||||||
|
end)
|
||||||
|
wheel_by_inertion:set_value(scroll.style.WHEEL_SCROLL_BY_INERTION)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
local s = self.scroll
|
||||||
|
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
||||||
|
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -58,4 +58,51 @@ function M:clear()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local view_node = self.scroll.view_node
|
||||||
|
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
||||||
|
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
||||||
|
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_add_element", function()
|
||||||
|
if #self.created_nodes >= 100 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self:add_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_remove_element", function()
|
||||||
|
self:remove_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_clear_elements", function()
|
||||||
|
self:clear()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
local s = self.scroll
|
||||||
|
local view_node_size = gui.get(s.view_node, "size.y")
|
||||||
|
local scroll_position = -s.position
|
||||||
|
local scroll_bottom_position = vmath.vector3(scroll_position.x, scroll_position.y - view_node_size, scroll_position.z)
|
||||||
|
|
||||||
|
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
||||||
|
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
||||||
|
info = info .. "Grid Items: " .. #self.grid.nodes .. "\n"
|
||||||
|
info = info .. "Grid Item Size: " .. self.grid.node_size.x .. " x " .. self.grid.node_size.y .. "\n"
|
||||||
|
info = info .. "Top Scroll Pos Grid Index: " .. self.grid:get_index(scroll_position) .. "\n"
|
||||||
|
info = info .. "Bottm Scroll Pos Grid Index: " .. self.grid:get_index(scroll_bottom_position) .. "\n"
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -58,4 +58,53 @@ function M:clear()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local view_node = self.scroll.view_node
|
||||||
|
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
||||||
|
|
||||||
|
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
||||||
|
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_add_element", function()
|
||||||
|
if #self.created_nodes >= 100 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self:add_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_remove_element", function()
|
||||||
|
self:remove_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_clear_elements", function()
|
||||||
|
self:clear()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
local s = self.scroll
|
||||||
|
local view_node_size = gui.get(s.view_node, "size.x")
|
||||||
|
local scroll_position = -s.position
|
||||||
|
local scroll_bottom_position = vmath.vector3(scroll_position.x + view_node_size, scroll_position.y, scroll_position.z)
|
||||||
|
|
||||||
|
info = info .. "View Size X: " .. gui.get(s.view_node, "size.x") .. "\n"
|
||||||
|
info = info .. "Content Size X: " .. gui.get(s.content_node, "size.x") .. "\n"
|
||||||
|
info = info .. "Content position X: " .. math.ceil(s.position.x) .. "\n"
|
||||||
|
info = info .. "Content Range X: " .. s.available_pos.x .. " - " .. s.available_pos.z .. "\n"
|
||||||
|
info = info .. "Grid Items: " .. #self.grid.nodes .. "\n"
|
||||||
|
info = info .. "Grid Item Size: " .. self.grid.node_size.x .. " x " .. self.grid.node_size.y .. "\n"
|
||||||
|
info = info .. "Left Scroll Pos Grid Index: " .. self.grid:get_index(scroll_position) .. "\n"
|
||||||
|
info = info .. "Right Scroll Pos Grid Index: " .. self.grid:get_index(scroll_bottom_position) .. "\n"
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -64,4 +64,51 @@ function M:clear()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local view_node = self.scroll.view_node
|
||||||
|
local is_stencil = gui.get_clipping_mode(view_node) == gui.CLIPPING_MODE_STENCIL
|
||||||
|
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
|
||||||
|
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_add_element", function()
|
||||||
|
if #self.created_nodes >= 100 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self:add_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_remove_element", function()
|
||||||
|
self:remove_element()
|
||||||
|
end)
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_clear_elements", function()
|
||||||
|
self:clear()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
local s = self.scroll
|
||||||
|
local view_node_size = gui.get(s.view_node, "size.y")
|
||||||
|
local scroll_position = -s.position
|
||||||
|
local scroll_bottom_position = vmath.vector3(scroll_position.x, scroll_position.y - view_node_size, scroll_position.z)
|
||||||
|
|
||||||
|
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
||||||
|
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
||||||
|
info = info .. "Grid Items: " .. #self.grid.nodes .. "\n"
|
||||||
|
info = info .. "Grid Item Size: " .. self.grid.node_size.x .. " x " .. self.grid.node_size.y .. "\n"
|
||||||
|
info = info .. "Top Scroll Pos Grid Index: " .. self.grid:get_index(scroll_position) .. "\n"
|
||||||
|
info = info .. "Bottm Scroll Pos Grid Index: " .. self.grid:get_index(scroll_bottom_position) .. "\n"
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -43,4 +43,18 @@ function M:on_slider_back_hover(is_hover)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
local s = self.scroll
|
||||||
|
info = info .. "View Size Y: " .. gui.get(s.view_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content Size Y: " .. gui.get(s.content_node, "size.y") .. "\n"
|
||||||
|
info = info .. "Content position Y: " .. math.ceil(s.position.y) .. "\n"
|
||||||
|
info = info .. "Content Range Y: " .. s.available_pos.y .. " - " .. s.available_pos.w .. "\n"
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
local helper = require("druid.helper")
|
||||||
|
|
||||||
---@class examples.basic_slider: druid.widget
|
---@class examples.basic_slider: druid.widget
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
@ -18,4 +20,13 @@ function M:on_slider_change(value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.slider.on_change_value:subscribe(function(_, value)
|
||||||
|
value = helper.round(value, 2)
|
||||||
|
output_log:add_log_text("Slider Value: " .. value)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
local helper = require("druid.helper")
|
||||||
|
|
||||||
---@class examples.basic_slider_stepped: druid.widget
|
---@class examples.basic_slider_stepped: druid.widget
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
@ -20,4 +22,13 @@ function M:on_slider_change(value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.slider.on_change_value:subscribe(function(_, value)
|
||||||
|
value = helper.round(value, 2)
|
||||||
|
output_log:add_log_text("Slider Value: " .. value)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
local helper = require("druid.helper")
|
||||||
|
|
||||||
---@class examples.basic_slider_vertical: druid.widget
|
---@class examples.basic_slider_vertical: druid.widget
|
||||||
---@field root node
|
---@field root node
|
||||||
---@field slider druid.slider
|
---@field slider druid.slider
|
||||||
@ -18,4 +20,14 @@ function M:on_slider_change(value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.slider.on_change_value:subscribe(function(_, value)
|
||||||
|
value = helper.round(value, 2)
|
||||||
|
output_log:add_log_text("Slider Value: " .. value)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -25,4 +25,12 @@ function M:on_swipe(swipe_side, dist, delta_time)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.swipe.on_swipe:subscribe(function(_, side, dist, delta_time)
|
||||||
|
output_log:add_log_text("Swipe Side: " .. side)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -32,4 +32,56 @@ function M:refresh_text_position()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param properties_panel properties_panel
|
||||||
|
function M:properties_control(properties_panel)
|
||||||
|
local adjust_index = 1
|
||||||
|
local adjust_types = {
|
||||||
|
"downscale",
|
||||||
|
"downscale_limited",
|
||||||
|
--"scale_then_scroll", -- works bad with container for some reason
|
||||||
|
--"scroll", -- works bad with container for some reason
|
||||||
|
"trim",
|
||||||
|
}
|
||||||
|
properties_panel:add_button("ui_adjust_next", function()
|
||||||
|
adjust_index = adjust_index + 1
|
||||||
|
if adjust_index > #adjust_types then
|
||||||
|
adjust_index = 1
|
||||||
|
end
|
||||||
|
self.text:set_text_adjust(adjust_types[adjust_index], 0.8)
|
||||||
|
end)
|
||||||
|
|
||||||
|
local pivot_index = 1
|
||||||
|
local pivot_list = {
|
||||||
|
gui.PIVOT_CENTER,
|
||||||
|
gui.PIVOT_W,
|
||||||
|
gui.PIVOT_SW,
|
||||||
|
gui.PIVOT_S,
|
||||||
|
gui.PIVOT_SE,
|
||||||
|
gui.PIVOT_E,
|
||||||
|
gui.PIVOT_NE,
|
||||||
|
gui.PIVOT_N,
|
||||||
|
gui.PIVOT_NW,
|
||||||
|
}
|
||||||
|
|
||||||
|
properties_panel:add_button("ui_pivot_next", function()
|
||||||
|
pivot_index = pivot_index + 1
|
||||||
|
if pivot_index > #pivot_list then
|
||||||
|
pivot_index = 1
|
||||||
|
end
|
||||||
|
self:set_pivot(pivot_list[pivot_index])
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
function M:get_debug_info()
|
||||||
|
local info = ""
|
||||||
|
|
||||||
|
info = info .. "Text Adjust: " .. self.text.adjust_type .. "\n"
|
||||||
|
info = info .. "Pivot: " .. gui.get_pivot(self.text.node) .. "\n"
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -21,4 +21,12 @@ function M:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param output_log output_list
|
||||||
|
function M:on_example_created(output_log)
|
||||||
|
self.on_cycle_end:subscribe(function()
|
||||||
|
output_log:add_log_text("Timer Cycle End")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -107,3 +107,5 @@ path = /example/locales
|
|||||||
langs = en,ru,es,de,fr,ja,pt,it,kr,zh
|
langs = en,ru,es,de,fr,ja,pt,it,kr,zh
|
||||||
default = es
|
default = es
|
||||||
|
|
||||||
|
[event]
|
||||||
|
use_xpcall = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user