generated from krampus/template-godot4
Fixes for various interpreter warnings
This commit is contained in:
parent
06c4d859a8
commit
5678bd543b
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
]
|
||||
)
|
||||
|
|
|
@ -5,6 +5,7 @@ extends Setting
|
|||
|
||||
|
||||
func initialize_value(value: Variant) -> void:
|
||||
@warning_ignore("unsafe_cast")
|
||||
checkbox.button_pressed = value as bool
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ extends Setting
|
|||
|
||||
|
||||
func initialize_value(value: Variant) -> void:
|
||||
@warning_ignore("unsafe_cast")
|
||||
slider.value = value as float
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue