Randoloot/scripts/planets/research_skill_button.gd
2026-10-19 22:33:24 +02:00

17 lines
617 B
GDScript

extends Button
const MENU := preload("res://scripts/planets/freighter_menu.gd")
func _make_custom_tooltip(for_text: String) -> Object:
var panel := PanelContainer.new()
MENU.style(panel, 10, 0.98)
panel.custom_minimum_size.x = 260
var stack := VBoxContainer.new()
stack.add_theme_constant_override("separation", 5)
panel.add_child(stack)
var lines := for_text.split("\n")
for i in range(lines.size()):
var label := MENU.label(stack, lines[i], 14 if i == 0 else 13, MENU.GOLD if i == 0 else MENU.TEXT)
label.custom_minimum_size.x = 240
label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
return panel