fix: harden recovery flow and clean diagnostics
This commit is contained in:
parent
0158b0215f
commit
ff78710303
64 changed files with 1163 additions and 418 deletions
|
|
@ -1463,8 +1463,8 @@ func is_mobile_mode() -> bool:
|
|||
return _mobile_mode
|
||||
|
||||
|
||||
func set_hud_hidden(hidden: bool) -> void:
|
||||
_hud_hidden = hidden
|
||||
func set_hud_hidden(is_hidden: bool) -> void:
|
||||
_hud_hidden = is_hidden
|
||||
_refresh_visibility()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@ static func make_icon_texture(
|
|||
Image.FORMAT_RGBA8,
|
||||
)
|
||||
canvas.fill(Color.TRANSPARENT)
|
||||
var inset := Vector2i.ONE * ((canvas_size - icon_size) / 2)
|
||||
var inset := Vector2i.ONE * floori(
|
||||
float(canvas_size - icon_size) / 2.0
|
||||
)
|
||||
canvas.blend_rect(
|
||||
image,
|
||||
Rect2i(Vector2i.ZERO, Vector2i(icon_size, icon_size)),
|
||||
|
|
|
|||
|
|
@ -93,10 +93,16 @@ static func uniform_footprint_size(
|
|||
maximum_size.x / visible_size.x,
|
||||
maximum_size.y / visible_size.y,
|
||||
)
|
||||
var scale: float = minf(area_scale, fit_scale)
|
||||
var footprint_scale: float = minf(area_scale, fit_scale)
|
||||
return Vector2(
|
||||
minf(maximum_size.x, maxf(1.0, roundf(visible_size.x * scale))),
|
||||
minf(maximum_size.y, maxf(1.0, roundf(visible_size.y * scale))),
|
||||
minf(
|
||||
maximum_size.x,
|
||||
maxf(1.0, roundf(visible_size.x * footprint_scale)),
|
||||
),
|
||||
minf(
|
||||
maximum_size.y,
|
||||
maxf(1.0, roundf(visible_size.y * footprint_scale)),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -91,14 +91,14 @@ func _initialize_motion() -> void:
|
|||
_set_visual_y(_target_y())
|
||||
|
||||
|
||||
func _on_toggled(is_pressed: bool) -> void:
|
||||
if _selected and not is_pressed:
|
||||
func _on_toggled(is_button_pressed: bool) -> void:
|
||||
if _selected and not is_button_pressed:
|
||||
# A selected organizer tab is a page marker, not a collapsible toggle.
|
||||
# Restore without another signal before any lower-state frame is drawn.
|
||||
set_pressed_no_signal(true)
|
||||
refresh_state(false)
|
||||
return
|
||||
_selected = is_pressed
|
||||
_selected = is_button_pressed
|
||||
refresh_state()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -65,14 +65,14 @@ func _apply_style() -> void:
|
|||
|
||||
func configure(
|
||||
key: String,
|
||||
icon: Texture2D,
|
||||
icon_texture: Texture2D,
|
||||
label: String,
|
||||
quantity: int = 1,
|
||||
quality: int = -1,
|
||||
) -> void:
|
||||
entry_key = key
|
||||
_quality_tier = quality
|
||||
_icon.texture = icon
|
||||
_icon.texture = icon_texture
|
||||
_quantity.text = "×%d" % quantity if quantity > 1 else ""
|
||||
tooltip_text = "%s · select to remove" % label
|
||||
accessibility_name = tooltip_text
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ func _popup_item_height(popup: PopupMenu, index: int) -> float:
|
|||
popup.get_theme_font_size(&"font_size")
|
||||
)
|
||||
var icon: Texture2D = popup.get_item_icon(index)
|
||||
var icon_height: float = icon.get_height() if icon != null else 0.0
|
||||
var icon_height: float = float(icon.get_height()) if icon != null else 0.0
|
||||
return maxf(font_height, icon_height) + vertical_separation
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,9 @@ const CURRENCY_ICON: Texture2D = preload(
|
|||
|
||||
signal menu_visibility_changed(is_open: bool)
|
||||
signal menu_exit_started
|
||||
@warning_ignore("unused_signal")
|
||||
signal sell_fish_requested
|
||||
@warning_ignore("unused_signal")
|
||||
signal shop_cooler_return_requested
|
||||
signal shop_cooler_confirmation_cancel_requested
|
||||
|
||||
|
|
@ -395,9 +397,11 @@ func _select_shop_section(section_index: int, focus_content: bool) -> void:
|
|||
_controller_zone = ControllerZone.CONTENT
|
||||
if section_index == int(_shop_section):
|
||||
if section_index != ShopSection.SELL_FISH:
|
||||
var showing_upgrades := section_index == ShopSection.UPGRADES
|
||||
_upgrades_content.visible = showing_upgrades
|
||||
_supplies_content.visible = not showing_upgrades
|
||||
var showing_current_upgrades: bool = (
|
||||
section_index == ShopSection.UPGRADES
|
||||
)
|
||||
_upgrades_content.visible = showing_current_upgrades
|
||||
_supplies_content.visible = not showing_current_upgrades
|
||||
_update_shop_tab_selection()
|
||||
if focus_content:
|
||||
_focus_shop_section()
|
||||
|
|
@ -470,12 +474,12 @@ func _apply_shop_controller_zone_focus_modes() -> void:
|
|||
|
||||
func _set_descendant_button_focus_mode(
|
||||
root_control: Control,
|
||||
focus_mode: Control.FocusMode,
|
||||
requested_focus_mode: Control.FocusMode,
|
||||
) -> void:
|
||||
for child: Node in root_control.find_children("*", "BaseButton", true, false):
|
||||
var button := child as BaseButton
|
||||
if button != null:
|
||||
button.focus_mode = focus_mode
|
||||
button.focus_mode = requested_focus_mode
|
||||
|
||||
|
||||
func _update_shop_tab_selection() -> void:
|
||||
|
|
@ -704,14 +708,14 @@ func deactivate_shop_cooler_page() -> void:
|
|||
|
||||
|
||||
func _set_shop_panel_background_pointer_blocking(blocking: bool) -> void:
|
||||
var mouse_filter := (
|
||||
var panel_mouse_filter := (
|
||||
Control.MOUSE_FILTER_STOP
|
||||
if blocking
|
||||
else Control.MOUSE_FILTER_IGNORE
|
||||
)
|
||||
_shop_panel.mouse_filter = mouse_filter
|
||||
_shop_panel_margin.mouse_filter = mouse_filter
|
||||
_shop_panel_layout.mouse_filter = mouse_filter
|
||||
_shop_panel.mouse_filter = panel_mouse_filter
|
||||
_shop_panel_margin.mouse_filter = panel_mouse_filter
|
||||
_shop_panel_layout.mouse_filter = panel_mouse_filter
|
||||
|
||||
|
||||
func set_shop_cooler_modal_open(is_open: bool) -> void:
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ var _hotbar: PlayerHotbarType
|
|||
var _item_catalog: ItemCatalogType
|
||||
var _player_menu_open: bool = false
|
||||
var _gameplay_ui_enabled: bool = false
|
||||
var _gameplay_input_locked: bool = false
|
||||
var _gameplay_hud_hidden: bool = false
|
||||
var _fishing_spot: FishingSpotType
|
||||
var _system_menu_open: bool = false
|
||||
|
|
@ -631,6 +632,9 @@ func _prioritize_surface_drawing_pointer_input() -> void:
|
|||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if _gameplay_input_locked:
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
if _social_prompt_open and event.is_action_pressed("ui_cancel"):
|
||||
_decline_social_prompt()
|
||||
get_viewport().set_input_as_handled()
|
||||
|
|
@ -681,6 +685,7 @@ func _input(event: InputEvent) -> void:
|
|||
return
|
||||
var can_open: bool = (
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
|
|
@ -719,6 +724,7 @@ func _input(event: InputEvent) -> void:
|
|||
func _reconcile_radial_menu_input() -> void:
|
||||
var blocked: bool = (
|
||||
not _gameplay_ui_enabled
|
||||
or _gameplay_input_locked
|
||||
or _system_menu_open
|
||||
or _player_menu_open
|
||||
or _shop_open
|
||||
|
|
@ -769,6 +775,7 @@ func _close_quick_radial_menu() -> void:
|
|||
func _can_use_character_call() -> bool:
|
||||
return (
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
|
|
@ -840,6 +847,7 @@ func _handle_controller_chat_controls(event: InputEvent) -> bool:
|
|||
button_event == null
|
||||
or not button_event.pressed
|
||||
or not _gameplay_ui_enabled
|
||||
or _gameplay_input_locked
|
||||
or _system_menu_open
|
||||
or _player_menu_open
|
||||
or _shop_open
|
||||
|
|
@ -1051,6 +1059,7 @@ func _mapped_virtual_mouse_stick() -> Vector2:
|
|||
func _can_start_virtual_mouse() -> bool:
|
||||
return (
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _showcase_active
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
|
|
@ -1430,6 +1439,7 @@ func _can_surface_drawing_be_active() -> bool:
|
|||
return (
|
||||
_surface_drawing_hotbar_selected
|
||||
and _gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
|
|
@ -1838,12 +1848,38 @@ func set_gameplay_ui_enabled(enabled: bool) -> void:
|
|||
_hotbar_ui.set_gameplay_input_enabled(false)
|
||||
else:
|
||||
_refresh_hotbar_visibility()
|
||||
_hotbar_ui.set_gameplay_input_enabled(true)
|
||||
_hotbar_ui.set_gameplay_input_enabled(
|
||||
not _gameplay_input_locked
|
||||
)
|
||||
_refresh_fishing_panel_visibility()
|
||||
call_deferred("_start_next_experience_animation")
|
||||
_refresh_surface_drawing_activation()
|
||||
|
||||
|
||||
func set_gameplay_input_locked(locked: bool) -> void:
|
||||
if _gameplay_input_locked == locked:
|
||||
return
|
||||
_gameplay_input_locked = locked
|
||||
if locked:
|
||||
_end_virtual_mouse()
|
||||
_close_radial_menus()
|
||||
_hotbar_ui.set_drag_enabled(false)
|
||||
if _surface_drawing != null:
|
||||
_surface_drawing.deactivate()
|
||||
_refresh_rv_storage_button_visibility()
|
||||
_refresh_hotbar_visibility()
|
||||
_refresh_chat_availability()
|
||||
_hotbar_ui.set_gameplay_input_enabled(
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
and not _storage_open
|
||||
)
|
||||
_refresh_surface_drawing_activation()
|
||||
|
||||
|
||||
func set_gameplay_hud_hidden(hidden: bool) -> void:
|
||||
_gameplay_hud_hidden = hidden
|
||||
if _quick_radial_menu != null:
|
||||
|
|
@ -1862,6 +1898,7 @@ func is_gameplay_hud_hidden() -> bool:
|
|||
func _can_toggle_gameplay_hud() -> bool:
|
||||
return (
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
|
|
@ -1903,6 +1940,7 @@ func set_system_menu_open(is_open: bool) -> void:
|
|||
_refresh_hotbar_visibility()
|
||||
_hotbar_ui.set_gameplay_input_enabled(
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not is_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
|
|
@ -1995,6 +2033,7 @@ func _refresh_rv_storage_button_visibility() -> void:
|
|||
_rv_storage_button.visible = (
|
||||
_rv_storage_button_requested_visible
|
||||
and _gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _gameplay_hud_hidden
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
|
|
@ -2799,7 +2838,9 @@ func _on_player_menu_visibility_changed(is_open: bool) -> void:
|
|||
_hotbar_ui.set_player_menu_context(false)
|
||||
_refresh_chat_availability()
|
||||
_hotbar_ui.set_gameplay_input_enabled(
|
||||
_gameplay_ui_enabled and not is_open
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not is_open
|
||||
)
|
||||
if not is_open:
|
||||
_hotbar_ui.set_drag_enabled(false)
|
||||
|
|
@ -2844,6 +2885,7 @@ func _on_shop_visibility_changed(is_open: bool) -> void:
|
|||
_refresh_hotbar_visibility()
|
||||
_hotbar_ui.set_gameplay_input_enabled(
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not is_open
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
|
|
@ -2865,6 +2907,7 @@ func _on_storage_visibility_changed(is_open: bool) -> void:
|
|||
_refresh_hotbar_visibility()
|
||||
_hotbar_ui.set_gameplay_input_enabled(
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not is_open
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
|
|
@ -2977,6 +3020,7 @@ func _on_hotbar_presentation_transition_finished(
|
|||
) -> void:
|
||||
_hotbar_ui.set_drag_enabled(
|
||||
presentation_visible
|
||||
and not _gameplay_input_locked
|
||||
and _player_menu_open
|
||||
and _player_menu_hotbar_visible
|
||||
and not _system_menu_open
|
||||
|
|
@ -2986,6 +3030,7 @@ func _on_hotbar_presentation_transition_finished(
|
|||
func _refresh_hotbar_visibility() -> void:
|
||||
_hotbar_ui.set_presentation_visible(
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and (
|
||||
not _gameplay_hud_hidden
|
||||
or (_player_menu_open and _player_menu_hotbar_visible)
|
||||
|
|
@ -3027,6 +3072,7 @@ func _refresh_chat_availability() -> void:
|
|||
return
|
||||
var chat_available := (
|
||||
_gameplay_ui_enabled
|
||||
and not _gameplay_input_locked
|
||||
and not _system_menu_open
|
||||
and not _player_menu_open
|
||||
and not _shop_open
|
||||
|
|
|
|||
|
|
@ -100,7 +100,11 @@ func popup_file_dialog(dialog: FileDialog) -> void:
|
|||
# clamp guarantees the embedded window cannot escape the physical screen.
|
||||
dialog.size = available_size
|
||||
if dialog.get_viewport().gui_embed_subwindows:
|
||||
dialog.position = (host_size - available_size) / 2
|
||||
var centered_position := Vector2i(
|
||||
floori(float(host_size.x - available_size.x) / 2.0),
|
||||
floori(float(host_size.y - available_size.y) / 2.0),
|
||||
)
|
||||
dialog.position = centered_position
|
||||
_finalize_compact_file_dialog.call_deferred(
|
||||
dialog, host_size, available_size
|
||||
)
|
||||
|
|
|
|||
|
|
@ -329,9 +329,9 @@ func _configure_compose_controller_navigation() -> void:
|
|||
and _attachment_amount.is_visible_in_tree()
|
||||
)
|
||||
var amount_left: Control = _amount_minus if amount_visible else _compose_cancel
|
||||
var amount_middle: Control = (
|
||||
_attachment_amount if amount_visible else _compose_cancel
|
||||
)
|
||||
var amount_middle: Control = _compose_cancel
|
||||
if amount_visible:
|
||||
amount_middle = _attachment_amount
|
||||
var amount_right: Control = _amount_plus if amount_visible else _send_button
|
||||
_set_compose_neighbors(
|
||||
_greeting, _greeting, _recipient, _greeting, _body
|
||||
|
|
|
|||
|
|
@ -394,7 +394,10 @@ func _set_mode(mode: Mode, clear_connection_error: bool = true) -> void:
|
|||
_discovery_refresh_timer.stop()
|
||||
if not is_visible_in_tree():
|
||||
return
|
||||
_defer_focus_control(_address if mode == Mode.DIRECT else _server_list)
|
||||
var initial_focus: Control = _server_list
|
||||
if mode == Mode.DIRECT:
|
||||
initial_focus = _address
|
||||
_defer_focus_control(initial_focus)
|
||||
|
||||
|
||||
func _default_mode_status(mode: Mode) -> String:
|
||||
|
|
@ -688,9 +691,10 @@ func _restore_entry_selection_and_focus(
|
|||
_selected_entry = null
|
||||
_server_list.deselect_all()
|
||||
_refresh()
|
||||
_defer_focus_control(
|
||||
_server_list if selected else _current_mode_button()
|
||||
)
|
||||
var restored_focus: Control = _current_mode_button()
|
||||
if selected:
|
||||
restored_focus = _server_list
|
||||
_defer_focus_control(restored_focus)
|
||||
|
||||
|
||||
func _current_mode_button() -> Button:
|
||||
|
|
@ -1203,10 +1207,10 @@ func _recover_controller_focus(
|
|||
) -> void:
|
||||
if not is_visible_in_tree():
|
||||
return
|
||||
var owner: Control = get_viewport().gui_get_focus_owner()
|
||||
if owner != null and owner in controls:
|
||||
var focus_owner: Control = get_viewport().gui_get_focus_owner()
|
||||
if focus_owner != null and focus_owner in controls:
|
||||
return
|
||||
if owner != null and _delete_confirmation.is_ancestor_of(owner):
|
||||
if focus_owner != null and _delete_confirmation.is_ancestor_of(focus_owner):
|
||||
return
|
||||
if fallback != null:
|
||||
_defer_focus_control(fallback)
|
||||
|
|
@ -1539,7 +1543,9 @@ func _on_back_pressed() -> void:
|
|||
if _name_entry_active:
|
||||
_clear_edit_state()
|
||||
_refresh()
|
||||
var content: Control = _address if _mode == Mode.DIRECT else _server_list
|
||||
var content: Control = _server_list
|
||||
if _mode == Mode.DIRECT:
|
||||
content = _address
|
||||
_defer_focus_control(content)
|
||||
return
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -167,8 +167,8 @@ func _on_seed_submitted(_text: String) -> void:
|
|||
|
||||
|
||||
func _request_start() -> void:
|
||||
var seed: int = get_selected_world_seed()
|
||||
if _world_layout == WorldLayoutType.GENERATED and seed == 0:
|
||||
var world_seed: int = get_selected_world_seed()
|
||||
if _world_layout == WorldLayoutType.GENERATED and world_seed == 0:
|
||||
_status.text = (
|
||||
"enter some text or a whole number from 1 to %d."
|
||||
% SaveManagerType.MAX_WORLD_SEED
|
||||
|
|
@ -176,10 +176,10 @@ func _request_start() -> void:
|
|||
_seed_edit.grab_focus()
|
||||
_seed_edit.select_all()
|
||||
return
|
||||
if seed == 0:
|
||||
seed = SaveManagerType.roll_world_seed()
|
||||
if world_seed == 0:
|
||||
world_seed = SaveManagerType.roll_world_seed()
|
||||
_start_button.disabled = true
|
||||
start_requested.emit(_world_layout, seed)
|
||||
start_requested.emit(_world_layout, world_seed)
|
||||
|
||||
|
||||
func _refresh_presentation() -> void:
|
||||
|
|
@ -226,33 +226,43 @@ func _refresh_start_state() -> void:
|
|||
func _configure_controller_focus() -> void:
|
||||
var generated: bool = _world_layout == WorldLayoutType.GENERATED
|
||||
var custom: bool = generated and _seed_mode == SeedMode.CUSTOM
|
||||
var generated_button_bottom: Control = _start_button
|
||||
var starter_button_bottom: Control = _back_button
|
||||
var random_seed_button_bottom: Control = _start_button
|
||||
var custom_seed_button_bottom: Control = _back_button
|
||||
if generated:
|
||||
generated_button_bottom = _random_seed_button
|
||||
starter_button_bottom = _custom_seed_button
|
||||
if custom:
|
||||
random_seed_button_bottom = _seed_edit
|
||||
custom_seed_button_bottom = _seed_edit
|
||||
_set_neighbors(
|
||||
_generated_button,
|
||||
_generated_button,
|
||||
_starter_button,
|
||||
_generated_button,
|
||||
_random_seed_button if generated else _start_button,
|
||||
generated_button_bottom,
|
||||
)
|
||||
_set_neighbors(
|
||||
_starter_button,
|
||||
_generated_button,
|
||||
_starter_button,
|
||||
_starter_button,
|
||||
_custom_seed_button if generated else _back_button,
|
||||
starter_button_bottom,
|
||||
)
|
||||
_set_neighbors(
|
||||
_random_seed_button,
|
||||
_random_seed_button,
|
||||
_custom_seed_button,
|
||||
_generated_button,
|
||||
_seed_edit if custom else _start_button,
|
||||
random_seed_button_bottom,
|
||||
)
|
||||
_set_neighbors(
|
||||
_custom_seed_button,
|
||||
_random_seed_button,
|
||||
_custom_seed_button,
|
||||
_starter_button,
|
||||
_seed_edit if custom else _back_button,
|
||||
custom_seed_button_bottom,
|
||||
)
|
||||
_set_neighbors(
|
||||
_seed_edit,
|
||||
|
|
@ -261,13 +271,11 @@ func _configure_controller_focus() -> void:
|
|||
_custom_seed_button,
|
||||
_start_button,
|
||||
)
|
||||
var action_top: Control = (
|
||||
_seed_edit
|
||||
if custom
|
||||
else _random_seed_button
|
||||
if generated
|
||||
else _generated_button
|
||||
)
|
||||
var action_top: Control = _generated_button
|
||||
if generated:
|
||||
action_top = _random_seed_button
|
||||
if custom:
|
||||
action_top = _seed_edit
|
||||
_set_neighbors(
|
||||
_start_button,
|
||||
_start_button,
|
||||
|
|
|
|||
|
|
@ -710,7 +710,7 @@ func _handle_controller_ownership_input(event: InputEvent) -> bool:
|
|||
if not _is_inventory_section(_current_section):
|
||||
return _handle_active_page_controller_input(event)
|
||||
var button_event := event as InputEventJoypadButton
|
||||
var accept_event: bool = (
|
||||
var accept_button_event: bool = (
|
||||
button_event != null
|
||||
and _event_matches_controller_role(
|
||||
event,
|
||||
|
|
@ -719,7 +719,7 @@ func _handle_controller_ownership_input(event: InputEvent) -> bool:
|
|||
)
|
||||
)
|
||||
var accept_pressed: bool = (
|
||||
accept_event
|
||||
accept_button_event
|
||||
and button_event.pressed
|
||||
)
|
||||
var cancel_pressed: bool = (
|
||||
|
|
@ -777,7 +777,7 @@ func _handle_controller_ownership_input(event: InputEvent) -> bool:
|
|||
if accept_pressed:
|
||||
_confirm_controller_storage_placement()
|
||||
return true
|
||||
if accept_event:
|
||||
if accept_button_event:
|
||||
return true
|
||||
if (
|
||||
event.is_action_pressed("ui_down")
|
||||
|
|
@ -810,7 +810,7 @@ func _handle_controller_ownership_input(event: InputEvent) -> bool:
|
|||
):
|
||||
_cancel_active_item_move()
|
||||
return _try_enter_notepad_controller_ownership()
|
||||
if _current_section == Section.TACKLE_BOX and accept_event:
|
||||
if _current_section == Section.TACKLE_BOX and accept_button_event:
|
||||
# Bait and lures are unlock collections, not movable inventory slots.
|
||||
# Controller Y owns their contextual equip/notepad action; A is
|
||||
# intentionally inert and consumed so it cannot activate the Button.
|
||||
|
|
@ -831,7 +831,7 @@ func _handle_controller_ownership_input(event: InputEvent) -> bool:
|
|||
if _current_section == Section.COOLER:
|
||||
_enter_inventory_sort_zone()
|
||||
return true
|
||||
if accept_event:
|
||||
if accept_button_event:
|
||||
if button_event.pressed:
|
||||
_controller_accept_held = true
|
||||
_controller_accept_hold_elapsed = 0.0
|
||||
|
|
@ -986,11 +986,14 @@ func _controller_focus_is_on_last_inventory_row() -> bool:
|
|||
var slot := focus_owner as GeneralInventorySlotType
|
||||
if slot == null:
|
||||
return false
|
||||
return (
|
||||
slot.slot_index / BAG_STORAGE_COLUMNS
|
||||
>= (_inventory_layout.get_inventory_capacity() - 1)
|
||||
/ BAG_STORAGE_COLUMNS
|
||||
var focused_row: int = int(
|
||||
float(slot.slot_index) / float(BAG_STORAGE_COLUMNS)
|
||||
)
|
||||
var final_row: int = int(
|
||||
float(_inventory_layout.get_inventory_capacity() - 1)
|
||||
/ float(BAG_STORAGE_COLUMNS)
|
||||
)
|
||||
return focused_row >= final_row
|
||||
return false
|
||||
|
||||
|
||||
|
|
@ -1139,10 +1142,13 @@ func _controller_storage_focus_is_on_last_row() -> bool:
|
|||
var slot := get_viewport().gui_get_focus_owner() as BagStorageSlotType
|
||||
if slot == null:
|
||||
return false
|
||||
return (
|
||||
slot.storage_slot_index / BAG_STORAGE_COLUMNS
|
||||
>= (_bag_slot_nodes.size() - 1) / BAG_STORAGE_COLUMNS
|
||||
var focused_row: int = int(
|
||||
float(slot.storage_slot_index) / float(BAG_STORAGE_COLUMNS)
|
||||
)
|
||||
var final_row: int = int(
|
||||
float(_bag_slot_nodes.size() - 1) / float(BAG_STORAGE_COLUMNS)
|
||||
)
|
||||
return focused_row >= final_row
|
||||
|
||||
|
||||
func _find_controller_hotbar_assignment(
|
||||
|
|
@ -4575,11 +4581,6 @@ func _refresh_economy_summary() -> void:
|
|||
if not is_node_ready():
|
||||
return
|
||||
var balance: int = _wallet.get_balance() if _wallet != null else 0
|
||||
var held_total: int = (
|
||||
_inventory.get_total_sale_value()
|
||||
if _inventory != null
|
||||
else 0
|
||||
)
|
||||
_notepad_wallet_value.set_amount(balance)
|
||||
_notepad_capacity_value.text = "%d / %d" % [
|
||||
_inventory.get_all_catches().size() if _inventory != null else 0,
|
||||
|
|
|
|||
|
|
@ -1501,10 +1501,10 @@ func _resize_feature_preview_image(image: Image, max_dimension: int) -> void:
|
|||
var largest_dimension := maxi(source_size.x, source_size.y)
|
||||
if largest_dimension <= max_dimension:
|
||||
return
|
||||
var scale := float(max_dimension) / float(largest_dimension)
|
||||
var resize_scale := float(max_dimension) / float(largest_dimension)
|
||||
image.resize(
|
||||
maxi(roundi(float(source_size.x) * scale), 1),
|
||||
maxi(roundi(float(source_size.y) * scale), 1),
|
||||
maxi(roundi(float(source_size.x) * resize_scale), 1),
|
||||
maxi(roundi(float(source_size.y) * resize_scale), 1),
|
||||
Image.INTERPOLATE_NEAREST,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ const SECTOR_COUNT: int = 3
|
|||
var _hud_hidden: bool = false
|
||||
|
||||
|
||||
func set_hud_hidden(hidden: bool) -> void:
|
||||
_hud_hidden = hidden
|
||||
func set_hud_hidden(is_hidden: bool) -> void:
|
||||
_hud_hidden = is_hidden
|
||||
_refresh_labels()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -509,21 +509,21 @@ func _export_file_selected(path: String) -> void:
|
|||
func _request_create() -> void:
|
||||
if _create_button.disabled:
|
||||
return
|
||||
var seed: int = _selected_world_seed()
|
||||
if _world_layout == WorldLayoutType.GENERATED and seed == 0:
|
||||
var world_seed: int = _selected_world_seed()
|
||||
if _world_layout == WorldLayoutType.GENERATED and world_seed == 0:
|
||||
_status.text = "enter text or a whole number from 1 to %d." % SaveManagerType.MAX_WORLD_SEED
|
||||
_seed_edit.grab_focus()
|
||||
_seed_edit.select_all()
|
||||
return
|
||||
if seed == 0:
|
||||
seed = SaveManagerType.roll_world_seed()
|
||||
if world_seed == 0:
|
||||
world_seed = SaveManagerType.roll_world_seed()
|
||||
_busy = true
|
||||
_status.text = "creating save slot..."
|
||||
_refresh_action_state()
|
||||
create_requested.emit(
|
||||
PlayerSaveSlotCatalog.normalized_name(_new_slot_name.text),
|
||||
_world_layout,
|
||||
seed,
|
||||
world_seed,
|
||||
_duplicate_source_slot_id,
|
||||
)
|
||||
|
||||
|
|
@ -656,13 +656,27 @@ func _configure_controller_focus() -> void:
|
|||
_new_slot_tab.focus_neighbor_bottom = _new_slot_tab.get_path_to(_new_slot_name)
|
||||
var generated: bool = _world_layout == WorldLayoutType.GENERATED
|
||||
var custom: bool = generated and _seed_mode == SeedMode.CUSTOM
|
||||
var generated_button_bottom: Control = _create_button
|
||||
var starter_button_bottom: Control = _back_button
|
||||
var random_seed_button_bottom: Control = _create_button
|
||||
var custom_seed_button_bottom: Control = _back_button
|
||||
if generated:
|
||||
generated_button_bottom = _random_seed_button
|
||||
starter_button_bottom = _custom_seed_button
|
||||
if custom:
|
||||
random_seed_button_bottom = _seed_edit
|
||||
custom_seed_button_bottom = _seed_edit
|
||||
_set_neighbors(_new_slot_name, _new_slot_name, _new_slot_name, _new_slot_tab, _generated_button)
|
||||
_set_neighbors(_generated_button, _generated_button, _starter_button, _new_slot_name, _random_seed_button if generated else _create_button)
|
||||
_set_neighbors(_starter_button, _generated_button, _starter_button, _new_slot_name, _custom_seed_button if generated else _back_button)
|
||||
_set_neighbors(_random_seed_button, _random_seed_button, _custom_seed_button, _generated_button, _seed_edit if custom else _create_button)
|
||||
_set_neighbors(_custom_seed_button, _random_seed_button, _custom_seed_button, _starter_button, _seed_edit if custom else _back_button)
|
||||
_set_neighbors(_generated_button, _generated_button, _starter_button, _new_slot_name, generated_button_bottom)
|
||||
_set_neighbors(_starter_button, _generated_button, _starter_button, _new_slot_name, starter_button_bottom)
|
||||
_set_neighbors(_random_seed_button, _random_seed_button, _custom_seed_button, _generated_button, random_seed_button_bottom)
|
||||
_set_neighbors(_custom_seed_button, _random_seed_button, _custom_seed_button, _starter_button, custom_seed_button_bottom)
|
||||
_set_neighbors(_seed_edit, _seed_edit, _seed_edit, _custom_seed_button, _create_button)
|
||||
var action_top: Control = _seed_edit if custom else _random_seed_button if generated else _generated_button
|
||||
var action_top: Control = _generated_button
|
||||
if generated:
|
||||
action_top = _random_seed_button
|
||||
if custom:
|
||||
action_top = _seed_edit
|
||||
_set_neighbors(_create_button, _create_button, _back_button, action_top, _create_button)
|
||||
_set_neighbors(_back_button, _create_button, _back_button, action_top, _back_button)
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ const INTRO_MENU_REVEAL_DURATION: float = 0.30
|
|||
const INTRO_LOGO_CENTER_Y_RATIO: float = 0.43
|
||||
|
||||
signal new_game_requested(world_layout: StringName, world_seed: int)
|
||||
@warning_ignore("unused_signal")
|
||||
signal continue_game_requested
|
||||
signal slot_play_requested(slot_id: String)
|
||||
signal new_slot_requested(
|
||||
|
|
@ -89,7 +90,6 @@ enum ConfirmationAction {
|
|||
@onready var _title_presentation_scale_root: Control = (
|
||||
%TitlePresentationScaleRoot
|
||||
)
|
||||
@onready var _background: ColorRect = %Background
|
||||
@onready var _title_logo: TextureRect = %TitleLogo
|
||||
@onready var _playtest_label: Label = %PlaytestLabel
|
||||
@onready var _presentation_center: CenterContainer = %Center
|
||||
|
|
@ -1081,7 +1081,6 @@ func _on_confirmation_accepted() -> void:
|
|||
or _confirmation_action == ConfirmationAction.NONE
|
||||
):
|
||||
return
|
||||
var action: ConfirmationAction = _confirmation_action
|
||||
_confirmation_page.lock_interaction()
|
||||
_action_in_progress = true
|
||||
if not _save_manager.delete_progression_save():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue