parent
01daddee3b
commit
27e137bc02
@ -0,0 +1,202 @@
|
|||||||
|
[gd_scene load_steps=7 format=3 uid="uid://c4ns2ixo8k2ih"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="1_opxcj"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://2q1n6g2kj5er" path="res://prefabs/UI/Quest/QuestLog.tscn" id="2_lj712"]
|
||||||
|
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="3_sx4ix"]
|
||||||
|
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test_01.tres" id="4_qyyck"]
|
||||||
|
[ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test_02.tres" id="5_sokiv"]
|
||||||
|
[ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test_03.tres" id="6_ajsa7"]
|
||||||
|
|
||||||
|
[node name="BabushkaTestsQuests" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="CanvasLayer" parent="." instance=ExtResource("1_opxcj")]
|
||||||
|
|
||||||
|
[node name="CanvasLayer2" type="CanvasLayer" parent="."]
|
||||||
|
layer = 128
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer2"]
|
||||||
|
offset_left = 71.0
|
||||||
|
offset_top = 53.0
|
||||||
|
offset_right = 571.0
|
||||||
|
offset_bottom = 353.0
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer2/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
|
text = "Quest 1"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
[node name="Active" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Active"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Active"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("4_qyyck")
|
||||||
|
toStatus = 1
|
||||||
|
makeCurrent = true
|
||||||
|
|
||||||
|
[node name="Done" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Done"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Done"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("4_qyyck")
|
||||||
|
toStatus = 2
|
||||||
|
|
||||||
|
[node name="Cancle" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Cancle"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Cancle"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("4_qyyck")
|
||||||
|
toStatus = 3
|
||||||
|
|
||||||
|
[node name="Hide" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Hide
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer/Hide"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("4_qyyck")
|
||||||
|
|
||||||
|
[node name="HBoxContainer2" type="HBoxContainer" parent="CanvasLayer2/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
|
text = "Quest 2"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
[node name="Active" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Active"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Active"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("5_sokiv")
|
||||||
|
toStatus = 1
|
||||||
|
|
||||||
|
[node name="Done" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Done"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Done"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("5_sokiv")
|
||||||
|
toStatus = 2
|
||||||
|
|
||||||
|
[node name="Cancle" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Cancle"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Cancle"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("5_sokiv")
|
||||||
|
toStatus = 3
|
||||||
|
|
||||||
|
[node name="Hide" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Hide
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer2/Hide"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("5_sokiv")
|
||||||
|
|
||||||
|
[node name="HBoxContainer3" type="HBoxContainer" parent="CanvasLayer2/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 1
|
||||||
|
text = "Quest 3"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
[node name="Active" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Active"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Active"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("6_ajsa7")
|
||||||
|
toStatus = 1
|
||||||
|
|
||||||
|
[node name="Done" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Done"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Done"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("6_ajsa7")
|
||||||
|
toStatus = 2
|
||||||
|
|
||||||
|
[node name="Cancle" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Cancle"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Cancle"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("6_ajsa7")
|
||||||
|
toStatus = 3
|
||||||
|
|
||||||
|
[node name="Hide" type="Button" parent="CanvasLayer2/VBoxContainer/HBoxContainer3"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
text = "Hide
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="QuestSetter" type="Node" parent="CanvasLayer2/VBoxContainer/HBoxContainer3/Hide"]
|
||||||
|
script = ExtResource("3_sx4ix")
|
||||||
|
questResource = ExtResource("6_ajsa7")
|
||||||
|
|
||||||
|
[node name="QuestLog" parent="CanvasLayer2" instance=ExtResource("2_lj712")]
|
||||||
|
offset_left = 625.0
|
||||||
|
offset_top = 294.0
|
||||||
|
offset_right = -595.0
|
||||||
|
offset_bottom = -286.0
|
||||||
|
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Active" to="CanvasLayer2/VBoxContainer/HBoxContainer/Active/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Done" to="CanvasLayer2/VBoxContainer/HBoxContainer/Done/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Cancle" to="CanvasLayer2/VBoxContainer/HBoxContainer/Cancle/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer/Hide" to="CanvasLayer2/VBoxContainer/HBoxContainer/Hide/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Active" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Active/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Done" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Done/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Cancle" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Cancle/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer2/Hide" to="CanvasLayer2/VBoxContainer/HBoxContainer2/Hide/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Active" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Active/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Done" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Done/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Cancle" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Cancle/QuestSetter" method="Trigger"]
|
||||||
|
[connection signal="pressed" from="CanvasLayer2/VBoxContainer/HBoxContainer3/Hide" to="CanvasLayer2/VBoxContainer/HBoxContainer3/Hide/QuestSetter" method="Trigger"]
|
||||||
|
|
||||||
|
[editable path="CanvasLayer"]
|
||||||
@ -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
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using System.Net.Mime;
|
||||||
|
using Babushka.scripts.CSharp.Common.Quest;
|
||||||
|
|
||||||
|
public partial class QuestMessagePopup : Control
|
||||||
|
{
|
||||||
|
|
||||||
|
private Label Text => GetNode<Label>("Text");
|
||||||
|
|
||||||
|
private QuestResource? _currentlyShown;
|
||||||
|
|
||||||
|
private Tween? _activeTween = null;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
private Vector2 _showPosition;
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
private Vector2 _hidePosition;
|
||||||
|
|
||||||
|
public override void _EnterTree()
|
||||||
|
{
|
||||||
|
QuestManager.Instance!.QuestsChanged += NewActiveQuest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void _ExitTree()
|
||||||
|
{
|
||||||
|
QuestManager.Instance!.QuestsChanged -= NewActiveQuest;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NewActiveQuest()
|
||||||
|
{
|
||||||
|
GD.Print("NewActiveQuest");
|
||||||
|
|
||||||
|
var shownQuest = QuestManager.Instance!.GetFollowQuest();
|
||||||
|
if (_currentlyShown == shownQuest)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_activeTween != null)
|
||||||
|
{
|
||||||
|
_activeTween.Kill();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shownQuest == null)
|
||||||
|
{
|
||||||
|
HideAnimate();
|
||||||
|
_currentlyShown = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_currentlyShown == null)
|
||||||
|
{
|
||||||
|
Text.Text = shownQuest.title;
|
||||||
|
ShowAnimate();
|
||||||
|
_currentlyShown = shownQuest;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// else (_currentlyShown != null)
|
||||||
|
|
||||||
|
_currentlyShown = shownQuest;
|
||||||
|
HideAnimate(() =>
|
||||||
|
{
|
||||||
|
Text.Text = shownQuest.title;
|
||||||
|
ShowAnimate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HideAnimate(Action? then = null)
|
||||||
|
{
|
||||||
|
_activeTween = GetTree().CreateTween();
|
||||||
|
_activeTween.TweenProperty(this, "position", _hidePosition, 0.4)
|
||||||
|
.SetTrans(Tween.TransitionType.Cubic)
|
||||||
|
.SetEase(Tween.EaseType.Out);
|
||||||
|
if (then != null)
|
||||||
|
_activeTween.Finished += then;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowAnimate(Action? then = null)
|
||||||
|
{
|
||||||
|
_activeTween = GetTree().CreateTween();
|
||||||
|
_activeTween.TweenProperty(this, "position", _showPosition, 0.4)
|
||||||
|
.SetTrans(Tween.TransitionType.Cubic)
|
||||||
|
.SetEase(Tween.EaseType.Out);
|
||||||
|
if (then != null)
|
||||||
|
_activeTween.Finished += then;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
uid://7wwid23tc8as
|
||||||
Loading…
Reference in new issue