diff --git a/cutscene/dialogue/DialogueAction.gd b/cutscene/dialogue/DialogueAction.gd index 3b088fb..a5a878f 100644 --- a/cutscene/dialogue/DialogueAction.gd +++ b/cutscene/dialogue/DialogueAction.gd @@ -12,6 +12,7 @@ static func dialogueCallable(params:Dictionary) -> int: var title:String = params.get('title', 'start') var extraStates:Array = params.get('extraStates', []) + UI.dialogueActive = true var line:DialogueLine = await DialogueManager.get_next_dialogue_line(resource, title, extraStates) while line != null: var text:String = line.text @@ -32,6 +33,7 @@ static func dialogueCallable(params:Dictionary) -> int: await UI.TEXTBOX.setTextAndWait(text) line = await DialogueManager.get_next_dialogue_line(resource, line.next_id, extraStates) + UI.dialogueActive = false return Cutscene.CUTSCENE_CONTINUE static func getDialogueCallable(resource:DialogueResource, title:String = 'start', extraStates:Array = []) -> Dictionary: diff --git a/overworld/entity/Entity.tscn b/overworld/entity/Entity.tscn index 9fe5fab..f20620f 100644 --- a/overworld/entity/Entity.tscn +++ b/overworld/entity/Entity.tscn @@ -38,7 +38,7 @@ mesh = SubResource("CapsuleMesh_sfgsm") surface_material_override/0 = SubResource("StandardMaterial3D_8e8ef") [node name="Nose" type="Node3D" parent="."] -transform = Transform3D(0.393905, 0, 0, 0, 0.393905, 0, 0, 0, 0.393905, 0.571181, 0.340915, 0) +transform = Transform3D(0.393905, 0, 0, 0, 0.393905, 0, 0, 0, 0.393905, 0, 0.35, -0.5) [node name="MeshInstance3D" type="MeshInstance3D" parent="Nose"] mesh = SubResource("BoxMesh_8e8ef") @@ -58,7 +58,7 @@ script = ExtResource("3_bhm0o") entity = NodePath("..") [node name="CollisionShape3D" type="CollisionShape3D" parent="EntityInteractingArea"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.604726, 0, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.605) shape = SubResource("BoxShape3D_sfgsm") [node name="EntityInteractableArea" type="Area3D" parent="." node_paths=PackedStringArray("entity")] diff --git a/overworld/entity/EntityMovement.gd b/overworld/entity/EntityMovement.gd index ff9282f..11ee775 100644 --- a/overworld/entity/EntityMovement.gd +++ b/overworld/entity/EntityMovement.gd @@ -48,6 +48,8 @@ func _applyPlayerMovement(_delta:float): if directionAdjusted.length() <= 0.01: return + entity.look_at(entity.global_position + directionAdjusted, Vector3.UP) + var speed = walkSpeed entity.velocity.x = directionAdjusted.x * speed entity.velocity.z = directionAdjusted.z * speed @@ -64,6 +66,8 @@ func _applyFriction(delta:float) -> void: entity.velocity.z *= delta * FRICTION func _canMove() -> bool: + if UI.dialogueActive: + return false if !UI.TEXTBOX.isClosed: return false return true diff --git a/ui/UISingleton.gd b/ui/UISingleton.gd index 35a7429..1d0d3d1 100644 --- a/ui/UISingleton.gd +++ b/ui/UISingleton.gd @@ -2,6 +2,10 @@ extends Node var rootUi:RootUI = null +# True for the entire duration of a DialogueAction run, including the frames +# between lines where the textbox is momentarily closed. +var dialogueActive:bool = false + var DEBUG_MENU: get(): if rootUi && rootUi.debugMenu: