diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index a6d862774..9430a7f0f 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2738,8 +2738,17 @@ void RichTextLabel::set_use_bbcode(bool p_enable) { if (use_bbcode == p_enable) { return; } + + if (p_enable) { + cached_text = get_text(); + } + use_bbcode = p_enable; set_bbcode(bbcode); + + if (!p_enable) { + set_text(cached_text); + } property_list_changed_notify(); } diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 983fc2bba..54657c8ba 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -410,6 +410,7 @@ private: bool use_bbcode; String bbcode; + String cached_text; int fixed_width;