mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
[RTL] Fix custom effects not updating.
This commit is contained in:
parent
1ba4dbb164
commit
9f8d8b7c4e
3 changed files with 15 additions and 3 deletions
|
|
@ -525,6 +525,12 @@
|
||||||
Adds a [code skip-lint][u][/code] tag to the tag stack.
|
Adds a [code skip-lint][u][/code] tag to the tag stack.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="reload_effects">
|
||||||
|
<return type="void" />
|
||||||
|
<description>
|
||||||
|
Reloads custom effects. Useful when [member custom_effects] is modified manually.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="remove_paragraph">
|
<method name="remove_paragraph">
|
||||||
<return type="bool" />
|
<return type="bool" />
|
||||||
<param index="0" name="paragraph" type="int" />
|
<param index="0" name="paragraph" type="int" />
|
||||||
|
|
|
||||||
|
|
@ -6356,9 +6356,7 @@ float RichTextLabel::get_visible_ratio() const {
|
||||||
|
|
||||||
void RichTextLabel::set_effects(Array p_effects) {
|
void RichTextLabel::set_effects(Array p_effects) {
|
||||||
custom_effects = p_effects;
|
custom_effects = p_effects;
|
||||||
if (!stack_externally_modified && use_bbcode) {
|
reload_effects();
|
||||||
parse_bbcode(atr(text));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Array RichTextLabel::get_effects() {
|
Array RichTextLabel::get_effects() {
|
||||||
|
|
@ -6371,8 +6369,14 @@ void RichTextLabel::install_effect(const Variant effect) {
|
||||||
|
|
||||||
ERR_FAIL_COND_MSG(rteffect.is_null(), "Invalid RichTextEffect resource.");
|
ERR_FAIL_COND_MSG(rteffect.is_null(), "Invalid RichTextEffect resource.");
|
||||||
custom_effects.push_back(effect);
|
custom_effects.push_back(effect);
|
||||||
|
reload_effects();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RichTextLabel::reload_effects() {
|
||||||
if (!stack_externally_modified && use_bbcode) {
|
if (!stack_externally_modified && use_bbcode) {
|
||||||
|
internal_stack_editing = true;
|
||||||
parse_bbcode(atr(text));
|
parse_bbcode(atr(text));
|
||||||
|
internal_stack_editing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6580,6 +6584,7 @@ void RichTextLabel::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("set_effects", "effects"), &RichTextLabel::set_effects);
|
ClassDB::bind_method(D_METHOD("set_effects", "effects"), &RichTextLabel::set_effects);
|
||||||
ClassDB::bind_method(D_METHOD("get_effects"), &RichTextLabel::get_effects);
|
ClassDB::bind_method(D_METHOD("get_effects"), &RichTextLabel::get_effects);
|
||||||
ClassDB::bind_method(D_METHOD("install_effect", "effect"), &RichTextLabel::install_effect);
|
ClassDB::bind_method(D_METHOD("install_effect", "effect"), &RichTextLabel::install_effect);
|
||||||
|
ClassDB::bind_method(D_METHOD("reload_effects"), &RichTextLabel::reload_effects);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_menu"), &RichTextLabel::get_menu);
|
ClassDB::bind_method(D_METHOD("get_menu"), &RichTextLabel::get_menu);
|
||||||
ClassDB::bind_method(D_METHOD("is_menu_visible"), &RichTextLabel::is_menu_visible);
|
ClassDB::bind_method(D_METHOD("is_menu_visible"), &RichTextLabel::is_menu_visible);
|
||||||
|
|
|
||||||
|
|
@ -881,6 +881,7 @@ public:
|
||||||
Array get_effects();
|
Array get_effects();
|
||||||
|
|
||||||
void install_effect(const Variant effect);
|
void install_effect(const Variant effect);
|
||||||
|
void reload_effects();
|
||||||
|
|
||||||
virtual Size2 get_minimum_size() const override;
|
virtual Size2 get_minimum_size() const override;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue