feat: 添加升级卡和样式
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
[gd_scene format=3 uid="uid://cexaxg5jj2ljl"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mkexl"]
|
||||
bg_color = Color(0.3882353, 0.3882353, 0.3882353, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p145h"]
|
||||
bg_color = Color(0.09411765, 0.62352943, 0.74509805, 1)
|
||||
corner_radius_top_left = 12
|
||||
corner_radius_top_right = 12
|
||||
corner_radius_bottom_right = 12
|
||||
corner_radius_bottom_left = 12
|
||||
|
||||
[node name="CustomButton" type="Button" unique_id=667533022]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -32.5
|
||||
offset_top = -28.0
|
||||
offset_right = 32.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme_override_font_sizes/font_size = 48
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_mkexl")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_p145h")
|
||||
text = "select"
|
||||
@@ -7,6 +7,7 @@ class_name StatsContainer
|
||||
@onready var damage_label: Label = %DamageLabel
|
||||
@onready var luck_label: Label = %LuckLabel
|
||||
@onready var speed_label: Label = %SpeedLabel
|
||||
@onready var block_label: Label = %BlockLabel
|
||||
@onready var harvesting_label: Label = %HarvestingLabel
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
@@ -16,4 +17,14 @@ func _ready() -> void:
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
if not is_instance_valid(Global.player):
|
||||
return
|
||||
|
||||
health_label.text = str(Global.player.stats.health)
|
||||
hp_regen_label.text = str(Global.player.stats.hp_regen)
|
||||
life_steal_label.text = str(Global.player.stats.life_steal) + "%"
|
||||
damage_label.text = str(Global.player.stats.damage)
|
||||
luck_label.text = str(Global.player.stats.luck)
|
||||
speed_label.text = str(Global.player.stats.speed)
|
||||
block_label.text = str(Global.player.stats.block_chance) + "%"
|
||||
harvesting_label.text = str(Global.player.stats.harvesting)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
extends Panel
|
||||
class_name UpgradeCard
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
uid://yarrkdmu5xcl
|
||||
@@ -0,0 +1,65 @@
|
||||
[gd_scene format=3 uid="uid://bfohai4xgom8w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://yarrkdmu5xcl" path="res://scenes/ui/upgrade_card/upgrade_card.gd" id="1_7erta"]
|
||||
[ext_resource type="StyleBox" uid="uid://dt8ypn0hibm80" path="res://styles/common_style.tres" id="1_v41mk"]
|
||||
[ext_resource type="Texture2D" uid="uid://dn68qq5evmvwa" path="res://assets/sprites/Upgrades/12.png" id="2_mkexl"]
|
||||
[ext_resource type="PackedScene" uid="uid://cexaxg5jj2ljl" path="res://scenes/ui/custom_button/custom_button.tscn" id="4_kjnsj"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_mkexl"]
|
||||
font_size = 28
|
||||
|
||||
[node name="UpgradeCard" type="Panel" unique_id=816521847]
|
||||
custom_minimum_size = Vector2(300, 200)
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
theme_override_styles/panel = ExtResource("1_v41mk")
|
||||
script = ExtResource("1_7erta")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=458128927]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer" unique_id=1979281248]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="MarginContainer/Control" unique_id=1868739971]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = ExtResource("2_mkexl")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Name" type="Label" parent="MarginContainer/Control" unique_id=1952735558]
|
||||
layout_mode = 0
|
||||
offset_left = 100.0
|
||||
offset_top = 10.0
|
||||
offset_right = 277.0
|
||||
offset_bottom = 48.666668
|
||||
text = "damage"
|
||||
label_settings = SubResource("LabelSettings_mkexl")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Description" type="Label" parent="MarginContainer/Control" unique_id=1620881988]
|
||||
modulate = Color(0.827451, 0.9098039, 0.17254902, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 100.0
|
||||
offset_top = 55.0
|
||||
offset_right = 277.0
|
||||
offset_bottom = 93.66667
|
||||
text = "+1"
|
||||
label_settings = SubResource("LabelSettings_mkexl")
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CustomButton" parent="MarginContainer/Control" unique_id=667533022 instance=ExtResource("4_kjnsj")]
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
Reference in New Issue
Block a user