* Equilibrage de la difficulté (suite) * Correction du timing des dialogues de Demeter * Dev de la base astra (avec les logs) * Fix de bug de duplication d'objets * Fix de la mutation ancien * Ajout d'une mention de la propagation des mutations dans le tuto
55 lines
1.4 KiB
GDScript
55 lines
1.4 KiB
GDScript
@tool
|
|
extends Interactable3D
|
|
class_name Radio3d
|
|
|
|
@export var log_title : String = "Title" : set = set_title
|
|
@export var log_text : String = "Text" : set = set_text
|
|
|
|
@export var read := false : set = set_read
|
|
|
|
func _ready():
|
|
set_interactable()
|
|
set_title()
|
|
set_text()
|
|
set_read()
|
|
|
|
func set_title(v := log_title):
|
|
log_title = v
|
|
if is_node_ready():
|
|
%LogScreen.log_title = log_title
|
|
|
|
func set_text(v := log_text):
|
|
log_text = v
|
|
if is_node_ready():
|
|
%LogScreen.log_text = log_text
|
|
|
|
func set_read(v := read):
|
|
read = v
|
|
|
|
if is_node_ready():
|
|
%CPUParticles3D.emitting = not read
|
|
%OffScreen.visible = read
|
|
%Icon.visible = not read
|
|
|
|
func click(player3d :Player3D):
|
|
if interactable:
|
|
clicked.emit()
|
|
%LogScreen.appear()
|
|
AudioManager.play_sfx("MessageEnter")
|
|
|
|
%LogScreen.appear()
|
|
read = true
|
|
interactable = false
|
|
player3d.controlling_player = false
|
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
|
%LogScreen.disappeared.connect(
|
|
func():
|
|
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
|
player3d.controlling_player = true
|
|
get_tree().create_timer(0.5).timeout.connect( # Put a delay to not interfere with the ok button click
|
|
func():
|
|
interactable = true
|
|
)
|
|
AudioManager.play_sfx("MessageExit")
|
|
)
|