Refactor text setting methods and remove ldoc files

This commit is contained in:
Insality
2024-12-08 13:35:41 +02:00
parent 9a1cd795b8
commit 6b8bbe1970
26 changed files with 158 additions and 544 deletions

View File

@@ -24,7 +24,7 @@ end
---@param info string
function M:set_debug_info(info)
self.text_debug_info:set_to(info)
self.text_debug_info:set_text(info)
end
@@ -34,7 +34,7 @@ function M:set_gui_path(path)
-- We need add "/" before path and replace .lua to .gui
path = "/" .. path:gsub(".lua", ".gui")
self.text_gui_path:set_to(path)
self.text_gui_path:set_text(path)
end

View File

@@ -81,7 +81,7 @@ end
function M:update_memory()
local memory = collectgarbage("count")
self.text_memory_amount:set_to(tostring(math.ceil(memory)))
self.text_memory_amount:set_text(tostring(math.ceil(memory)))
local width = helper.centrate_nodes(2, unpack(self.nodes_memory))
for index = 1, #self.nodes_memory do
@@ -102,8 +102,8 @@ function M:update_fps()
end
average_frame_time = average_frame_time / #self.fps_samples
self.text_fps_amount:set_to(tostring(math.ceil(1 / average_frame_time)))
self.text_fps_min:set_to("/ " .. tostring(math.ceil(1 / max_frame_time)))
self.text_fps_amount:set_text(tostring(math.ceil(1 / average_frame_time)))
self.text_fps_min:set_text("/ " .. tostring(math.ceil(1 / max_frame_time)))
local width = helper.centrate_nodes(2, unpack(self.nodes_fps))
self.group_fps:set_size(width, nil)
@@ -114,14 +114,14 @@ function M:update_components()
---@diagnostic disable-next-line: undefined-field
local components = #self.druid.components_all
self.text_components_amount:set_to(tostring(components))
self.text_components_amount:set_text(tostring(components))
local width = helper.centrate_nodes(2, unpack(self.nodes_components))
self.group_components:set_size(width, nil)
end
function M:update_events()
self.text_events_amount:set_to(tostring(event.COUNTER))
self.text_events_amount:set_text("unsupported")
local width = helper.centrate_nodes(2, unpack(self.nodes_events))
for index = 1, #self.nodes_events do

View File

@@ -33,7 +33,7 @@ end
---@param callback fun(value:number):string
function M:set_text_function(callback)
self._text_function = callback
self.text_value:set_to(self._text_function(self._value))
self.text_value:set_text(self._text_function(self._value))
end
@@ -45,7 +45,7 @@ function M:set_value(value, is_instant)
self._value = value
self.slider:set(value, true)
self.text_value:set_to(self._text_function(value))
self.text_value:set_text(self._text_function(value))
if not is_instant then
gui.set_alpha(self.selected, 1)
@@ -62,7 +62,7 @@ end
function M:_on_slider_change_by_user(value)
self._value = value
self.text_value:set_to(self._text_function(value))
self.text_value:set_text(self._text_function(value))
gui.set_alpha(self.selected, 1)
gui.animate(self.selected, "color.w", 0, gui.EASING_INSINE, 0.16)