2
0
Эх сурвалжийг харах

Merge pull request #71983 from vmedea/push-customfx

Expose RichTextLabel::push_customfx to GDScript
Rémi Verschelde 2 жил өмнө
parent
commit
8cebd0a2ce

+ 8 - 0
doc/classes/RichTextLabel.xml

@@ -251,6 +251,14 @@
 				Adds a [code][color][/code] tag to the tag stack.
 				Adds a [code][color][/code] tag to the tag stack.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="push_customfx">
+			<return type="void" />
+			<param index="0" name="effect" type="RichTextEffect" />
+			<param index="1" name="env" type="Dictionary" />
+			<description>
+				Adds a custom effect tag to the tag stack. The effect does not need to be in [member custom_effects]. The environment is directly passed to the effect.
+			</description>
+		</method>
 		<method name="push_dropcap">
 		<method name="push_dropcap">
 			<return type="void" />
 			<return type="void" />
 			<param index="0" name="string" type="String" />
 			<param index="0" name="string" type="String" />

+ 3 - 1
scene/gui/rich_text_label.cpp

@@ -3435,6 +3435,8 @@ void RichTextLabel::push_customfx(Ref<RichTextEffect> p_custom_effect, Dictionar
 	item->custom_effect = p_custom_effect;
 	item->custom_effect = p_custom_effect;
 	item->char_fx_transform->environment = p_environment;
 	item->char_fx_transform->environment = p_environment;
 	_add_item(item, true);
 	_add_item(item, true);
+
+	set_process_internal(true);
 }
 }
 
 
 void RichTextLabel::set_table_column_expand(int p_column, bool p_expand, int p_ratio) {
 void RichTextLabel::set_table_column_expand(int p_column, bool p_expand, int p_ratio) {
@@ -4552,7 +4554,6 @@ void RichTextLabel::append_text(const String &p_bbcode) {
 					push_customfx(effect, properties);
 					push_customfx(effect, properties);
 					pos = brk_end + 1;
 					pos = brk_end + 1;
 					tag_stack.push_front(identifier);
 					tag_stack.push_front(identifier);
-					set_process_internal(true);
 				} else {
 				} else {
 					add_text("["); //ignore
 					add_text("["); //ignore
 					pos = brk_pos + 1;
 					pos = brk_pos + 1;
@@ -5346,6 +5347,7 @@ void RichTextLabel::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("push_cell"), &RichTextLabel::push_cell);
 	ClassDB::bind_method(D_METHOD("push_cell"), &RichTextLabel::push_cell);
 	ClassDB::bind_method(D_METHOD("push_fgcolor", "fgcolor"), &RichTextLabel::push_fgcolor);
 	ClassDB::bind_method(D_METHOD("push_fgcolor", "fgcolor"), &RichTextLabel::push_fgcolor);
 	ClassDB::bind_method(D_METHOD("push_bgcolor", "bgcolor"), &RichTextLabel::push_bgcolor);
 	ClassDB::bind_method(D_METHOD("push_bgcolor", "bgcolor"), &RichTextLabel::push_bgcolor);
+	ClassDB::bind_method(D_METHOD("push_customfx", "effect", "env"), &RichTextLabel::push_customfx);
 	ClassDB::bind_method(D_METHOD("pop"), &RichTextLabel::pop);
 	ClassDB::bind_method(D_METHOD("pop"), &RichTextLabel::pop);
 
 
 	ClassDB::bind_method(D_METHOD("clear"), &RichTextLabel::clear);
 	ClassDB::bind_method(D_METHOD("clear"), &RichTextLabel::clear);