Browse Source

[RTL] Add support for character code bb tag.

bruvzg 1 year ago
parent
commit
524a20f460
1 changed files with 4 additions and 0 deletions
  1. 4 0
      scene/gui/rich_text_label.cpp

+ 4 - 0
scene/gui/rich_text_label.cpp

@@ -4410,6 +4410,10 @@ void RichTextLabel::append_text(const String &p_bbcode) {
 			push_strikethrough();
 			pos = brk_end + 1;
 			tag_stack.push_front(tag);
+		} else if (tag.begins_with("char=")) {
+			int32_t char_code = tag.substr(5, tag.length()).hex_to_int();
+			add_text(String::chr(char_code));
+			pos = brk_end + 1;
 		} else if (tag == "lb") {
 			add_text("[");
 			pos = brk_end + 1;