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.
|
## Set this character's color. Implementation-dependent.
|
||||||
func set_color(color: Color) -> void:
|
func set_color(_color: Color) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,6 @@ var _zones: Array[BallZone] = []
|
||||||
"res://src/equipment/balls/physics_ball/normal_physics.tres"
|
"res://src/equipment/balls/physics_ball/normal_physics.tres"
|
||||||
)
|
)
|
||||||
|
|
||||||
@onready var _debug_draw: Control = %DebugDraw
|
|
||||||
|
|
||||||
|
|
||||||
## Should this ball stick to surfaces, rather than bounce?
|
## Should this ball stick to surfaces, rather than bounce?
|
||||||
func is_sticky() -> bool:
|
func is_sticky() -> bool:
|
||||||
|
|
|
@ -99,6 +99,7 @@ func _process(_delta: float) -> void:
|
||||||
pos = collision["position"]
|
pos = collision["position"]
|
||||||
_debug_points.append(pos)
|
_debug_points.append(pos)
|
||||||
if putt_projection:
|
if putt_projection:
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
var norm: Vector3 = (collision["normal"] as Vector3).normalized()
|
var norm: Vector3 = (collision["normal"] as Vector3).normalized()
|
||||||
next_pos = pos + norm * 0.05
|
next_pos = pos + norm * 0.05
|
||||||
vel = PUTT_ATTRITION * (vel - 2 * norm * vel.dot(norm))
|
vel = PUTT_ATTRITION * (vel - 2 * norm * vel.dot(norm))
|
||||||
|
@ -143,6 +144,7 @@ func _get_gravity(point: Vector3) -> Vector3:
|
||||||
point_params.position = point
|
point_params.position = point
|
||||||
var collisions := get_world_3d().direct_space_state.intersect_point(point_params)
|
var collisions := get_world_3d().direct_space_state.intersect_point(point_params)
|
||||||
var gravity_areas: Array[Area3D] = []
|
var gravity_areas: Array[Area3D] = []
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
gravity_areas.assign(
|
gravity_areas.assign(
|
||||||
collisions.map(func(d: Dictionary) -> Area3D: return d["collider"] as Area3D)
|
collisions.map(func(d: Dictionary) -> Area3D: return d["collider"] as Area3D)
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,7 +12,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
func _is_even_child() -> bool:
|
func _is_even_child() -> bool:
|
||||||
var parent := get_parent()
|
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:
|
func _recompute() -> void:
|
||||||
|
|
|
@ -27,7 +27,7 @@ func _update() -> void:
|
||||||
|
|
||||||
text = PROMPT_FORMAT.format(
|
text = PROMPT_FORMAT.format(
|
||||||
[
|
[
|
||||||
input_symbol if input_symbol else PromptMap.UNKNOWN_INPUT_SYMBOL,
|
input_symbol if input_symbol else str(PromptMap.UNKNOWN_INPUT_SYMBOL),
|
||||||
loc_action if loc_action else action
|
loc_action if loc_action else str(action)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,6 +5,7 @@ extends Setting
|
||||||
|
|
||||||
|
|
||||||
func initialize_value(value: Variant) -> void:
|
func initialize_value(value: Variant) -> void:
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
checkbox.button_pressed = value as bool
|
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:
|
func initialize_value(value: Variant) -> void:
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
checkbox.button_pressed = (value as Window.Mode) == Window.MODE_FULLSCREEN
|
checkbox.button_pressed = (value as Window.Mode) == Window.MODE_FULLSCREEN
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ extends Setting
|
||||||
|
|
||||||
|
|
||||||
func initialize_value(value: Variant) -> void:
|
func initialize_value(value: Variant) -> void:
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
dropdown.selected = dropdown.get_item_index(value as int)
|
dropdown.selected = dropdown.get_item_index(value as int)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ extends Setting
|
||||||
|
|
||||||
|
|
||||||
func initialize_value(value: Variant) -> void:
|
func initialize_value(value: Variant) -> void:
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
slider.value = value as float
|
slider.value = value as float
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ const PIVOT_SCALE := -PI / 4
|
||||||
if pivot:
|
if pivot:
|
||||||
pivot.rotation = v * PIVOT_SCALE
|
pivot.rotation = v * PIVOT_SCALE
|
||||||
get:
|
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 pivot: Control = %Pivot
|
||||||
@onready var gradient_fill: TextureRect = %GradientFill
|
@onready var gradient_fill: TextureRect = %GradientFill
|
||||||
|
|
|
@ -227,11 +227,13 @@ static func key(event: InputEventKey) -> String:
|
||||||
return OS.get_keycode_string(
|
return OS.get_keycode_string(
|
||||||
DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode)
|
DisplayServer.keyboard_get_keycode_from_physical(event.physical_keycode)
|
||||||
)
|
)
|
||||||
|
@warning_ignore("unsafe_cast")
|
||||||
return _compose_modifiers(event, KEYBOARD[event.physical_keycode] as String)
|
return _compose_modifiers(event, KEYBOARD[event.physical_keycode] as String)
|
||||||
|
|
||||||
|
|
||||||
## Get the symbol representing the given mouse button event.
|
## Get the symbol representing the given mouse button event.
|
||||||
static func mouse_button(event: InputEventMouseButton) -> String:
|
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)
|
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 blend := terrain3d.data.get_texture_id(global_position)
|
||||||
var id: int
|
var id: int
|
||||||
if terrain3d.data.get_control_auto(global_position):
|
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:
|
else:
|
||||||
id = blend.x
|
id = int(blend.x)
|
||||||
return from_texture_id(id)
|
return from_texture_id(id)
|
||||||
|
|
Loading…
Reference in New Issue