Skip to content

Commit

Permalink
Merge pull request #8 from ARPGLTD/UnlockPrompt
Browse files Browse the repository at this point in the history
Add interaction_text_when_locked
  • Loading branch information
Phazorknight authored Jan 1, 2024
2 parents 7d78b72 + 5a00130 commit 4d384c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion COGITO/Scripts/Interact_Door.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ extends Node3D
@export_group("Door Parameters")
## Start state of the door (usually closed).
@export var is_open : bool = false
## Text that appears on the interaction prompt when locked.
@export var interaction_text_when_locked : String = "Unlock"
## Text that appears on the interaction prompt when closed.
@export var interaction_text_when_closed : String = "Open"
## Text that appears on the interaction prompt when open.
Expand Down Expand Up @@ -45,6 +47,8 @@ func _ready():
target_rotation_rad = rotation.y
if is_open:
interaction_text = interaction_text_when_open
elif is_locked:
interaction_text = interaction_text_when_locked
else:
interaction_text = interaction_text_when_closed

Expand Down Expand Up @@ -94,7 +98,7 @@ func unlock_door():
audio_stream_player_3d.stream = unlock_sound
audio_stream_player_3d.play()
is_locked = false

interaction_text = interaction_text_when_closed

func open_door():
audio_stream_player_3d.stream = open_sound
Expand Down

0 comments on commit 4d384c2

Please sign in to comment.