WIP
This commit is contained in:
Generated
+1
@@ -0,0 +1 @@
|
||||
Babushka
|
||||
@@ -4,11 +4,12 @@ importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b3kyrsoobmkhp"
|
||||
valid=false
|
||||
path="res://.godot/imported/best_house_blender.blend-ac89c74aef2f275bdf4b4baadee17c0c.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/mockups/3d/best_house_blender.blend"
|
||||
dest_files=["res://.godot/imported/best_house_blender.blend-ac89c74aef2f275bdf4b4baadee17c0c.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
|
||||
@@ -1,10 +1,76 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cgjc4wurbgimy"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://cgjc4wurbgimy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hg7jay2kt441" path="res://scripts/CSharp/Common/Inventory/InventoryUi.cs" id="1_6wusm"]
|
||||
[ext_resource type="Texture2D" uid="uid://3ln8aleyxgp1" path="res://art/ui/UI/UI_bag_export_01.png" id="3_vvo7l"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcidjcsqk12p1" path="res://art/ui/UI/UI_bag_export_02.png" id="4_df8i8"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7wqla0mbu3np" path="res://art/ui/babushka_ui_tmp_inventory_select.png" id="4_tiss4"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0kmdjeqkqrwv" path="res://prefabs/UI/Inventory/Slot.tscn" id="5_u7kje"]
|
||||
[ext_resource type="Script" path="res://scripts/CSharp/Common/Quest/PupUpPostIt.cs" id="6_n5apg"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_tiss4"]
|
||||
font_size = 22
|
||||
font_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_tiss4"]
|
||||
resource_name = "NewPostit"
|
||||
length = 2.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 1.3, 1.8),
|
||||
"transitions": PackedFloat32Array(0.435277, 0.133972, 1.8025, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(-228, -400), Vector2(126, -400), Vector2(126, -400), Vector2(23, -161)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:scale")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 1.3, 1.8),
|
||||
"transitions": PackedFloat32Array(1, 1.8, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(0.7, 0.7)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n5apg"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(126, -353)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:scale")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_n5apg"]
|
||||
_data = {
|
||||
&"NewPostit": SubResource("Animation_tiss4"),
|
||||
&"RESET": SubResource("Animation_n5apg")
|
||||
}
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer"]
|
||||
layer = 90
|
||||
@@ -17,19 +83,19 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scale = Vector2(0.7, 0.7)
|
||||
script = ExtResource("1_6wusm")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="SlotsContainer" type="Control" parent="Inventory"]
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 13
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
grow_vertical = 0
|
||||
scale = Vector2(0.7, 0.7)
|
||||
|
||||
[node name="SlotSelectContainer" type="Control" parent="Inventory/SlotsContainer"]
|
||||
custom_minimum_size = Vector2(900, 100)
|
||||
@@ -365,3 +431,63 @@ offset_left = 703.0
|
||||
offset_top = 512.0
|
||||
offset_right = 803.0
|
||||
offset_bottom = 612.0
|
||||
|
||||
[node name="Messages" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="MessageContainer" type="Control" parent="Messages"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="PopUpPostIt" type="Control" parent="Messages/MessageContainer"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 126.0
|
||||
offset_top = -353.0
|
||||
offset_right = 326.0
|
||||
offset_bottom = -153.0
|
||||
grow_vertical = 0
|
||||
script = ExtResource("6_n5apg")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="Messages/MessageContainer/PopUpPostIt"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(1, 1, 0.447059, 1)
|
||||
|
||||
[node name="Text" type="Label" parent="Messages/MessageContainer/PopUpPostIt"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 10.0
|
||||
offset_top = 10.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -10.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Make me a Sandwitch, bitch"
|
||||
label_settings = SubResource("LabelSettings_tiss4")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Messages/MessageContainer/PopUpPostIt"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_n5apg")
|
||||
}
|
||||
|
||||
[connection signal="ready" from="Messages/MessageContainer/PopUpPostIt/AnimationPlayer" to="Messages/MessageContainer/PopUpPostIt/AnimationPlayer" method="play" binds= ["Fu"]]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=58 format=3 uid="uid://gigb28qk8t12"]
|
||||
[gd_scene load_steps=60 format=3 uid="uid://gigb28qk8t12"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/interactions/Player2D.tscn" id="1_7wfwe"]
|
||||
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
|
||||
@@ -35,6 +35,8 @@
|
||||
[ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/wateringcan.tres" id="28_ipqaa"]
|
||||
[ext_resource type="Resource" uid="uid://datee0flk1e84" path="res://resources/items/scythe.tres" id="29_wtdui"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="32_2nee2"]
|
||||
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="35_wtdui"]
|
||||
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test_01.tres" id="36_8ey8m"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xy0kg"]
|
||||
shader = ExtResource("13_7p0hq")
|
||||
@@ -914,6 +916,13 @@ shape = SubResource("RectangleShape2D_2nee2")
|
||||
position = Vector2(12955.5, 2960)
|
||||
shape = SubResource("RectangleShape2D_p6n74")
|
||||
|
||||
[node name="FirstQuestStarter" type="Node" parent="YSorted"]
|
||||
|
||||
[node name="QuestTrigger" type="Node" parent="YSorted/FirstQuestStarter"]
|
||||
script = ExtResource("35_wtdui")
|
||||
questResource = ExtResource("36_8ey8m")
|
||||
toStatus = 1
|
||||
|
||||
[node name="CanvasLayer" parent="." instance=ExtResource("32_2nee2")]
|
||||
follow_viewport_enabled = false
|
||||
|
||||
@@ -933,6 +942,7 @@ _inventoryOpenedOffset = -600.0
|
||||
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
|
||||
[connection signal="mouse_entered" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseEnteredAllowedArea"]
|
||||
[connection signal="mouse_exited" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
|
||||
[connection signal="ready" from="YSorted/FirstQuestStarter" to="YSorted/FirstQuestStarter/QuestTrigger" method="Trigger"]
|
||||
|
||||
[editable path="YSorted/Vesna"]
|
||||
[editable path="YSorted/Brünnen/InteractionArea"]
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.Common.Quest;
|
||||
|
||||
public partial class PopUpPostIt : Control
|
||||
{
|
||||
private Label Text => GetNode<Label>("Text");
|
||||
|
||||
private AnimationPlayer Animation => GetNode<AnimationPlayer>("AnimationPlayer");
|
||||
|
||||
QuestManager QM => QuestManager.Instance!;
|
||||
public override void _EnterTree()
|
||||
{
|
||||
QM.QuestBecomesActive += NewQuestPostIt;
|
||||
}
|
||||
|
||||
private void NewQuestPostIt(QuestResource questResource)
|
||||
{
|
||||
Text.Text = questResource.title;
|
||||
Animation.Play("NewPostit");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://byar6yqrlph6k
|
||||
@@ -8,7 +8,10 @@ namespace Babushka.scripts.CSharp.Common.Quest;
|
||||
using QuestPair = KeyValuePair<QuestResource, QuestStatus>;
|
||||
public partial class QuestManager : Node
|
||||
{
|
||||
public static QuestManager Instance { get; private set; }
|
||||
public static QuestManager? Instance { get; private set; }
|
||||
|
||||
[Signal]
|
||||
public delegate void QuestBecomesActiveEventHandler(QuestResource questResource);
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
@@ -27,6 +30,11 @@ public partial class QuestManager : Node
|
||||
}
|
||||
|
||||
value.status = newStatus;
|
||||
|
||||
if (newStatus == QuestStatus.Status.Active)
|
||||
{
|
||||
EmitSignalQuestBecomesActive(questResource);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<QuestPair> GetVisibleQuests()
|
||||
|
||||
@@ -5,13 +5,19 @@ using Babushka.scripts.CSharp.Common.Quest;
|
||||
public partial class QuestTrigger : Node
|
||||
{
|
||||
[Export]
|
||||
public QuestResource questResource;
|
||||
public QuestResource? questResource;
|
||||
|
||||
[Export]
|
||||
public QuestStatus.Status toStatus;
|
||||
|
||||
public void Trigger()
|
||||
{
|
||||
if(questResource== null)
|
||||
throw new Exception("QuestResource is not set on QuestTrigger node.");
|
||||
|
||||
if(QuestManager.Instance == null)
|
||||
throw new Exception("QuestManager instance is not available. Make sure it is initialized before calling Trigger.");
|
||||
|
||||
QuestManager.Instance.ChangeQuestStatus(questResource, toStatus);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user