trait lists
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 11s
Create tag and build when new code gets to main / Export (push) Successful in 1m32s

This commit is contained in:
2026-02-01 15:04:56 +01:00
parent 09a92bd148
commit d2290b009d
64 changed files with 676 additions and 58 deletions

View File

@@ -2,6 +2,17 @@ extends Area2D
class_name List
var current_item = 0
var mask_list: Array[MaskResource]
var guest_list: Array[CharacterResource]
var items: Array
var pref_score_name: Dictionary[CharacterResource.Preference, String] = {
CharacterResource.Preference.LOVE: "Loves ",
CharacterResource.Preference.APPROVE: "Likes ",
CharacterResource.Preference.DONT_CARE: "Doesn't care about ",
CharacterResource.Preference.DISAPPROVE: "Disapproves ",
CharacterResource.Preference.HATE: "Hates ",
}
@onready var label: Label = $Label
@@ -14,23 +25,38 @@ func _ready() -> void:
func _process(delta: float) -> void:
pass
func set_mask_list(items: Array[MaskResource]):
print(items)
func set_list(_items):
print(name)
for i in _items:
print(i.name)
current_item = 0
if items.size() == 0:
label.text = "..."
func set_chara_list(items: Array[CharacterResource]):
print(items)
current_item = 0
if items.size() == 0:
label.text = "..."
if _items.size() == 0:
items = []
label.text = "...\n...\n..."
return
items = _items
cycle_through_items()
func cycle_through_items() -> void:
if items.size() == 0:
label.text = "...\n...\n..."
return
current_item += 1
print(current_item)
var index = current_item % items.size()
var item = items.get(index)
if item is MaskResource:
label.text = "\n\n\n\n" + item.name + "\n\n" + item.description
elif item is CharacterResource:
label.text = item.name + "\n\nTraits\n"
for guest_trait: Trait in item.traits:
label.text += guest_trait.name + ", "
label.text += "\n\nPreferences\n"
for other_trait in item.preferences:
var pref = item.preferences[other_trait]
label.text += pref_score_name[pref] + other_trait.name + ", "
func _on_mouse_entered() -> void:

View File

@@ -14,14 +14,16 @@ shape = SubResource("CapsuleShape2D_trceg")
[node name="Label" type="Label" parent="." unique_id=1624172949]
z_index = 10
custom_minimum_size = Vector2(360, 0)
offset_left = -179.0
offset_top = -257.0
offset_right = 121.0
offset_bottom = -209.0
offset_left = -150.0
offset_top = -430.0
offset_right = 195.41
offset_bottom = -280.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_constants/line_spacing = 1
theme_override_font_sizes/font_size = 24
text = "..."
text = "...
...
..."
autowrap_mode = 3
[connection signal="input_event" from="." to="." method="_on_input_event"]