src / account / account.tscn
Diagram
Overridden virtual functions
_ready
func _ready() -> void:
FocusHelper.set_neighbors_v(
[%GetStartedButton, %ChangeNameButton, %AssistModeButton])
reset_summary_visiblity()
if resource: load_resource()
_input
func _input(event: InputEvent) -> void:
if is_focused() && event.is_action_pressed("ui_accept"):
selected.emit()
elif event.is_action_pressed("ui_back"):
if is_selected(): unselected.emit()
elif is_focused(): ui_backed.emit()
_process
func _process(delta: float) -> void:
if not focused: return
blink_time += delta
add_theme_color_override("font_focus_color", get_focus_color())
if blink_time > BLINK_INTERVAL: blink_time = 0
Instantiators
Scene Tree
-
Account BoxContainer
-
VBoxContainer VBoxContainer
-
MainContainer MarginContainer
-
Background ColorRect
-
TicketContainer BoxContainer
-
TicketRoot Node2D
-
Tikect Sprite2D
-
TicketSummaryPlaceholder Control
-
Label Label
-
-
TicketSummary Node2D
-
Skull Sprite2D
-
Multiplication Sprite2D
-
ControlRoot Control
-
TotalFailureCount Label
-
TotalPlayTime Label
-
-
CassettesPlaceholder Node2D
-
Cassette1 Sprite2D
-
Cassette2 Sprite2D
-
Cassette3 Sprite2D
-
Cassette4 Sprite2D
-
Cassette5 Sprite2D
-
Cassette6 Sprite2D
-
Cassette7 Sprite2D
-
Cassette8 Sprite2D
-
-
BlueHeartsPlaceh1older Node2D
-
BlueHeart1 Sprite2D
-
BlueHeart2 Sprite2D
-
BlueHeart3 Sprite2D
-
BlueHeart4 Sprite2D
-
BlueHeart5 Sprite2D
-
BlueHeart6 Sprite2D
-
BlueHeart7 Sprite2D
-
BlueHeart8 Sprite2D
-
-
ObtainedCassettes Node2D
-
Cassette1 Sprite2D
-
Cassette2 Sprite2D
-
Cassette3 Sprite2D
-
Cassette4 Sprite2D
-
Cassette5 Sprite2D
-
Cassette6 Sprite2D
-
Cassette7 Sprite2D
-
Cassette8 Sprite2D
-
-
ObtainedBlueHearts Node2D
-
BlueHeart1 Sprite2D
-
BlueHeart2 Sprite2D
-
BlueHeart3 Sprite2D
-
BlueHeart4 Sprite2D
-
BlueHeart5 Sprite2D
-
BlueHeart6 Sprite2D
-
BlueHeart7 Sprite2D
-
BlueHeart8 Sprite2D
-
-
-
-
-
CoverContainer BoxContainer
-
CoverRoot Node2D
-
TikectCover Sprite2D
-
CoverSummary Node2D
-
Face Sprite2D
-
SellotapeLeftTop Sprite2D
-
SellotapeRightBottom Sprite2D
-
FacePhotoMask PointLight2D
-
Strawberry Sprite2D
-
Multiplication Sprite2D
-
ControlRoot Control
-
PlayerName Label
-
LatestChapterName Label
-
ObtainedStrawberryCount Label
-
-
-
-
-
-
MenuContainer MarginContainer
-
VBoxContainer VBoxContainer
-
GetStartedContainer BoxContainer
-
GetStartedButton res://src/ui/button/button.tscn
-
-
ChangeNameContainer BoxContainer
-
ChangeNameButton res://src/ui/button/button.tscn
-
-
AssistModeContainer BoxContainer
-
AssistModeButton res://src/ui/button/button.tscn
-
-
-
-
-
AnimationPlayer AnimationPlayer
-
Signal Connections
func _on_focus_entered() -> void:
if is_unfocused():
%AnimationPlayer.play("focused")
func _on_focus_exited() -> void:
if is_focused():
%AnimationPlayer.play("unfocused")
func _on_selected() -> void:
%AnimationPlayer.play("selected")
func _on_unselected() -> void:
%AnimationPlayer.play("unselected")
func _on_get_started_button_pressed() -> void:
get_started.emit()
Animations
Animation_qli4a
focused
opening (autoplay)
selected
unfocused
unselected
Properties
| Name | Value |
|---|---|
anchors_preset |
|
anchor_right |
|
offset_bottom |
|
grow_horizontal |
|
size_flags_vertical |
|
focus_mode |
|
theme |
|
script |
|
resource |
| Name | Value |
|---|---|
layout_mode |
|
size_flags_horizontal |
|
| Name | Value |
|---|---|
layout_mode |
|
size_flags_horizontal |
|
size_flags_vertical |
|
theme_override_constants/margin_left |
|
theme_override_constants/margin_top |
|
theme_override_constants/margin_right |
|
theme_override_constants/margin_bottom |
|
| Name | Value |
|---|---|
visible |
|
layout_mode |
|
size_flags_horizontal |
|
color |
|
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
texture_filter |
|
position |
|
| Name | Value |
|---|---|
texture_filter |
|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
unique_name_in_owner |
|
visible |
|
layout_mode |
|
anchors_preset |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
theme |
| Name | Value |
|---|---|
layout_mode |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
theme_override_colors/font_color |
|
theme_override_colors/font_outline_color |
|
text |
|
horizontal_alignment |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
layout_mode |
|
anchors_preset |
|
offset_left |
|
offset_right |
|
offset_bottom |
|
theme |
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
text |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
theme_override_colors/font_color |
|
theme_override_colors/font_outline_color |
|
theme_override_font_sizes/font_size |
|
text |
|
horizontal_alignment |
|
vertical_alignment |
|
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
unique_name_in_owner |
|
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
unique_name_in_owner |
|
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
texture_filter |
|
position |
|
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
unique_name_in_owner |
|
| Name | Value |
|---|---|
material |
|
position |
|
scale |
|
texture |
|
flip_h |
|
| Name | Value |
|---|---|
position |
|
rotation |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
rotation |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
blend_mode |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
position |
|
scale |
|
texture |
| Name | Value |
|---|---|
layout_mode |
|
anchors_preset |
|
offset_left |
|
offset_right |
|
size_flags_horizontal |
|
theme |
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
grow_horizontal |
|
grow_vertical |
|
size_flags_horizontal |
|
theme_override_colors/font_color |
|
theme_override_colors/font_outline_color |
|
theme_override_font_sizes/font_size |
|
text |
|
horizontal_alignment |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
grow_horizontal |
|
grow_vertical |
|
size_flags_horizontal |
|
theme_override_colors/font_color |
|
theme_override_colors/font_outline_color |
|
theme_override_font_sizes/font_size |
|
text |
|
horizontal_alignment |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
offset_left |
|
offset_top |
|
offset_right |
|
offset_bottom |
|
text |
|
| Name | Value |
|---|---|
visible |
|
layout_mode |
|
size_flags_horizontal |
|
size_flags_vertical |
|
theme_override_constants/margin_top |
|
| Name | Value |
|---|---|
layout_mode |
|
| Name | Value |
|---|---|
layout_mode |
|
alignment |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_bottom |
|
focus_next |
|
text |
|
icon |
|
focus_move_direction |
|
| Name | Value |
|---|---|
layout_mode |
|
alignment |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_top |
|
focus_neighbor_bottom |
|
focus_next |
|
focus_previous |
|
theme_override_font_sizes/font_size |
|
text |
|
icon |
|
focus_move_direction |
|
| Name | Value |
|---|---|
layout_mode |
|
alignment |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
layout_mode |
|
focus_neighbor_top |
|
focus_previous |
|
theme_override_font_sizes/font_size |
|
text |
|
icon |
|
focus_move_direction |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
libraries |
|
autoplay |
|
account.gd
extends BoxContainer
class_name Account
signal ui_backed
signal selected
signal unselected
signal get_started
@export var resource : AccountResource : set = set_resource
const LABELS_IN_RESOURCE = [
'player_name',
'latest_chapter_name',
'obtained_strawberry_count',
'total_failure_count',
'total_play_time',
'obtained_cassettes',
'obtained_blue_hearts',
]
enum State { UNFOCUSED, FOCUSED, SELECTED }
@export var state : State = State.UNFOCUSED
@export var focus_top : bool = false : set = set_focus_top
@export var focus_menu : bool = false : set = set_focus_menu
func _ready() -> void:
FocusHelper.set_neighbors_v(
[%GetStartedButton, %ChangeNameButton, %AssistModeButton])
reset_summary_visiblity()
if resource: load_resource()
func reset_summary_visiblity() -> void:
if resource:
%TicketSummaryPlaceholder.hide()
%TicketSummary.show()
%CoverSummary.show()
else:
%TicketSummaryPlaceholder.show()
%TicketSummary.hide()
%CoverSummary.hide()
func _input(event: InputEvent) -> void:
if is_focused() && event.is_action_pressed("ui_accept"):
selected.emit()
elif event.is_action_pressed("ui_back"):
if is_selected(): unselected.emit()
elif is_focused(): ui_backed.emit()
func set_resource(_resource: AccountResource) -> void:
resource = _resource
func load_resource() -> void:
reset_summary_visiblity()
if not resource: return
for key in LABELS_IN_RESOURCE:
var node = get_node("%" + key.to_pascal_case())
if node:
match key:
'obtained_cassettes':
set_icon_visibility_on(node,
resource.obtained_cassettes())
'obtained_blue_hearts':
set_icon_visibility_on(node,
resource.obtained_blue_hearts())
_:
node.text = str(resource.attr(key))
func set_icon_visibility_on(node: Node, flags: Array[bool]) -> void:
for i in flags.size():
var child = node.get_child(i)
if child: child.visible = flags[i]
func set_focus_top(val) -> void:
if val: grab_focus()
func set_focus_menu(val) -> void:
if val: %GetStartedButton.grab_focus()
func is_focused() -> bool:
return state == State.FOCUSED
func is_unfocused() -> bool:
return state == State.UNFOCUSED
func is_selected() -> bool:
return state == State.SELECTED
func _on_focus_entered() -> void:
if is_unfocused():
%AnimationPlayer.play("focused")
func _on_focus_exited() -> void:
if is_focused():
%AnimationPlayer.play("unfocused")
func _on_selected() -> void:
%AnimationPlayer.play("selected")
func _on_unselected() -> void:
%AnimationPlayer.play("unselected")
func _on_get_started_button_pressed() -> void:
get_started.emit()

