Added weapon description for weapon selection screen

This commit is contained in:
2025-12-18 18:01:57 +03:00
parent 844344fef2
commit 6fdc3dc894
12 changed files with 57 additions and 2 deletions
+3 -1
View File
@@ -9,8 +9,9 @@ signal weapon_selected(weapon_data: WeaponData)
set = _set_weapon_data
@onready var name_label : Label = $%NameLabel
@onready var button : Button = $%Button
@onready var name_label : Label = $%NameLabel
@onready var description_label : Label = $%DescriptionLabel
func _set_weapon_data(data: WeaponData) -> void:
@@ -19,6 +20,7 @@ func _set_weapon_data(data: WeaponData) -> void:
if weapon_data == null: return
name_label.text = weapon_data.name
description_label.text = weapon_data.description
func _on_button_pressed() -> void:
+15 -1
View File
@@ -9,6 +9,10 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
script = ExtResource("1_4acia")
[node name="Button" type="Button" parent="."]
@@ -23,10 +27,20 @@ theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="NameLabel" type="Label" parent="MarginContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2
[node name="NameLabel" type="Label" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_g83h6")
horizontal_alignment = 1
[node name="DescriptionLabel" type="Label" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(160, 0)
layout_mode = 2
theme_override_font_sizes/font_size = 8
horizontal_alignment = 1
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]