Clean repository-owned GDScript warnings

This commit is contained in:
Alexander Sellite 2026-08-09 13:31:30 -04:00
parent ff536e62a6
commit 1284619079
17 changed files with 60 additions and 74 deletions

View file

@ -340,13 +340,13 @@ func _sample_cell_transform(
tangent = Vector3.RIGHT
var bitangent: Vector3 = normal.cross(tangent).normalized()
var pixel_size: float = cell_size * clampf(fill, 0.05, 1.0)
var basis := Basis(
var cell_basis := Basis(
tangent * pixel_size,
bitangent * pixel_size,
normal,
)
return Transform3D(
basis,
cell_basis,
to_local(point + normal * _surface_offset()),
)

View file

@ -143,7 +143,7 @@ func start_authoritative_encounter(
profile: CatchDifficultyProfileType,
reel_speed: float,
click_power: int,
seed: int,
encounter_seed_value: int,
fish_quality: int = FishQualityType.Tier.BORING,
fish_rarity: int = 0,
fish_weight_percentile: float = 0.0,
@ -151,7 +151,7 @@ func start_authoritative_encounter(
var previous_test_mode: bool = use_deterministic_test_seed
var previous_seed: int = deterministic_test_seed
use_deterministic_test_seed = true
deterministic_test_seed = seed
deterministic_test_seed = encounter_seed_value
start_encounter(
profile,
reel_speed,

View file

@ -1270,11 +1270,11 @@ static func _natural_interval_crosses_hour(
)
func _set_player_menu_backdrop_visible(is_visible: bool) -> void:
func _set_player_menu_backdrop_visible(requested_visible: bool) -> void:
if _player_menu_backdrop_tween != null:
_player_menu_backdrop_tween.kill()
_player_menu_backdrop_tween = null
var should_show: bool = is_visible and _gameplay_started
var should_show: bool = requested_visible and _gameplay_started
if should_show:
var was_visible: bool = _player_menu_backdrop.visible
_player_menu_backdrop.visible = true
@ -1305,11 +1305,11 @@ func _set_player_menu_backdrop_visible(is_visible: bool) -> void:
)
func _set_shop_backdrop_visible(is_visible: bool) -> void:
func _set_shop_backdrop_visible(requested_visible: bool) -> void:
if _shop_backdrop_tween != null:
_shop_backdrop_tween.kill()
_shop_backdrop_tween = null
var should_show: bool = is_visible and _gameplay_started
var should_show: bool = requested_visible and _gameplay_started
if should_show:
var was_visible: bool = _shop_backdrop.visible
_shop_backdrop.visible = true

View file

@ -1,6 +1,7 @@
class_name NetworkTransport
extends Node
@warning_ignore("unused_signal")
signal transport_error(message: String)
var _peer: MultiplayerPeer

View file

@ -913,7 +913,7 @@ func _add_button_action_binding(action: StringName, value: Variant) -> void:
return
var event := InputEventJoypadButton.new()
event.device = _active_device_id
event.button_index = int(binding.get("button", -1))
event.button_index = int(binding.get("button", -1)) as JoyButton
InputMap.action_add_event(action, event)
@ -932,7 +932,7 @@ func _add_axis_action_binding(
)
var event := InputEventJoypadMotion.new()
event.device = _active_device_id
event.axis = int(binding.get("axis", -1))
event.axis = int(binding.get("axis", -1)) as JoyAxis
event.axis_value = logical_direction * -captured_negative_direction
InputMap.action_add_event(action, event)

View file

@ -34,13 +34,13 @@ func _ready() -> void:
func speak_text(
owner: Node,
tween_owner: Node,
text: String,
voice_key: String,
voice_profile_id: String = VoiceProfilesType.DEFAULT_ID,
characters_per_second: float = -1.0,
) -> Tween:
var speech_tween := owner.create_tween()
var speech_tween := tween_owner.create_tween()
var resolved_characters_per_second := (
characters_per_second
if characters_per_second > 0.0
@ -108,7 +108,8 @@ func _play_character(
- 0.5
) * 0.10
var question_lift := 0.0
if full_text.ends_with("?") and character_index >= full_text.length() * 3 / 4:
var question_lift_start: int = floori(float(full_text.length()) * 0.75)
if full_text.ends_with("?") and character_index >= question_lift_start:
var final_progress := (
float(character_index) / maxf(float(full_text.length() - 1), 1.0)
)

View file

@ -93,14 +93,14 @@ func _initialize_motion() -> void:
_set_visual_y(_target_y())
func _on_toggled(pressed: bool) -> void:
if _selected and not pressed:
func _on_toggled(is_pressed: bool) -> void:
if _selected and not is_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 = pressed
_selected = is_pressed
refresh_state()

View file

@ -389,22 +389,22 @@ func _accept_captured_binding(binding: Dictionary) -> void:
ControllerMappingManagerType.ROLE_ORDER[_auto_map_index]
)
return
var saved: bool = _mapping_manager.replace_active_bindings(
var profile_saved: bool = _mapping_manager.replace_active_bindings(
_auto_map_draft
)
_cancel_capture()
_progress_label.text = (
"controller mapped successfully"
if saved else "could not save the controller mapping"
if profile_saved else "could not save the controller mapping"
)
_refresh_bindings()
return
var role: StringName = _capturing_role
var saved: bool = _mapping_manager.set_binding(role, binding)
var binding_saved: bool = _mapping_manager.set_binding(role, binding)
_cancel_capture()
_progress_label.text = (
"updated " + _mapping_manager.get_role_label(role)
if saved else "could not save that controller input"
if binding_saved else "could not save that controller input"
)
_refresh_bindings()

View file

@ -525,7 +525,7 @@ func _refresh_supplies() -> void:
FishingShopStockType.get_price(item_id),
owned,
]
var tooltip_text: String = item.description
var item_tooltip_text: String = item.description
if bait_topoff:
if item.icon != null:
button.custom_minimum_size = Vector2(72, 72)
@ -543,7 +543,7 @@ func _refresh_supplies() -> void:
item.max_stack,
]
)
tooltip_text = (
item_tooltip_text = (
"%s\nunlock $%d • fills to %d/%d\n%s" % [
item.display_name,
total_cost,
@ -573,7 +573,7 @@ func _refresh_supplies() -> void:
button.tooltip_text = (
"Purchases are unavailable in this session."
if _network_shop == null or not _network_shop.can_request_purchase()
else tooltip_text
else item_tooltip_text
)
UtilityPageStyleType.apply_ocean_button(button)
button.pressed.connect(_purchase_supply.bind(item_id))

View file

@ -125,7 +125,6 @@ const SHOP_NPC_SPEECH_COOLDOWN_MILLISECONDS: int = 5000
@onready var _canonical_stage: Control = %CanonicalStage
@onready var _ui_root: Control = %UIRoot
@onready var _player_menu: PlayerMenuType = %PlayerMenu
@onready var _screen_fade: ScreenFade = %ScreenFade
@onready var _title_screen: TitleScreenType = %TitleScreen
@ -1458,12 +1457,12 @@ func get_fishing_shop() -> FishingShopType:
func set_shop_prompt_visible(
is_visible: bool,
requested_visible: bool,
world_anchor: Vector3 = Vector3(0.0, INF, 0.0),
) -> void:
_apply_shop_prompt_style()
_shop_prompt.visible = (
is_visible
requested_visible
and _gameplay_ui_enabled
and not _system_menu_open
and not _player_menu_open
@ -1688,8 +1687,8 @@ func _refresh_fishing_panel_visibility() -> void:
)
func _on_bite_prompt_changed(is_visible: bool) -> void:
_bite_prompt_button.visible = is_visible
func _on_bite_prompt_changed(prompt_visible: bool) -> void:
_bite_prompt_button.visible = prompt_visible
_refresh_fishing_panel_visibility()
@ -1705,10 +1704,10 @@ func _on_catch_display_changed(
barrier_health: PackedInt32Array,
_barrier_max_health: PackedInt32Array,
active_barrier_index: int,
visible: bool,
encounter_requested_visible: bool,
) -> void:
var encounter_visible: bool = (
visible
encounter_requested_visible
and _fishing_spot != null
and _fishing_spot.is_fighting()
)
@ -1789,10 +1788,10 @@ func _on_showcase_changed(
rarity_name: String,
weight_lb: float,
quality: int,
visible: bool,
showcase_visible: bool,
) -> void:
_showcase_active = visible
if not visible:
_showcase_active = showcase_visible
if not showcase_visible:
_set_fishing_panel_showcase_position(false)
_showcase_details.text = ""
_showcase_details.visible = false
@ -2195,10 +2194,10 @@ func _on_controller_hotbar_management_ended() -> void:
func _on_hotbar_presentation_transition_finished(
is_visible: bool,
presentation_visible: bool,
) -> void:
_hotbar_ui.set_drag_enabled(
is_visible
presentation_visible
and _player_menu_open
and _player_menu_hotbar_visible
and not _system_menu_open

View file

@ -355,7 +355,7 @@ func _make_scroll_indicator(
return indicator
func _on_catalog_scroll_value_changed(value: float) -> void:
func _on_catalog_scroll_value_changed(_value: float) -> void:
if _snapping_catalog_scroll:
return
_catalog_scroll_snap_timer.start()

View file

@ -1,8 +1,6 @@
class_name MailPage
extends Control
signal focus_requested
const GREETING_LABELS := {
"dear": "Dear",
"to": "To",

View file

@ -214,7 +214,6 @@ const SALE_CONFIRMATION_SIZE := Vector2(520.0, 190.0)
@onready var _bag_item_field: Control = %BagItemField
@onready var _bag_empty_state: Label = %BagEmptyState
@onready var _bag_detail_constellation: Control = %BagDetailConstellation
@onready var _bag_sprite_detail_bubble: Control = %BagDetailBubble
@onready var _bag_sprite_detail_texture: TextureRect = %BagSpriteDetailTexture
@onready var _bag_sprite_detail_name: Label = %BagSpriteDetailName
@onready var _bag_sprite_detail_data: Label = %BagSpriteDetailData
@ -228,7 +227,6 @@ const SALE_CONFIRMATION_SIZE := Vector2(520.0, 190.0)
@onready var _book_spread: BoxContainer = %BookSpread
@onready var _left_page: PanelContainer = %LeftPage
@onready var _right_page: PanelContainer = %RightPage
@onready var _book_gutter: ColorRect = %BookGutter
@onready var _left_heading: Label = %LeftHeading
@onready var _right_heading: Label = %RightHeading
@onready var _left_entry_field: BoxContainer = %LeftEntryField
@ -259,7 +257,6 @@ const SALE_CONFIRMATION_SIZE := Vector2(520.0, 190.0)
@onready var _offer_status: BubbleStatusBubbleType = %OfferStatus
@onready var _inventory_section: Control = %InventorySection
@onready var _bag_section: Control = %BagSection
@onready var _logbook_section: Control = %LogbookSection
@onready var _bag_empty: Label = %BagEmpty
@onready var _bag_grid: GridContainer = %BagGrid
@onready var _bag_list: Control = %BagList
@ -272,9 +269,6 @@ const SALE_CONFIRMATION_SIZE := Vector2(520.0, 190.0)
@onready var _held_value: Label = %HeldValue
@onready var _cooler_count: Label = %CoolerCount
@onready var _inventory_empty: Label = %InventoryEmpty
@onready var _detail_texture: TextureRect = %DetailTexture
@onready var _detail_name: Label = %DetailName
@onready var _detail_data: Label = %DetailData
@onready var _selection_summary: Label = %SelectionSummary
@onready var _favorite_button: Button = %FavoriteButton
@onready var _sell_button: Button = %SellButton
@ -285,7 +279,6 @@ const SALE_CONFIRMATION_SIZE := Vector2(520.0, 190.0)
@onready var _confirm_sale_button: Button = %ConfirmSaleButton
@onready var _cancel_sale_button: Button = %CancelSaleButton
@onready var _logbook_empty: Label = %LogbookEmpty
@onready var _logbook_grid: GridContainer = %LogbookGrid
var _compact_layout: bool = false
var _player: PlayerType
@ -1196,11 +1189,9 @@ func _collect_visible_toggle_buttons(
or not navigation_cluster.is_ancestor_of(button)
)
):
var group_key: Variant = (
button.button_group
if button.button_group != null
else button.get_parent()
)
var group_key: Variant = button.get_parent()
if button.button_group != null:
group_key = button.button_group
if not grouped_buttons.has(group_key):
grouped_buttons[group_key] = []
var buttons := grouped_buttons[group_key] as Array
@ -3355,7 +3346,7 @@ func _update_bag_detail() -> void:
item_state = "equippable"
elif item.usable:
item_state = "usable"
_bag_detail_texture.texture = item.icon if item != null else null
_bag_detail_texture.texture = null
_bag_detail_name.text = item.display_name if item != null else ""
_bag_detail_data.text = (
"%s\nquantity: %d\n%s\n%s\n%s"
@ -3369,7 +3360,10 @@ func _update_bag_detail() -> void:
if item != null
else "select a bag item for details."
)
_bag_sprite_detail_texture.texture = item.icon if item != null else null
_bag_sprite_detail_texture.texture = null
if item != null:
_bag_detail_texture.texture = item.icon
_bag_sprite_detail_texture.texture = item.icon
_bag_sprite_detail_name.text = (
item.display_name if item != null else ""
)
@ -3857,11 +3851,6 @@ func _update_inventory_detail(fish_catch: FishCatchType) -> void:
_favorite_bubble.refresh_ink_state()
_detail_constellation.visible = _current_section == Section.COOLER
_cooler_sort_controls.visible = true
var detail_interactive: bool = (
_detail_constellation.visible
and not _transitioning
and not _page_transitioning
)
_refresh_cooler_notepad_action_interactivity()
_configure_cooler_fish_focus()
@ -3881,16 +3870,12 @@ func _refresh_cooler_notepad_action_interactivity() -> void:
_sell_all_bubble,
]:
var action_interactive: bool = detail_interactive and not action.disabled
action.focus_mode = (
Control.FOCUS_ALL
if action_interactive
else Control.FOCUS_NONE
)
action.mouse_filter = (
Control.MOUSE_FILTER_STOP
if action_interactive
else Control.MOUSE_FILTER_IGNORE
)
if action_interactive:
action.focus_mode = Control.FOCUS_ALL
action.mouse_filter = Control.MOUSE_FILTER_STOP
else:
action.focus_mode = Control.FOCUS_NONE
action.mouse_filter = Control.MOUSE_FILTER_IGNORE
action.refresh_ink_state()

View file

@ -720,7 +720,7 @@ func _identity_operation_allowed() -> bool:
return true
func _on_identity_operation_finished(success: bool, message: String) -> void:
func _on_identity_operation_finished(_success: bool, message: String) -> void:
_feedback.text = message

View file

@ -39,10 +39,10 @@ func set_weather(weather: WorldWeatherService.Weather) -> void:
queue_redraw()
func set_nighttime(is_nighttime: bool) -> void:
if _is_nighttime == is_nighttime:
func set_nighttime(nighttime: bool) -> void:
if _is_nighttime == nighttime:
return
_is_nighttime = is_nighttime
_is_nighttime = nighttime
queue_redraw()

View file

@ -133,9 +133,9 @@ func _apply_foliage_wind_to_mesh(mesh_instance: MeshInstance3D) -> void:
if mesh_instance.mesh == null:
return
var bounds: AABB = mesh_instance.get_aabb()
var global_scale: Vector3 = mesh_instance.global_basis.get_scale().abs()
var mesh_global_scale: Vector3 = mesh_instance.global_basis.get_scale().abs()
var horizontal_scale: float = maxf(
(global_scale.x + global_scale.z) * 0.5,
(mesh_global_scale.x + mesh_global_scale.z) * 0.5,
0.001,
)
var local_strength: float = foliage_wind_strength / horizontal_scale

View file

@ -481,4 +481,6 @@ static func _mesh_triangle_count(mesh: ArrayMesh) -> int:
if mesh.get_surface_count() == 0:
return 0
var arrays := mesh.surface_get_arrays(0)
return (arrays[Mesh.ARRAY_INDEX] as PackedInt32Array).size() / 3
return floori(
float((arrays[Mesh.ARRAY_INDEX] as PackedInt32Array).size()) / 3.0
)