Compare commits

2 Commits

Author SHA1 Message Date
1a5372f713 makes the tooltip expand to fit text if its long 2025-04-29 12:39:09 -04:00
c125d1b70a fixes missing merge conflict 2025-04-29 07:04:15 -04:00
2 changed files with 2 additions and 18 deletions

View File

@ -19,25 +19,9 @@ func _set_tip_text(card_info: Dictionary, _card_image: Image) -> void:
text = "[b]" + card_info["name"] + "[/b]\t"
text += _convert_text_to_symbol(card_info["cost"]) + "\n"
text += "[i]" + card_info["type"] + "[/i]\n"
<<<<<<< HEAD
text += _convert_text_to_symbol(card_info["desc"])
=======
var oracle_text = card_info["desc"]
var last_idx = 0
for symbol in mana_symbols:
last_idx = 0
while oracle_text.find(symbol, last_idx) != -1:
oracle_text = oracle_text.replace(
symbol, '[img width="16" height="16"]' + mana_symbols[symbol] + "[/img]"
)
last_idx = oracle_text.find(symbol, last_idx) + symbol.length()
text += oracle_text
>>>>>>> 76a23aab5c62c7ff138d393c5f5fedd6cd6c7a46
func _clear_tip_text() -> void:
text = ""
@ -51,7 +35,5 @@ func _ready() -> void:
mana_symbols = JSON.parse_string(file.get_as_text())
file.close()
set_use_bbcode(true)
EventBus.connect("card_on_hover", _set_tip_text)
EventBus.connect("card_on_unhover", _clear_tip_text)

View File

@ -50,6 +50,8 @@ script = ExtResource("2_pqag1")
[node name="RichTextLabel" type="RichTextLabel" parent="UI/BigBar/Items/MenuArea/VBoxContainer"]
custom_minimum_size = Vector2(0, 230)
layout_mode = 2
bbcode_enabled = true
fit_content = true
script = ExtResource("2_d43bn")
[node name="ChatArea" type="PanelContainer" parent="UI/BigBar/Items"]