2 class_name DatingProfileControl
6 static var _details_format_str: String = "[b]%s[/b] [font_size=45]%s[/font_size]"
7 static var _bullet_format_str: String = "• %s"
8 static var _distance_format_str: String = "%s miles away"
11 @export var profile: DatingProfile:
14 profile.changed.disconnect(_on_profile_changed)
16 profile.changed.connect(_on_profile_changed)
20 func _on_profile_changed():
21 # TODO: why aren't these unique names instantiated at the start?
22 if get_node_or_null("%details") == null:
31 %pic.texture = profile.pic
32 var details: Array[String] = []
33 details.append(_details_format_str % [profile.name, profile.age])
34 for detail: String in [profile.job, profile.education]:
35 if not detail.is_empty():
36 details.append(_bullet_format_str % detail)
37 details.append(_bullet_format_str % (_distance_format_str % profile.distance_away))
38 %details.text = "\n".join(details)
39 %blurb.text = profile.bio