Sound FX, major work on set schedule, and some new concepts for items and portraits
This commit is contained in:
49
scripts/guild_card_scene.gd
Normal file
49
scripts/guild_card_scene.gd
Normal file
@@ -0,0 +1,49 @@
|
||||
extends Control
|
||||
|
||||
@onready var firstEdit : TextEdit = %FirstNameEdit
|
||||
@onready var lastEdit : TextEdit = %LastNameEdit
|
||||
@onready var signButton : Button = %SignButton
|
||||
@onready var portraitButton : TextureButton = %PortraitButton
|
||||
@onready var signature : TextureRect = %Signature
|
||||
@onready var write_sound : AudioStreamPlayer = $AudioStreamPlayer
|
||||
var first_set : bool = false
|
||||
var last_set : bool = false
|
||||
var portrait_set : bool = false
|
||||
|
||||
func validate_signature() -> void:
|
||||
signButton.disabled = !(first_set and last_set and portrait_set)
|
||||
|
||||
func _on_portrait_button_pressed() -> void:
|
||||
#Open the Portrait Screesn
|
||||
portrait_set = true
|
||||
validate_signature()
|
||||
|
||||
|
||||
func _on_first_name_edit_text_changed() -> void:
|
||||
if firstEdit.text != "":
|
||||
first_set = true
|
||||
else:
|
||||
last_set = true
|
||||
validate_signature()
|
||||
|
||||
|
||||
func _on_last_name_edit_text_changed() -> void:
|
||||
if lastEdit.text != "":
|
||||
last_set = true
|
||||
else:
|
||||
last_set = false
|
||||
validate_signature()
|
||||
|
||||
func update_signature_threshold(value : float) -> void:
|
||||
signature.set_instance_shader_parameter("threshold", value)
|
||||
|
||||
func _on_sign_button_pressed() -> void:
|
||||
signButton.visible = false
|
||||
var tween = create_tween()
|
||||
write_sound.play()
|
||||
tween.tween_method(update_signature_threshold, -0.1, 1.1, .5)
|
||||
|
||||
#Sign the card.
|
||||
#Dialogic.paused = false
|
||||
#Dialogic.Jump.jump_to_label("")
|
||||
pass # Replace with function body.
|
||||
Reference in New Issue
Block a user