From a4fa0f03485c22f32beac6bac531d3208dc902a8 Mon Sep 17 00:00:00 2001 From: Insality Date: Mon, 14 Oct 2024 22:24:57 +0300 Subject: [PATCH] WIP --- druid/custom/rich_text/module/rt.lua | 7 +++---- druid/custom/rich_text/rich_text.lua | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/druid/custom/rich_text/module/rt.lua b/druid/custom/rich_text/module/rt.lua index feaeb71..5347441 100755 --- a/druid/custom/rich_text/module/rt.lua +++ b/druid/custom/rich_text/module/rt.lua @@ -154,7 +154,6 @@ function M.create(text, settings, style) -- default settings for a word -- will be assigned to each word unless tags override the values - local font = gui.get_font(settings.text_prefab) local word_params = { node = nil, -- Autofill on node creation relative_scale = 1, @@ -171,7 +170,7 @@ function M.create(text, settings, style) text_color = gui.get_color(settings.text_prefab), shadow = settings.shadow, outline = settings.outline, - font = font, + font = gui.get_font(settings.text_prefab), -- Image params ---@type druid.rich_text.image image = nil, @@ -409,8 +408,8 @@ function M._update_nodes(lines, settings) if word.image then node = word.node or gui.new_box_node(vmath.vector3(0), word.size) gui.set_size_mode(node, gui.SIZE_MODE_MANUAL) - gui.set_texture(node, word.image.texture or settings.default_texture) - gui.play_flipbook(node, hash(word.image.anim or settings.default_animation)) + gui.set_texture(node, word.image.texture) + gui.play_flipbook(node, hash(word.image.anim)) gui.set_color(node, word.color or word.image_color) else node = word.node or gui.clone(settings.text_prefab) diff --git a/druid/custom/rich_text/rich_text.lua b/druid/custom/rich_text/rich_text.lua index 1cf9a10..ea54753 100644 --- a/druid/custom/rich_text/rich_text.lua +++ b/druid/custom/rich_text/rich_text.lua @@ -127,8 +127,6 @@ end function RichText.on_layout_change(self) - gui.set_enabled(self.text_prefab, false) - gui.set_enabled(self.icon_prefab, false) if self._last_value then self:set_text(self._last_value) end @@ -294,9 +292,6 @@ function RichText:_create_settings() -- Image settings image_pixel_grid_snap = false, -- disabled now node_scale = gui.get_scale(self.text_prefab), - image_scale = gui.get_scale(self.text_prefab), - --default_animation = gui.get_flipbook(self.icon_prefab), - --default_texture = gui.get_texture(self.icon_prefab), } end