Refactor HUD and marketplace layout for improved responsiveness and usability
This commit is contained in:
@@ -32,7 +32,6 @@ health_progressbar = NodePath("Panel/PanelContainer/ProgressBar")
|
||||
lives_label = NodePath("Panel/PanelContainer/Lives")
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
custom_minimum_size = Vector2(0, 16)
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
@@ -42,10 +41,11 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_aa3sf")
|
||||
|
||||
[node name="PanelContainer" type="HBoxContainer" parent="Panel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 16.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="Health Label" type="Label" parent="Panel/PanelContainer"]
|
||||
|
@@ -55,4 +55,4 @@ layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/h_separation = 8
|
||||
theme_override_constants/v_separation = 8
|
||||
columns = 3
|
||||
columns = 2
|
||||
|
@@ -482,13 +482,8 @@ position = Vector2(877, -577)
|
||||
[node name="HUD" parent="CanvasLayer" instance=ExtResource("1_gbpkv")]
|
||||
|
||||
[node name="Marketplace" parent="CanvasLayer" node_paths=PackedStringArray("root", "skill_unlocker") instance=ExtResource("20_ss8k0")]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(480, 240)
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_top = 16.0
|
||||
root = NodePath(".")
|
||||
skill_unlocker = NodePath("../../Brick Player/SkillUnlockerComponent")
|
||||
|
||||
|
@@ -38,10 +38,11 @@ func create_upgrade_button(skill: SkillData):
|
||||
button.text = skill.name + " " + str(skill.cost)
|
||||
button.flat = true
|
||||
button.icon = skill.icon
|
||||
|
||||
|
||||
button.pressed.connect(func () -> void: _on_button_pressed(skill))
|
||||
|
||||
grid.add_child(button)
|
||||
grid.queue_sort()
|
||||
|
||||
|
||||
func remove_button(skill: SkillData):
|
||||
@@ -58,4 +59,4 @@ func _on_button_pressed(skill: SkillData) -> void:
|
||||
if skill_unlocker.try_unlock_skill(skill):
|
||||
print("Skill unlocked: ", skill.name)
|
||||
remove_button(skill)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user