Update annotations, fix rare errors

This commit is contained in:
Insality
2024-10-05 01:40:46 +03:00
parent b9b74736a7
commit d39f4715f3
5 changed files with 55 additions and 31 deletions

View File

@@ -210,7 +210,15 @@ function RichText.set_text(self, text)
end
function RichText.get_text(self)
return self._last_value
end
function RichText:on_remove()
pcall(gui.set_texture, self.icon_prefab, self._settings.default_texture)
pcall(gui.play_flipbook, self.icon_prefab, self._settings.default_animation)
self:clear()
end
@@ -238,6 +246,15 @@ function RichText.tagged(self, tag)
end
---Split a word into it's characters
-- @tparam RichText self @{RichText}
-- @tparam druid.rich_text.word word
-- @treturn druid.rich_text.word[] characters
function RichText.characters(self, word)
return rich_text.characters(word)
end
--- Get all current words.
-- @treturn table druid.rich_text.word[]
function RichText:get_words()
@@ -277,6 +294,7 @@ function RichText:_create_settings()
node_scale = gui.get_scale(self.icon_prefab),
image_scale = gui.get_scale(self.icon_prefab),
default_animation = gui.get_flipbook(self.icon_prefab),
default_texture = gui.get_texture(self.icon_prefab),
}
end