diff --git a/src/characters/player_characters/character_controller.gd b/src/characters/player_characters/character_controller.gd index 798ca01..0c22c4e 100644 --- a/src/characters/player_characters/character_controller.gd +++ b/src/characters/player_characters/character_controller.gd @@ -22,7 +22,7 @@ func hold_right(node: Node3D = null) -> void: ## Set this character's color. Implementation-dependent. -func set_color(color: Color) -> void: +func set_color(_color: Color) -> void: pass diff --git a/src/equipment/balls/physics_ball/game_ball.gd b/src/equipment/balls/physics_ball/game_ball.gd index 52ed1f6..7ec49da 100644 --- a/src/equipment/balls/physics_ball/game_ball.gd +++ b/src/equipment/balls/physics_ball/game_ball.gd @@ -57,8 +57,6 @@ var _zones: Array[BallZone] = [] "res://src/equipment/balls/physics_ball/normal_physics.tres" ) -@onready var _debug_draw: Control = %DebugDraw - ## Should this ball stick to surfaces, rather than bounce? func is_sticky() -> bool: diff --git a/src/ui/3d/projectile_arc/projectile_arc.gd b/src/ui/3d/projectile_arc/projectile_arc.gd index 5e2ff43..7cb4f77 100644 --- a/src/ui/3d/projectile_arc/projectile_arc.gd +++ b/src/ui/3d/projectile_arc/projectile_arc.gd @@ -99,6 +99,7 @@ func _process(_delta: float) -> void: pos = collision["position"] _debug_points.append(pos) if putt_projection: + @warning_ignore("unsafe_cast") var norm: Vector3 = (collision["normal"] as Vector3).normalized() next_pos = pos + norm * 0.05 vel = PUTT_ATTRITION * (vel - 2 * norm * vel.dot(norm)) @@ -143,6 +144,7 @@ func _get_gravity(point: Vector3) -> Vector3: point_params.position = point var collisions := get_world_3d().direct_space_state.intersect_point(point_params) var gravity_areas: Array[Area3D] = [] + @warning_ignore("unsafe_cast") gravity_areas.assign( collisions.map(func(d: Dictionary) -> Area3D: return d["collider"] as Area3D) ) diff --git a/src/ui/elements/checker_container.gd b/src/ui/elements/checker_container.gd index 663f3b7..1df47f5 100644 --- a/src/ui/elements/checker_container.gd +++ b/src/ui/elements/checker_container.gd @@ -12,7 +12,7 @@ func _ready() -> void: func _is_even_child() -> bool: var parent := get_parent() - return parent.get_children().find(self) % 2 if parent else false + return parent.get_children().find(self) % 2 == 0 if parent else false func _recompute() -> void: diff --git a/src/ui/elements/input_prompt/input_prompt.gd b/src/ui/elements/input_prompt/input_prompt.gd index 99614a5..2579ec4 100644 --- a/src/ui/elements/input_prompt/input_prompt.gd +++ b/src/ui/elements/input_prompt/input_prompt.gd @@ -27,7 +27,7 @@ func _update() -> void: text = PROMPT_FORMAT.format( [ - input_symbol if input_symbol else PromptMap.UNKNOWN_INPUT_SYMBOL, - loc_action if loc_action else action + input_symbol if input_symbol else str(PromptMap.UNKNOWN_INPUT_SYMBOL), + loc_action if loc_action else str(action) ] ) diff --git a/src/ui/menus/settings_menu/settings/checkbox_setting/checkbox_setting.gd b/src/ui/menus/settings_menu/settings/checkbox_setting/checkbox_setting.gd index 5b31190..f669165 100644 --- a/src/ui/menus/settings_menu/settings/checkbox_setting/checkbox_setting.gd +++ b/src/ui/menus/settings_menu/settings/checkbox_setting/checkbox_setting.gd @@ -5,6 +5,7 @@ extends Setting func initialize_value(value: Variant) -> void: + @warning_ignore("unsafe_cast") checkbox.button_pressed = value as bool diff --git a/src/ui/menus/settings_menu/settings/checkbox_setting/fullscreen_setting.gd b/src/ui/menus/settings_menu/settings/checkbox_setting/fullscreen_setting.gd index e9c762c..69f1024 100644 --- a/src/ui/menus/settings_menu/settings/checkbox_setting/fullscreen_setting.gd +++ b/src/ui/menus/settings_menu/settings/checkbox_setting/fullscreen_setting.gd @@ -3,6 +3,7 @@ extends "res://src/ui/menus/settings_menu/settings/checkbox_setting/checkbox_set func initialize_value(value: Variant) -> void: + @warning_ignore("unsafe_cast") checkbox.button_pressed = (value as Window.Mode) == Window.MODE_FULLSCREEN diff --git a/src/ui/menus/settings_menu/settings/dropdown_setting/dropdown_setting.gd b/src/ui/menus/settings_menu/settings/dropdown_setting/dropdown_setting.gd index 3a54b6f..ad401ff 100644 --- a/src/ui/menus/settings_menu/settings/dropdown_setting/dropdown_setting.gd +++ b/src/ui/menus/settings_menu/settings/dropdown_setting/dropdown_setting.gd @@ -5,6 +5,7 @@ extends Setting func initialize_value(value: Variant) -> void: + @warning_ignore("unsafe_cast") dropdown.selected = dropdown.get_item_index(value as int) diff --git a/src/ui/menus/settings_menu/settings/numeric_setting/numeric_setting.gd b/src/ui/menus/settings_menu/settings/numeric_setting/numeric_setting.gd index 1b0a079..e1c1360 100644 --- a/src/ui/menus/settings_menu/settings/numeric_setting/numeric_setting.gd +++ b/src/ui/menus/settings_menu/settings/numeric_setting/numeric_setting.gd @@ -5,6 +5,7 @@ extends Setting func initialize_value(value: Variant) -> void: + @warning_ignore("unsafe_cast") slider.value = value as float diff --git a/src/ui/shot_hud/curve_bar/curve_bar.gd b/src/ui/shot_hud/curve_bar/curve_bar.gd index bb7ae64..67f67e1 100644 --- a/src/ui/shot_hud/curve_bar/curve_bar.gd +++ b/src/ui/shot_hud/curve_bar/curve_bar.gd @@ -15,7 +15,7 @@ const PIVOT_SCALE := -PI / 4 if pivot: pivot.rotation = v * PIVOT_SCALE get: - return pivot.rotation / PIVOT_SCALE if pivot else 0 + return pivot.rotation / PIVOT_SCALE if pivot else 0.0 @onready var pivot: Control = %Pivot @onready var gradient_fill: TextureRect = %GradientFill diff --git a/src/util/prompt_map.gd b/src/util/prompt_map.gd index d5f6d97..4931f50 100644 --- a/src/util/prompt_map.gd +++ b/src/util/prompt_map.gd @@ -227,11 +227,13 @@ static func key(event: InputEventKey) -> String: return OS.get_keycode_string( DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode) ) + @warning_ignore("unsafe_cast") return _compose_modifiers(event, KEYBOARD[event.physical_keycode] as String) ## Get the symbol representing the given mouse button event. static func mouse_button(event: InputEventMouseButton) -> String: + @warning_ignore("unsafe_cast") return _compose_modifiers(event, MOUSE.get(event.button_index, UNKNOWN_INPUT_SYMBOL) as String) diff --git a/src/world/terrain.gd b/src/world/terrain.gd index 41f3ace..28e5405 100644 --- a/src/world/terrain.gd +++ b/src/world/terrain.gd @@ -63,7 +63,7 @@ static func at_position(global_position: Vector3, terrain3d: Terrain3D) -> Type: var blend := terrain3d.data.get_texture_id(global_position) var id: int if terrain3d.data.get_control_auto(global_position): - id = blend.x if blend.z > 0 else blend.y + id = int(blend.x if blend.z > 0 else blend.y) else: - id = blend.x + id = int(blend.x) return from_texture_id(id)