Added possibility to deactivate an interactionarea if there is no more timelines to play
This commit is contained in:
@@ -11,4 +11,4 @@ ifquest res://resources/quests/demo/2_collect_ducks.tres, 1:
|
||||
join Yeli right
|
||||
Yeli: Have you collected all the ducks yet?
|
||||
[end_timeline]
|
||||
No dialogue for active quest "{ACTIVEQUEST}"
|
||||
Yeli doesn't seem to have anything to say...
|
||||
|
||||
@@ -224,6 +224,7 @@ scale = Vector2(0.7, 0.7)
|
||||
script = ExtResource("44_aqu1t")
|
||||
itemToToggle = NodePath("../TalkingControl/AnimatedSprite")
|
||||
|
||||
[connection signal="FinishedTalking" from="." to="InteractionArea" method="SetActiveInverse"]
|
||||
[connection signal="Talking" from="." to="Dialogic starter" method="open"]
|
||||
[connection signal="Interacted" from="InteractionArea" to="." method="ToggleTalking"]
|
||||
[connection signal="timelineEnded" from="DialogicToggle" to="." method="ToggleTalking"]
|
||||
|
||||
@@ -26,6 +26,10 @@ public partial class InteractionArea2D : Node2D
|
||||
set => _active = value;
|
||||
}
|
||||
|
||||
public void SetActiveInverse(bool active)
|
||||
{
|
||||
IsActive = !active;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ public partial class TalkingCharacter : Node2D
|
||||
private int _timelineIndex = 0;
|
||||
|
||||
[Signal] public delegate void TalkingEventHandler(string timelineName);
|
||||
[Signal] public delegate void FinishedTalkingEventHandler(bool hasTimeLinesToPlay);
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -37,5 +38,7 @@ public partial class TalkingCharacter : Node2D
|
||||
}
|
||||
if (_sprite != null)
|
||||
_sprite.Play();
|
||||
|
||||
EmitSignal(SignalName.FinishedTalking, _timelineIndex >= _timelinesToPlay.Length);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user