slight gameplay changes and new ui

This commit is contained in:
2025-07-21 05:56:11 +10:00
parent d2dc74d533
commit a452bbb406
53 changed files with 538 additions and 245 deletions

View File

@@ -4,15 +4,18 @@ extends Control
@export var icon: TextureRect
@export var tags: VBoxContainer
@export var cost_label: Label
@export var lifetime_label: Label
@export var unselected_style_box: StyleBoxFlat
@export var selected_style_box: StyleBoxFlat
@export var amount_label: Label
func set_amount(num: int) -> void:
amount_label.text = "x" + str(num)
func set_card(card: Card) -> void:
icon.texture = card.icon
cost_label.text = str(card.rarity + 1)
lifetime_label.text = str(card.duration)
cost_label.text = str(card.cost)
for i: int in tags.get_child_count():
tags.get_child(i).queue_free()
for tag: Data.CardTags in card.tags:

View File

@@ -6,17 +6,17 @@
[ext_resource type="StyleBox" uid="uid://csbgndc6vfayf" path="res://UI/CardSelectionBox/selected_style_box.tres" id="2_ek0dh"]
[ext_resource type="Texture2D" uid="uid://bpcyxdpog3w85" path="res://Assets/Textures/assault_icon.png" id="2_m0g3h"]
[node name="Control" type="Control" node_paths=PackedStringArray("icon", "tags", "cost_label", "lifetime_label")]
[node name="Control" type="Control" node_paths=PackedStringArray("icon", "tags", "cost_label", "amount_label")]
custom_minimum_size = Vector2(170, 0)
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_m0g3h")
icon = NodePath("PanelContainer/HBoxContainer/Icon")
tags = NodePath("PanelContainer/HBoxContainer/MarginContainer/Tags")
cost_label = NodePath("PanelContainer/HBoxContainer/Stats/Cost")
lifetime_label = NodePath("PanelContainer/HBoxContainer/Stats/Lifetime")
icon = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Icon")
tags = NodePath("PanelContainer/VBoxContainer/HBoxContainer/MarginContainer/Tags")
cost_label = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Stats/Cost")
unselected_style_box = ExtResource("2_0817q")
selected_style_box = ExtResource("2_ek0dh")
amount_label = NodePath("PanelContainer/VBoxContainer/Label")
[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 2
@@ -24,45 +24,49 @@ offset_right = 152.0
offset_bottom = 124.0
theme_override_styles/panel = ExtResource("2_ek0dh")
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/HBoxContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_top = 10
theme_override_constants/margin_bottom = 10
[node name="Tags" type="VBoxContainer" parent="PanelContainer/HBoxContainer/MarginContainer"]
[node name="Tags" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer/MarginContainer"]
layout_mode = 2
[node name="Icon2" type="TextureRect" parent="PanelContainer/HBoxContainer/MarginContainer/Tags"]
[node name="Icon2" type="TextureRect" parent="PanelContainer/VBoxContainer/HBoxContainer/MarginContainer/Tags"]
layout_mode = 2
size_flags_horizontal = 3
texture = ExtResource("1_k8442")
stretch_mode = 5
[node name="Icon" type="TextureRect" parent="PanelContainer/HBoxContainer"]
[node name="Icon" type="TextureRect" parent="PanelContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
texture = ExtResource("2_m0g3h")
stretch_mode = 5
[node name="Stats" type="VBoxContainer" parent="PanelContainer/HBoxContainer"]
[node name="Stats" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Cost" type="Label" parent="PanelContainer/HBoxContainer/Stats"]
[node name="Cost" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer/Stats"]
layout_mode = 2
size_flags_vertical = 7
text = "3"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Lifetime" type="Label" parent="PanelContainer/HBoxContainer/Stats"]
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 7
text = "6"
size_flags_vertical = 8
text = "x2"
horizontal_alignment = 1
vertical_alignment = 1

View File

@@ -119,6 +119,8 @@ func gain_energy(energy_gained: float, energy_type: Data.EnergyType = Data.Energ
energy += energy_gained
progress_bar.value = energy
big_progress_bar.value = energy
#TODO: Theres a bug here that should be fixed by making the discrete and continuous bars
#into a different ui element which i think i wanna do anyway
if energy_type == Data.EnergyType.DISCRETE and int(energy) > prev_energy_int:
cell_icons[int(energy) - 1].visible = true
prev_energy_int = int(energy)

View File

@@ -1,5 +1,6 @@
[gd_resource type="Theme" load_steps=16 format=3 uid="uid://b6a0ip4p72tgx"]
[gd_resource type="Theme" load_steps=17 format=3 uid="uid://b6a0ip4p72tgx"]
[ext_resource type="FontFile" uid="uid://bqy8dm2o3piqm" path="res://Assets/Fonts/Quaver v1.0/quaver.ttf" id="2_i4k6b"]
[ext_resource type="StyleBox" uid="uid://lpof3jdy7hr7" path="res://UI/new_style_box_flat.tres" id="4_o03gw"]
[ext_resource type="FontFile" uid="uid://c17ml15e2qan0" path="res://Assets/Fonts/TrueType (.ttf)/Sagewold-Regular.ttf" id="4_v3wda"]
@@ -97,6 +98,9 @@ CheckButton/styles/hover = SubResource("StyleBoxEmpty_v4c6d")
CheckButton/styles/hover_pressed = SubResource("StyleBoxEmpty_pdxi3")
CheckButton/styles/normal = SubResource("StyleBoxEmpty_8epi8")
CheckButton/styles/pressed = SubResource("StyleBoxEmpty_o02xp")
DamageNumLabel/base_type = &"Label"
DamageNumLabel/font_sizes/font_size = 8
DamageNumLabel/fonts/font = ExtResource("2_i4k6b")
HBoxContainer/constants/separation = 10
Label/colors/font_color = Color(0.941129, 0.938917, 0.927802, 1)
Label/font_sizes/font_size = 34
@@ -108,6 +112,7 @@ LineEdit/fonts/font = ExtResource("4_v3wda")
LineEdit/styles/focus = SubResource("StyleBoxFlat_s5vy1")
LineEdit/styles/normal = SubResource("StyleBoxFlat_s5vy1")
PanelContainer/styles/panel = ExtResource("4_o03gw")
StartWaveLabel/base_type = &"Label"
TabBar/fonts/font = ExtResource("4_v3wda")
TabContainer/colors/font_hovered_color = Color(0.894118, 0.890196, 0.870588, 1)
TabContainer/colors/font_selected_color = Color(0.895148, 0.891833, 0.869117, 1)
@@ -120,3 +125,6 @@ TabContainer/styles/tab_focus = SubResource("StyleBoxFlat_ehga6")
TabContainer/styles/tab_hovered = SubResource("StyleBoxFlat_tuxkj")
TabContainer/styles/tab_selected = SubResource("StyleBoxFlat_ehga6")
TabContainer/styles/tab_unselected = SubResource("StyleBoxFlat_tuxkj")
VersionLabel/base_type = &"Label"
VersionLabel/colors/font_color = Color(0.85, 0.85, 0.85, 0.7)
VersionLabel/font_sizes/font_size = 16

9
UI/psx_ui.tres Normal file
View File

@@ -0,0 +1,9 @@
[gd_resource type="Theme" format=3 uid="uid://jn4qqx5hxc5i"]
[resource]
Button/font_sizes/font_size = 8
InteractLabel/base_type = &"Label"
StartWaveLabel/base_type = &"Label"
VersionLabel/base_type = &"Label"
VersionLabel/colors/font_color = Color(0.85, 0.85, 0.85, 0.7)
VersionLabel/font_sizes/font_size = 8