diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-20 18:51:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-20 18:51:15 +0200 |
commit | 953de68cfc3e157ce7136081140317a2c946fa97 (patch) | |
tree | 368d6c77b90390176c3bf328a4f3cce5b9f5219a /scene/gui/rich_text_label.h | |
parent | 50a0a401a10dda9718169d690b4b941100eb4a2c (diff) | |
parent | 0c1d10d1ca9bbc7126f270b111a0a25cc45bd84d (diff) |
Merge pull request #35608 from golfinq/master
Diffstat (limited to 'scene/gui/rich_text_label.h')
-rw-r--r-- | scene/gui/rich_text_label.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index ae2a4af268..999d8b05fd 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -75,6 +75,8 @@ public: ITEM_WAVE, ITEM_TORNADO, ITEM_RAINBOW, + ITEM_BGCOLOR, + ITEM_FGCOLOR, ITEM_META, ITEM_DROPCAP, ITEM_CUSTOMFX @@ -307,6 +309,16 @@ private: ItemRainbow() { type = ITEM_RAINBOW; } }; + struct ItemBGColor : public Item { + Color color; + ItemBGColor() { type = ITEM_BGCOLOR; } + }; + + struct ItemFGColor : public Item { + Color color; + ItemFGColor() { type = ITEM_FGCOLOR; } + }; + struct ItemCustomFX : public ItemFX { Ref<CharFXTransform> char_fx_transform; Ref<RichTextEffect> custom_effect; @@ -422,6 +434,8 @@ private: bool _find_underline(Item *p_item); bool _find_strikethrough(Item *p_item); bool _find_meta(Item *p_item, Variant *r_meta, ItemMeta **r_item = nullptr); + Color _find_bgcolor(Item *p_item); + Color _find_fgcolor(Item *p_item); bool _find_layout_subitem(Item *from, Item *to); void _fetch_item_fx_stack(Item *p_item, Vector<ItemFX *> &r_stack); @@ -437,6 +451,8 @@ private: Ref<RichTextEffect> _get_custom_effect_by_code(String p_bbcode_identifier); virtual Dictionary parse_expressions_for_values(Vector<String> p_expressions); + void _draw_fbg_boxes(RID p_ci, RID p_rid, Vector2 line_off, Item *it_from, Item *it_to, int start, int end, int fbg_flag); + bool use_bbcode = false; String bbcode; @@ -474,6 +490,8 @@ public: void push_wave(float p_frequency, float p_amplitude); void push_tornado(float p_frequency, float p_radius); void push_rainbow(float p_saturation, float p_value, float p_frequency); + void push_bgcolor(const Color &p_color); + void push_fgcolor(const Color &p_color); void push_customfx(Ref<RichTextEffect> p_custom_effect, Dictionary p_environment); void set_table_column_expand(int p_column, bool p_expand, int p_ratio = 1); void set_cell_row_background_color(const Color &p_odd_row_bg, const Color &p_even_row_bg); |