feat: game instruction shown in youth room for as long as no memento has been hovered and the room is not solved
This commit is contained in:
parent
34872b6b12
commit
a07ec30716
|
|
@ -27,6 +27,9 @@ func start_room_async():
|
||||||
%LightAnimationPlayer.lights_on()
|
%LightAnimationPlayer.lights_on()
|
||||||
%SceneAnimationPlayer.start_soundtrack()
|
%SceneAnimationPlayer.start_soundtrack()
|
||||||
|
|
||||||
|
if not State.save_game.childhood_board_complete:
|
||||||
|
P.instruction.call_deferred("Find all three Momentos to collect all thoughts")
|
||||||
|
|
||||||
Scenes.player_enable.emit(true)
|
Scenes.player_enable.emit(true)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
class_name CardPicker
|
class_name CardPicker
|
||||||
extends Playable
|
extends Playable
|
||||||
|
|
||||||
#fixme INI is probably redundant.
|
#fixme INI is probably redundant.
|
||||||
|
|
@ -36,7 +36,7 @@ var curr_selection_id: int = -1:
|
||||||
if selection_state == CARDS or selection_state == POSTS:
|
if selection_state == CARDS or selection_state == POSTS:
|
||||||
# Wrap around
|
# Wrap around
|
||||||
curr_selection_id = new_id % options.size()
|
curr_selection_id = new_id % options.size()
|
||||||
|
|
||||||
# Update all highlights
|
# Update all highlights
|
||||||
for i in range(options.size()):
|
for i in range(options.size()):
|
||||||
options[i].highlighted = (i == curr_selection_id)
|
options[i].highlighted = (i == curr_selection_id)
|
||||||
|
|
@ -107,15 +107,15 @@ func _input(event : InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left"):
|
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left"):
|
||||||
curr_selection_id -= 1
|
curr_selection_id -= 1
|
||||||
elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right"):
|
elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right"):
|
||||||
curr_selection_id += 1
|
curr_selection_id += 1
|
||||||
|
|
||||||
# Selection
|
# Selection
|
||||||
elif event.is_action_pressed("ui_accept"):
|
elif event.is_action_pressed("ui_accept"):
|
||||||
pick(curr_selection_id)
|
pick(curr_selection_id)
|
||||||
|
|
||||||
|
|
||||||
func pick(id: int) -> void:
|
func pick(id: int) -> void:
|
||||||
print("%s picked card %s at id %d" % [name, options[id].text, id])
|
print("%s picked card %s at id %d" % [name, options[id].text, id])
|
||||||
if id == -1:
|
if id == -1:
|
||||||
curr_selection_id = 0
|
curr_selection_id = 0
|
||||||
return
|
return
|
||||||
|
|
@ -204,7 +204,7 @@ func show_posts():
|
||||||
|
|
||||||
func handle_hover(draggable: Draggable) -> void:
|
func handle_hover(draggable: Draggable) -> void:
|
||||||
if _input_locked: return
|
if _input_locked: return
|
||||||
|
|
||||||
draggable.highlighted = draggable.mouse_over
|
draggable.highlighted = draggable.mouse_over
|
||||||
if draggable.mouse_over:
|
if draggable.mouse_over:
|
||||||
curr_selection_id = options.find(draggable)
|
curr_selection_id = options.find(draggable)
|
||||||
|
|
@ -212,7 +212,7 @@ func handle_hover(draggable: Draggable) -> void:
|
||||||
|
|
||||||
func handle_mouse_button(event: InputEventMouseButton, draggable: Draggable) -> void:
|
func handle_mouse_button(event: InputEventMouseButton, draggable: Draggable) -> void:
|
||||||
if _input_locked: return
|
if _input_locked: return
|
||||||
|
|
||||||
if event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() and not event.is_echo():
|
if event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() and not event.is_echo():
|
||||||
pick(options.find(draggable))
|
pick(options.find(draggable))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ var tween: Tween = null
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
assert(frame and canvas_layer, "Interactable must have canvas and frame attached")
|
assert(frame and canvas_layer, "Interactable must have canvas and frame attached")
|
||||||
|
|
||||||
frame.modulate.a = 0.0
|
frame.modulate = Color.TRANSPARENT
|
||||||
light.visible = false
|
light.visible = false
|
||||||
|
|
||||||
Scenes.player_enable.connect(_player_active) # TODO: do I have to clean this up?
|
Scenes.player_enable.connect(_player_active) # TODO: do I have to clean this up?
|
||||||
|
|
@ -61,20 +61,19 @@ func expand() -> void:
|
||||||
frame.scale = Vector3(1.5, 1.5, 1.5)
|
frame.scale = Vector3(1.5, 1.5, 1.5)
|
||||||
|
|
||||||
tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
|
tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
|
||||||
tween.parallel().tween_property(frame, "modulate:a", 1.0, 2.0).set_trans(Tween.TRANS_QUAD)
|
tween.parallel().tween_property(frame, "modulate", Color.WHITE, 2.0).set_trans(Tween.TRANS_QUAD)
|
||||||
tween.parallel().tween_property(frame, "scale", Vector3.ONE, 1.0).set_trans(Tween.TRANS_QUART)
|
tween.parallel().tween_property(frame, "scale", Vector3.ONE, 1.0).set_trans(Tween.TRANS_QUART)
|
||||||
tween.parallel().tween_property(light, "light_energy", original_light_energy, 1.0).set_trans(Tween.TRANS_QUART)
|
tween.parallel().tween_property(light, "light_energy", original_light_energy, 1.0).set_trans(Tween.TRANS_QUART)
|
||||||
|
|
||||||
|
|
||||||
func collapse() -> void:
|
func collapse() -> void:
|
||||||
P.clear()
|
|
||||||
|
|
||||||
if not shown: return
|
if not shown: return
|
||||||
shown = false
|
shown = false
|
||||||
|
P.clear()
|
||||||
|
|
||||||
if tween: tween.kill()
|
if tween: tween.kill()
|
||||||
tween = create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_BACK)
|
tween = create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_BACK)
|
||||||
tween.parallel().tween_property(frame, "modulate:a", 0, 0.5).set_trans(Tween.TRANS_QUAD)
|
tween.parallel().tween_property(frame, "modulate", Color.TRANSPARENT, 0.5).set_trans(Tween.TRANS_QUAD)
|
||||||
tween.parallel().tween_property(frame, "scale", Vector3.ONE * 2.0, 1.0).set_trans(Tween.TRANS_QUAD)
|
tween.parallel().tween_property(frame, "scale", Vector3.ONE * 2.0, 1.0).set_trans(Tween.TRANS_QUAD)
|
||||||
tween.parallel().tween_property(light, "light_energy", 0, 1.0).set_trans(Tween.TRANS_QUAD)
|
tween.parallel().tween_property(light, "light_energy", 0, 1.0).set_trans(Tween.TRANS_QUAD)
|
||||||
await tween.finished
|
await tween.finished
|
||||||
|
|
@ -92,8 +91,7 @@ func _process_billboard() -> void:
|
||||||
func _process_hover() -> void:
|
func _process_hover() -> void:
|
||||||
if active and hover and not shown:
|
if active and hover and not shown:
|
||||||
expand()
|
expand()
|
||||||
|
elif shown and not hover:
|
||||||
elif not hover and shown or shown and not active:
|
|
||||||
collapse()
|
collapse()
|
||||||
|
|
||||||
func handle_input(event: InputEvent) -> void:
|
func handle_input(event: InputEvent) -> void:
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ static var _instance : Prompter = null
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_register_prompts()
|
_register_prompts()
|
||||||
clear()
|
clear()
|
||||||
|
|
||||||
|
|
||||||
func _register_prompts() -> void:
|
func _register_prompts() -> void:
|
||||||
assert(not _instance, "Cannot have two prompters (are you trying to run the prompter itself?)")
|
assert(not _instance, "Cannot have two prompters (are you trying to run the prompter itself?)")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue