diff --git a/scenes/dev/level_design/character_randomizer/character_randomizer_test.tscn b/scenes/dev/level_design/character_randomizer/character_randomizer_test.tscn index 21d166dc2..5fd7b47e0 100644 --- a/scenes/dev/level_design/character_randomizer/character_randomizer_test.tscn +++ b/scenes/dev/level_design/character_randomizer/character_randomizer_test.tscn @@ -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] @@ -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")] @@ -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")] diff --git a/scenes/game_elements/characters/npcs/elder/components/elder.gd b/scenes/game_elements/characters/npcs/elder/components/elder.gd index 6a064bf20..e99409986 100644 --- a/scenes/game_elements/characters/npcs/elder/components/elder.gd +++ b/scenes/game_elements/characters/npcs/elder/components/elder.gd @@ -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: diff --git a/scenes/game_logic/talk_behavior.gd b/scenes/game_logic/talk_behavior.gd index 2b85aff8d..9b55c3741 100644 --- a/scenes/game_logic/talk_behavior.gd +++ b/scenes/game_logic/talk_behavior.gd @@ -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", @@ -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. @@ -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() @@ -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 @@ -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() diff --git a/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.gd b/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.gd index 6fbc41ef8..e30587526 100644 --- a/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.gd +++ b/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.gd @@ -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: diff --git a/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn b/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn index c795aab53..b70e0e1e9 100644 --- a/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn +++ b/scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn @@ -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" diff --git a/scenes/ui_elements/cinematic/cinematic.gd b/scenes/ui_elements/cinematic/cinematic.gd index 0b8ef1730..a9ba34299 100644 --- a/scenes/ui_elements/cinematic/cinematic.gd +++ b/scenes/ui_elements/cinematic/cinematic.gd @@ -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 diff --git a/scenes/world_map/components/frays_end_exit_blocker.gd b/scenes/world_map/components/frays_end_exit_blocker.gd index ae70aa82b..c411fe103 100644 --- a/scenes/world_map/components/frays_end_exit_blocker.gd +++ b/scenes/world_map/components/frays_end_exit_blocker.gd @@ -3,7 +3,7 @@ extends Area2D @export var dialogue: DialogueResource -@export var cue: String +@export var dialogue_cue: String @export var spawn_point: SpawnPoint @@ -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)) diff --git a/scenes/world_map/frays_end.tscn b/scenes/world_map/frays_end.tscn index ea4252623..68ebd7e57 100644 --- a/scenes/world_map/frays_end.tscn +++ b/scenes/world_map/frays_end.tscn @@ -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" @@ -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" @@ -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" @@ -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")]