Polish title online and save slot interfaces

This commit is contained in:
Alexander Sellite 2026-08-23 23:04:15 -04:00
parent a3aea98982
commit 867fd431af
8 changed files with 463 additions and 86 deletions

View file

@ -130,7 +130,28 @@ func _validate_primary_menu_navigation() -> void:
and not (title.get_node("%DeleteSaveButton") as Control).visible,
"Legacy New/Delete title bubbles are still visible.",
)
_assert_directionally_reachable(title_controls.front(), title_controls)
_assert_neighbor(
title.get_node("%JoinGameButton") as Control,
&"focus_neighbor_right",
play_button,
)
_assert_neighbor(
title.get_node("%SettingsButton") as Control,
&"focus_neighbor_left",
play_button,
)
_assert_neighbor(
title.get_node("%CreditsButton") as Control,
&"focus_neighbor_right",
play_button,
)
_assert_neighbor(
title.get_node("%QuitButton") as Control,
&"focus_neighbor_left",
play_button,
)
for title_control: Control in title_controls:
_assert_directionally_reachable(title_control, title_controls)
title.queue_free()
await process_frame
@ -195,6 +216,13 @@ func _validate_save_slots_navigation() -> void:
page.call("_select_page", &"saves", false)
await process_frame
var import_button := page.get_node("%ImportSlotButton") as Button
var actions := page.get_node("%Actions") as VBoxContainer
var secondary_actions := page.get_node("%SecondaryActions") as GridContainer
var play_slot := page.get_node("%PlaySlotButton") as Button
var rename_slot := page.get_node("%RenameSlotButton") as Button
var duplicate_slot := page.get_node("%DuplicateSlotButton") as Button
var export_slot := page.get_node("%ExportSlotButton") as Button
var delete_slot := page.get_node("%DeleteSlotButton") as Button
_expect(
saves_tab.find_valid_focus_neighbor(SIDE_BOTTOM) == import_button,
"An empty Save Slots page does not lead from its tab to Import Save.",
@ -204,6 +232,29 @@ func _validate_save_slots_navigation() -> void:
== page.get_node("%BackButton"),
"An empty Save Slots page does not lead from Import Save to Back.",
)
_expect(
is_equal_approx(play_slot.size.x, actions.size.x),
"Save-slot Play does not span the full action width.",
)
_expect(
secondary_actions.columns == 2
and is_equal_approx(rename_slot.size.x, duplicate_slot.size.x)
and is_equal_approx(export_slot.size.x, delete_slot.size.x)
and is_equal_approx(rename_slot.position.y, duplicate_slot.position.y)
and is_equal_approx(export_slot.position.y, delete_slot.position.y)
and export_slot.position.y > rename_slot.position.y,
"Save-slot secondary actions are not arranged as a 2 by 2 grid.",
)
var play_style := play_slot.get_theme_stylebox("normal") as StyleBoxFlat
_expect(
play_style != null and play_style.bg_color == UtilityPageStyle.GREEN,
"Save-slot Play does not use the green primary-action style.",
)
_assert_neighbor(play_slot, &"focus_neighbor_bottom", rename_slot)
_assert_neighbor(rename_slot, &"focus_neighbor_right", duplicate_slot)
_assert_neighbor(rename_slot, &"focus_neighbor_bottom", export_slot)
_assert_neighbor(duplicate_slot, &"focus_neighbor_bottom", delete_slot)
_assert_neighbor(export_slot, &"focus_neighbor_right", delete_slot)
page.queue_free()
await process_frame
@ -222,6 +273,9 @@ func _validate_join_game_navigation() -> void:
var address := page.get_node("%Address") as LineEdit
var name_edit := page.get_node("%NameEdit") as LineEdit
var server_list := page.get_node("%ServerList") as ItemList
var presence := page.get_node("%PresenceButton") as Button
var room_open := page.get_node("%RoomOpenButton") as Button
var room_listing := page.get_node("%RoomListingButton") as Button
var refresh := page.get_node("%RefreshButton") as Button
var join := page.get_node("%JoinButton") as Button
var save := page.get_node("%SaveButton") as Button
@ -233,6 +287,7 @@ func _validate_join_game_navigation() -> void:
var direct_content := page.get_node("%DirectContent") as Control
var list_content := page.get_node("%ListContent") as Control
var content_panel := page.get_node("%ContentPanel") as PanelContainer
var actions := page.get_node("%Actions") as HBoxContainer
var modes: Array[Control] = [discover, friends, direct, saved, recent]
var tab_overlap: float = (
discover.get_global_rect().end.y
@ -265,9 +320,36 @@ func _validate_join_game_navigation() -> void:
_assert_neighbor(refresh, &"focus_neighbor_right", join)
_assert_neighbor(join, &"focus_neighbor_bottom", back)
_assert_neighbor(back, &"focus_neighbor_top", join)
_expect(
is_equal_approx(
join.get_global_rect().end.x,
actions.get_global_rect().end.x,
),
"Discover Refresh and Join are not right-justified.",
)
var discover_controls: Array[Control] = modes.duplicate()
discover_controls.append_array([server_list, refresh, join, back])
_assert_directionally_reachable(discover, discover_controls)
room_open.show()
room_listing.show()
_set_button_state(room_open, true)
_set_button_state(room_listing, true)
page.call("_configure_controller_navigation")
await process_frame
_assert_neighbor(room_open, &"focus_neighbor_right", room_listing)
_assert_neighbor(room_open, &"focus_neighbor_left", room_open)
_assert_neighbor(room_listing, &"focus_neighbor_left", room_open)
_assert_neighbor(room_listing, &"focus_neighbor_bottom", server_list)
var hosted_discover_controls: Array[Control] = modes.duplicate()
hosted_discover_controls.append_array([
room_open,
room_listing,
server_list,
refresh,
join,
back,
])
_assert_directionally_reachable(discover, hosted_discover_controls)
var rooms: Array[Dictionary] = [
{
"room_id": "controller-default-room",
@ -293,16 +375,36 @@ func _validate_join_game_navigation() -> void:
)
page.set("_mode", JoinGamePage.Mode.FRIENDS)
(page.get_node("%OnlineControls") as Control).hide()
presence.show()
page.call("_configure_controller_navigation")
await process_frame
_assert_neighbor(friends, &"focus_neighbor_bottom", server_list)
_assert_neighbor(server_list, &"focus_neighbor_top", friends)
_assert_neighbor(server_list, &"focus_neighbor_bottom", presence)
_assert_neighbor(presence, &"focus_neighbor_right", refresh)
_assert_neighbor(refresh, &"focus_neighbor_right", join)
_expect(
is_equal_approx(
presence.get_global_rect().position.x,
actions.get_global_rect().position.x,
),
"Friend presence is not left-justified in the action row.",
)
_expect(
is_equal_approx(
join.get_global_rect().end.x,
actions.get_global_rect().end.x,
),
"Friends Refresh and Join are not right-justified.",
)
var friend_controls: Array[Control] = modes.duplicate()
friend_controls.append_array([server_list, refresh, join, back])
friend_controls.append_array([server_list, presence, refresh, join, back])
_assert_directionally_reachable(friends, friend_controls)
list_content.hide()
direct_content.show()
presence.hide()
address.show()
address.editable = true
server_list.hide()