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")
cue = "townie_1"
dialogue_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")
cue = "townie_2"
dialogue_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")
cue = "townie_4"
dialogue_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 @@ -108,11 +108,11 @@ func congratulate_player() -> void:

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


func _on_interaction_ended() -> void:
Expand Down
24 changes: 12 additions & 12 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 cue] is set, it will display the dialogue at that cue.[br][br]
## If [member dialogue_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 @@ -17,8 +17,8 @@ extends Node
@export var dialogue: DialogueResource = preload("uid://cc3paugq4mma4")

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

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

#region Setters

func _set_cue(new_value: String) -> void:
cue = new_value
func _set_dialogue_cue(new_value: String) -> void:
dialogue_cue = new_value
update_configuration_warnings()


Expand All @@ -50,17 +50,17 @@ func _get_configuration_warnings() -> PackedStringArray:
var warnings: PackedStringArray
if not interact_area:
warnings.append("Interact Area property must be set.")
if dialogue and cue and cue not in dialogue.get_cues():
warnings.append("Dialogue Cue '%s' does not exist" % cue)
if dialogue and dialogue_cue and dialogue_cue not in dialogue.get_cues():
warnings.append("Dialogue Cue '%s' does not exist" % dialogue_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.
# Scenes saved before the renames store the cue as title or cue. Map them 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 == &"title":
cue = value
if property in [&"title", &"cue"]:
dialogue_cue = value
return true
return false

Expand All @@ -79,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, cue, [get_parent(), player, extra])
DialogueManager.show_dialogue_balloon(dialogue, 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 @@ -15,7 +15,7 @@ extends CharacterRandomizer
set(new_value):
dialogue_cue = new_value
if talk_behavior:
talk_behavior.cue = dialogue_cue
talk_behavior.dialogue_cue = dialogue_cue

## The path to follow when calling [method walk_path].
@export var path: Path2D:
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
cue = "start"
dialogue_cue = "start"
interact_area = NodePath("../InteractArea")
metadata/_custom_type_script = "uid://edcifob4jc4s"

Expand Down
7 changes: 3 additions & 4 deletions scenes/ui_elements/cinematic/cinematic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ func _validate_property(property: Dictionary) -> void:
super._validate_property(property)
match property.name:
"dialogue_cue":
if dialogue:
property.hint = PROPERTY_HINT_ENUM
property.hint_string = ",".join(dialogue.get_cues())
else:
# Dialogue Manager's inspector plugin edits this property, listing the
# cues of the dialogue.
if not dialogue:
property.usage |= PROPERTY_USAGE_READ_ONLY


Expand Down
4 changes: 2 additions & 2 deletions scenes/world_map/components/frays_end_exit_blocker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
extends Area2D

@export var dialogue: DialogueResource
@export var cue: String
@export var dialogue_cue: String
@export var spawn_point: SpawnPoint


Expand All @@ -21,7 +21,7 @@ func _body_entered_cb(body: Node2D) -> void:
player.velocity = Vector2.ZERO
player.take_control(self)

DialogueManager.show_dialogue_balloon(dialogue, cue, [player])
DialogueManager.show_dialogue_balloon(dialogue, dialogue_cue, [player])
await DialogueManager.dialogue_ended

await (Transitions.do_transition(spawn_point.move_player_to_self_position))
Expand Down
8 changes: 4 additions & 4 deletions scenes/world_map/frays_end.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ look_at_side = 1
[node name="TalkBehavior" type="Node" parent="OnTheGround/NPCs/Farmer" unique_id=732454003 node_paths=PackedStringArray("interact_area")]
script = ExtResource("56_ojao8")
dialogue = ExtResource("25_6r0j2")
cue = "farmer"
dialogue_cue = "farmer"
interact_area = NodePath("../InteractArea")
metadata/_custom_type_script = "uid://edcifob4jc4s"

Expand Down Expand Up @@ -774,7 +774,7 @@ character_seed = 2422434786
[node name="TalkBehavior" type="Node" parent="OnTheGround/NPCs/GardenerA" unique_id=1669484224 node_paths=PackedStringArray("interact_area")]
script = ExtResource("56_ojao8")
dialogue = ExtResource("25_6r0j2")
cue = "marie"
dialogue_cue = "marie"
interact_area = NodePath("../InteractArea")
metadata/_custom_type_script = "uid://edcifob4jc4s"

Expand Down Expand Up @@ -809,7 +809,7 @@ look_at_side = 1
[node name="TalkBehavior" type="Node" parent="OnTheGround/NPCs/BeachTownie" unique_id=1832795451 node_paths=PackedStringArray("interact_area")]
script = ExtResource("56_ojao8")
dialogue = ExtResource("25_6r0j2")
cue = "beach"
dialogue_cue = "beach"
interact_area = NodePath("../InteractArea")
metadata/_custom_type_script = "uid://edcifob4jc4s"

Expand Down Expand Up @@ -1787,7 +1787,7 @@ collision_layer = 0
monitorable = false
script = ExtResource("62_t7c6s")
dialogue = ExtResource("25_6r0j2")
cue = "hotel_california"
dialogue_cue = "hotel_california"
spawn_point = NodePath("SpawnPoint")

[node name="SpawnPoint" parent="ExitBlocker" unique_id=1896816746 instance=ExtResource("37_thm8h")]
Expand Down
Loading