Add achievement system with unlock and UI popup functionality (#8)
This commit is contained in:
8
objects/achievement_manager.tscn
Normal file
8
objects/achievement_manager.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bjdhgdolcxxbq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c4vvuqnx5y33u" path="res://Autoloads/AchievementManager.cs" id="1_lomle"]
|
||||
[ext_resource type="PackedScene" uid="uid://tgaadui3lvdc" path="res://objects/ui/achievement_popup.tscn" id="2_k3wdv"]
|
||||
|
||||
[node name="AchievementManager" type="Node"]
|
||||
script = ExtResource("1_lomle")
|
||||
AchievementPopupScene = ExtResource("2_k3wdv")
|
@@ -1,6 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://rnpsa2u74nio"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://deguukal87gcb" path="res://scripts/achievements.gd" id="1_1itsx"]
|
||||
|
||||
[node name="Achievements" type="Node"]
|
||||
script = ExtResource("1_1itsx")
|
@@ -8,9 +8,12 @@
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yfu6m"]
|
||||
size = Vector2(28, 32)
|
||||
|
||||
[node name="ExitLevel" type="Area2D"]
|
||||
[node name="ExitLevel" type="Area2D" node_paths=PackedStringArray("DoorSprite")]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
script = ExtResource("4_06sog")
|
||||
DoorSprite = NodePath("Sprite2D")
|
||||
OpenedDoorFrame = 88
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -8)
|
||||
@@ -27,17 +30,8 @@ shape = SubResource("RectangleShape2D_yfu6m")
|
||||
[node name="RequirementComponent" type="Node" parent="."]
|
||||
script = ExtResource("2_ed7mh")
|
||||
RequirementType = 1
|
||||
metadata/_custom_type_script = "uid://cmh8k0rdsyh7j"
|
||||
|
||||
[node name="UnlockOnRequirementComponent" type="Node" parent="." node_paths=PackedStringArray("RequirementComponent", "UnlockTarget")]
|
||||
script = ExtResource("3_ed7mh")
|
||||
RequirementComponent = NodePath("../RequirementComponent")
|
||||
UnlockTarget = NodePath("../ExitDoorComponent")
|
||||
metadata/_custom_type_script = "uid://c8xhgkg8gcqu6"
|
||||
|
||||
[node name="ExitDoorComponent" type="Node" parent="." node_paths=PackedStringArray("ExitArea", "DoorSprite")]
|
||||
script = ExtResource("4_06sog")
|
||||
ExitArea = NodePath("..")
|
||||
DoorSprite = NodePath("../Sprite2D")
|
||||
OpenedDoorFrame = 88
|
||||
metadata/_custom_type_script = "uid://bwamqffvpa452"
|
||||
UnlockTarget = NodePath("..")
|
||||
|
@@ -1,6 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cyvcg2re4qifd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://f4y8evisxgnc" path="res://scripts/steam_integration.gd" id="1_ds8p3"]
|
||||
|
||||
[node name="SteamIntegration" type="Node"]
|
||||
script = ExtResource("1_ds8p3")
|
80
objects/ui/achievement_popup.tscn
Normal file
80
objects/ui/achievement_popup.tscn
Normal file
@@ -0,0 +1,80 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://tgaadui3lvdc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cejjan582nhfn" path="res://scripts/UI/AchievementPopup.cs" id="1_8pd1y"]
|
||||
[ext_resource type="Texture2D" uid="uid://cebeyr4wnibvk" path="res://sprites/achievement.png" id="2_1wq1d"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_enx8n"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="AchievementPopup" type="CanvasLayer" node_paths=PackedStringArray("TitleLabel", "DescriptionLabel", "IconRect")]
|
||||
script = ExtResource("1_8pd1y")
|
||||
TitleLabel = NodePath("Container/Panel/MarginContainer/VBoxContainer/Title")
|
||||
DescriptionLabel = NodePath("Container/Panel/MarginContainer/VBoxContainer/Description")
|
||||
IconRect = NodePath("Container/Panel/MarginContainer/VBoxContainer/TextureRect")
|
||||
metadata/_custom_type_script = "uid://cejjan582nhfn"
|
||||
|
||||
[node name="Container" type="Control" parent="."]
|
||||
custom_minimum_size = Vector2(200, 120)
|
||||
layout_mode = 3
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -200.0
|
||||
offset_top = -120.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Panel" type="Panel" parent="Container"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_enx8n")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Container/Panel"]
|
||||
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 = 4
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Container/Panel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Title" type="Label" parent="Container/Panel/MarginContainer/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(120, 30)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "saaaaaaaaaaaaaaaaaaa"
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="Description" type="Label" parent="Container/Panel/MarginContainer/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(120, 40)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.7, 0.7, 0.7, 1)
|
||||
text = "aaaaaaaaaaaaaaaaa"
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="Control" type="Control" parent="Container/Panel/MarginContainer/VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Container/Panel/MarginContainer/VBoxContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(128, 32)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
texture = ExtResource("2_1wq1d")
|
||||
expand_mode = 4
|
||||
stretch_mode = 5
|
Reference in New Issue
Block a user