Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ debug_color = Color(0.6, 0.545, 0, 0.42)
[node name="TalkBehavior" type="Node" parent="OnTheGround/Townie" unique_id=380572308 node_paths=PackedStringArray("interact_area")]
script = ExtResource("4_qr3fq")
dialogue = ExtResource("8_qr3fq")
title = "townie_1"
cue = "townie_1"
interact_area = NodePath("../InteractArea")

[node name="Timer" type="Timer" parent="OnTheGround/Townie" unique_id=1124507387]
Expand Down Expand Up @@ -100,7 +100,7 @@ debug_color = Color(0.6, 0.545, 0, 0.42)
[node name="TalkBehavior" type="Node" parent="OnTheGround/Townie2" unique_id=1614392770 node_paths=PackedStringArray("interact_area")]
script = ExtResource("4_qr3fq")
dialogue = ExtResource("8_qr3fq")
title = "townie_2"
cue = "townie_2"
interact_area = NodePath("../InteractArea")

[node name="Townie3" parent="OnTheGround" unique_id=1154886998 instance=ExtResource("2_2g5xe")]
Expand Down Expand Up @@ -135,7 +135,7 @@ debug_color = Color(0.6, 0.545, 0, 0.42)
[node name="TalkBehavior" type="Node" parent="OnTheGround/Townie4" unique_id=1430052128 node_paths=PackedStringArray("interact_area")]
script = ExtResource("4_qr3fq")
dialogue = ExtResource("8_qr3fq")
title = "townie_4"
cue = "townie_4"
interact_area = NodePath("../InteractArea")

[node name="Player" parent="OnTheGround" unique_id=1193933081 instance=ExtResource("5_jsubs")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ unique_name_in_owner = true
position = Vector2(1599, -259)
item = ExtResource("9_vii7y")
collected_dialogue = ExtResource("12_8y2ta")
dialogue_title = &"wow"
dialogue_cue = &"wow"

[node name="Townie" parent="OnTheGround" unique_id=1098678013 instance=ExtResource("10_fvfn2")]
position = Vector2(615, 426)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ func congratulate_player() -> void:

func _update_dialogue_cue(_item: TaggedItem = null) -> void:
if GameState.is_item_offering_possible():
talk_behavior.title = "go_to_loom"
talk_behavior.cue = "go_to_loom"
elif not _quests:
talk_behavior.title = "no_quests"
talk_behavior.cue = "no_quests"
else:
talk_behavior.title = ""
talk_behavior.cue = ""


func _on_interaction_ended() -> void:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ extends SceneLink
collected_dialogue = new_value
notify_property_list_changed()

## The dialogue title from where [member collected_dialogue] will start.
@export var dialogue_title: StringName = ""
## The dialogue cue from where [member collected_dialogue] will start.
@export var dialogue_cue: StringName = ""

var _ghost := false:
set(new_value):
Expand Down Expand Up @@ -59,11 +59,21 @@ var _fact_key: String
func _validate_property(property: Dictionary) -> void:
super._validate_property(property)
match property.name:
"dialogue_title":
"dialogue_cue":
if not collected_dialogue:
property.usage |= PROPERTY_USAGE_READ_ONLY


func _set(property: StringName, value: Variant) -> bool:
# Scenes saved before the rename store the cue as dialogue_title. Map it to
# dialogue_cue, which is the name the editor saves from now on.
# Can be removed when we don't expect to have to rewrite any new quests being merged.
if property == &"dialogue_title":
dialogue_cue = value
return true
return false


func _get_configuration_warnings() -> PackedStringArray:
var warnings := super._get_configuration_warnings()
if not item:
Expand Down Expand Up @@ -161,7 +171,7 @@ func _on_interacted(player: Player, _from_right: bool) -> void:
GameState.quest.inventory.add_collected_item(item, self)

if collected_dialogue:
DialogueManager.show_dialogue_balloon(collected_dialogue, dialogue_title, [self, player])
DialogueManager.show_dialogue_balloon(collected_dialogue, dialogue_cue, [self, player])
await DialogueManager.dialogue_ended

interact_area.end_interaction()
Expand Down
27 changes: 18 additions & 9 deletions scenes/game_logic/talk_behavior.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extends Node
##
## It displays the [member dialogue] passing the parent node and the player as the extra game
## state.
## If [member title] is set, it will display the dialogue at that cue.[br][br]
## If [member cue] is set, it will display the dialogue at that cue.[br][br]
## When the dialogue ends, it finishes the interaction by calling [method
## InteractArea.end_interaction].
## If the parent is an NPC, it sets the [member InteractArea.action_text] to "Talk to NAME",
Expand All @@ -16,10 +16,9 @@ extends Node
## The dialogue to display.
@export var dialogue: DialogueResource = preload("uid://cc3paugq4mma4")

# TODO: Rename to cue
## Cue within [member dialogue] to play. If empty, start at the top of [member dialogue].
@export var title: String = "":
set = _set_title
@export var cue: String = "":
set = _set_cue

## The area that the player-character should interact to display the dialogue.
## The interaction will last until the dialogue ends.
Expand All @@ -35,8 +34,8 @@ extends Node

#region Setters

func _set_title(new_value: String) -> void:
title = new_value
func _set_cue(new_value: String) -> void:
cue = new_value
update_configuration_warnings()


Expand All @@ -51,11 +50,21 @@ func _get_configuration_warnings() -> PackedStringArray:
var warnings: PackedStringArray
if not interact_area:
warnings.append("Interact Area property must be set.")
if dialogue and title and title not in dialogue.get_cues():
warnings.append("Dialogue Cue '%s' does not exist" % title)
if dialogue and cue and cue not in dialogue.get_cues():
warnings.append("Dialogue Cue '%s' does not exist" % cue)
return warnings


func _set(property: StringName, value: Variant) -> bool:
# Scenes saved before the rename store the cue as title. Map it to cue, which
# is the name the editor saves from now on.
# Can be removed when we don't expect to have to rewrite any new quests being merged.
if property == &"title":
cue = value
return true
return false


func _ready() -> void:
if Engine.is_editor_hint():
return
Expand All @@ -70,6 +79,6 @@ func _on_interaction_started(player: Player, _from_right: bool) -> void:
var extra: Dictionary[String, Node]
for node: Node in extra_context:
extra[node.name] = node
DialogueManager.show_dialogue_balloon(dialogue, title, [get_parent(), player, extra])
DialogueManager.show_dialogue_balloon(dialogue, cue, [get_parent(), player, extra])
await DialogueManager.dialogue_ended
interact_area.end_interaction()
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ texture = ExtResource("15_ebxxp")
unique_name_in_owner = true
position = Vector2(2553, 164)
dialogue = ExtResource("17_sxarn")
dialogue_title = &"townie"
dialogue_cue = &"townie"
path = NodePath("../../TownieBridgePath")

[node name="Trees" type="Area2D" parent="OnTheGround" unique_id=1749010606]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ editor_draw_limits = true
[node name="TutorialNPC" parent="OnTheGround" unique_id=1098678013 instance=ExtResource("9_be8bo")]
position = Vector2(101, 1192)
dialogue = ExtResource("11_hiptn")
dialogue_title = &"walk_through"
dialogue_cue = &"walk_through"

[node name="TutorialNPC2" parent="OnTheGround" unique_id=1905290874 instance=ExtResource("9_be8bo")]
position = Vector2(3037, 232)
scale = Vector2(-1, 1)
dialogue = ExtResource("11_hiptn")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
look_at_side = 1

[node name="EnemyGuards" type="Node2D" parent="OnTheGround" unique_id=1997239040]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ position = Vector2(928, 58)
unique_name_in_owner = true
position = Vector2(-347, 289)
dialogue = ExtResource("30_ypup5")
dialogue_title = &"puzzle_hints"
dialogue_cue = &"puzzle_hints"
path = NodePath("../../TutorialNPCPaths")

[node name="Sheep" parent="OnTheGround" unique_id=398073521 instance=ExtResource("32_orron")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ highlight_color = Color(0, 0.4392157, 1, 1)
[node name="TutorialNPC" parent="OnTheGround" unique_id=1098678013 instance=ExtResource("25_dyyts")]
position = Vector2(31, 462)
dialogue = ExtResource("4_4u14d")
dialogue_title = &"interact"
dialogue_cue = &"interact"

[node name="ScreenOverlay" type="CanvasLayer" parent="." unique_id=127644403]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ idle_patrol_path = NodePath("../../EnemyPatrolPath")
[node name="TutorialNPC" parent="OnTheGround" unique_id=1098678013 instance=ExtResource("14_sdmwi")]
position = Vector2(198, 1540)
dialogue = ExtResource("17_u5x30")
dialogue_title = &"interact"
dialogue_cue = &"interact"

[node name="TutorialNPC2" parent="OnTheGround" unique_id=183522457 instance=ExtResource("14_sdmwi")]
position = Vector2(3197, -179)
scale = Vector2(-1, 1)
dialogue = ExtResource("17_u5x30")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
look_at_side = 1

[node name="ConsumableProps" type="Node2D" parent="OnTheGround" unique_id=349453195]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ position = Vector2(-865, 781)
position = Vector2(-575, 315)
item = ExtResource("19_512nx")
collected_dialogue = ExtResource("21_x2ecx")
dialogue_title = &"thread_collected"
dialogue_cue = &"thread_collected"
target = 1
spawn_point_path = NodePath("SpawnPointAfterIntro")
exit_transition = 1
Expand All @@ -256,7 +256,7 @@ highlight_color = Color(0.8910073, 0.7227245, 0, 1)
[node name="Townie" parent="OnTheGround" unique_id=1098678013 instance=ExtResource("18_x2ecx")]
position = Vector2(-348, 428)
dialogue = ExtResource("21_x2ecx")
dialogue_title = &"interact"
dialogue_cue = &"interact"

[node name="Trees" type="Node2D" parent="OnTheGround" unique_id=1555751240]
y_sort_enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ extends CharacterRandomizer
if talk_behavior:
talk_behavior.dialogue = new_value

## Title of [member dialogue] to play when the player interacts with this NPC.
@export var dialogue_title: StringName = &"start":
## Cue of [member dialogue] to play when the player interacts with this NPC.
@export var dialogue_cue: StringName = &"start":
set(new_value):
dialogue_title = new_value
dialogue_cue = new_value
if talk_behavior:
talk_behavior.title = dialogue_title
talk_behavior.cue = dialogue_cue

## The path to follow when calling [method walk_path].
@export var path: Path2D:
Expand All @@ -31,7 +31,7 @@ extends CharacterRandomizer

func _ready() -> void:
dialogue = dialogue
dialogue_title = dialogue_title
dialogue_cue = dialogue_cue
path = path


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ position = Vector2(0, -88)
unique_name_in_owner = true
script = ExtResource("23_57f2x")
dialogue = null
title = "start"
cue = "start"
interact_area = NodePath("../InteractArea")
metadata/_custom_type_script = "uid://edcifob4jc4s"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ position = Vector2(-726, 43)
revealed = false
item = ExtResource("41_icnj0")
collected_dialogue = ExtResource("6_l4i5r")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://cgemeabsewy1f"

[node name="Helper" parent="OnTheGround" unique_id=1098678013 instance=ExtResource("42_ps6xw")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ position = Vector2(542, 510)
revealed = false
item = ExtResource("21_2anko")
collected_dialogue = ExtResource("2_fgs83")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://db6vhi7s2f37c"

[node name="Bushes" type="Node2D" parent="OnTheGround" unique_id=1749232206]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ position = Vector2(2429, 1936)
revealed = false
item = ExtResource("19_w608l")
collected_dialogue = ExtResource("19_gwj3x")
dialogue_title = &"collected"
dialogue_cue = &"collected"
target = 1

[node name="SequencePuzzle" type="Node2D" parent="OnTheGround" unique_id=1138211408]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ stream = ExtResource("2_ah6ns")
[node name="Cinematic" type="Node2D" parent="." unique_id=771284646]
script = ExtResource("27_b2ao2")
dialogue = ExtResource("28_414na")
dialogue_title = "round_4"
dialogue_cue = "round_4"
metadata/_custom_type_script = "uid://x1mxt6bmei2o"

[node name="FillGameLogic" type="Node" parent="." unique_id=835746618]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ stream = ExtResource("2_djbws")
[node name="Cinematic" type="Node2D" parent="." unique_id=345375122]
script = ExtResource("27_r1fmi")
dialogue = ExtResource("28_s17xq")
dialogue_title = "round_5"
dialogue_cue = "round_5"
metadata/_custom_type_script = "uid://x1mxt6bmei2o"

[node name="FillGameLogic" type="Node" parent="." unique_id=1260277025]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bus = &"SFX"
[node name="Cinematic" type="Node2D" parent="." unique_id=590207237]
script = ExtResource("30_t7x86")
dialogue = ExtResource("31_n0ti8")
dialogue_title = "round_6"
dialogue_cue = "round_6"
metadata/_custom_type_script = "uid://x1mxt6bmei2o"

[node name="FillGameLogic" type="Node" parent="." unique_id=14736843]
Expand Down Expand Up @@ -236,7 +236,7 @@ unique_name_in_owner = true
position = Vector2(593, 356)
revealed = false
item = ExtResource("29_t7x86")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
target = 1

[node name="Camera2D" type="Camera2D" parent="." unique_id=170542824]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ position = Vector2(1155, 900)
revealed = false
item = ExtResource("23_8ja4x")
collected_dialogue = ExtResource("2_sm7tj")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://gr7ykelwh6u1"

[node name="Water Animations" type="Node2D" parent="OnTheGround" unique_id=211731260]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ position = Vector2(1807, -927)
revealed = false
item = ExtResource("15_fiojq")
collected_dialogue = ExtResource("19_00tvj")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://d0hvx8x3o7q4f"

[node name="Sign" parent="OnTheGround" unique_id=214674967 instance=ExtResource("20_3s2kx")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ position = Vector2(386, 914)
revealed = false
item = ExtResource("19_q4xxt")
collected_dialogue = ExtResource("19_et0ln")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://dfwpehorj34mx"

[node name="Sign" parent="OnTheGround" unique_id=1918134147 instance=ExtResource("20_5lqbj")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func _mostrar_dialogo(cue: String) -> void:
if cinematic == null:
push_error("No se encontró el nodo Cinematic.")
return
cinematic.dialogue_title = cue
cinematic.dialogue_cue = cue

# Cinematic se salta el diálogo si la marca ya es true, y la deja así al terminar
GameState.scene.intro_dialogue_shown = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ position = Vector2(1156, 1882)
revealed = false
item = ExtResource("22_ouleg")
collected_dialogue = ExtResource("2_j6s2f")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://7hehs33no2j3"

[node name="Apolo" type="AnimatedSprite2D" parent="OnTheGround" unique_id=307644172]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ editor_draw_limits = true
position = Vector2(1407, 384)
item = ExtResource("8_acxkl")
collected_dialogue = ExtResource("16_6jc5p")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://da7akt4pqtvpk"

[node name="Sheep" parent="OnTheGround" unique_id=398073521 instance=ExtResource("10_acxkl")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ position = Vector2(3265, 259)
revealed = false
item = ExtResource("14_u1uqs")
collected_dialogue = ExtResource("2_7k2ib")
dialogue_title = &"well_done"
dialogue_cue = &"well_done"
next_scene = "uid://dd12p8od2ec3w"

[node name="OnTheGround2" type="Node2D" parent="." unique_id=942026863]
Expand Down
Loading
Loading