Improve interface accessibility and UI reliability
This commit is contained in:
parent
ba4476511f
commit
3734d4a168
29 changed files with 514 additions and 224 deletions
|
|
@ -216,12 +216,12 @@ func show_bite() -> void:
|
|||
_bite_tween.finished.connect(_on_bite_tween_finished)
|
||||
|
||||
|
||||
func show_withdrawal_position(position: Vector3) -> void:
|
||||
func show_withdrawal_position(world_position: Vector3) -> void:
|
||||
if _mode != VisualMode.FISHING:
|
||||
return
|
||||
|
||||
_kill_active_tween()
|
||||
_bobber.global_position = _with_water_height(position)
|
||||
_bobber.global_position = _with_water_height(world_position)
|
||||
|
||||
|
||||
func begin_reeling() -> void:
|
||||
|
|
@ -232,12 +232,12 @@ func begin_reeling() -> void:
|
|||
_cast_position = _with_water_height(_bobber.global_position)
|
||||
|
||||
|
||||
func show_reel_position(position: Vector3, _input_held: bool) -> void:
|
||||
func show_reel_position(world_position: Vector3, _input_held: bool) -> void:
|
||||
if _mode != VisualMode.FISHING:
|
||||
return
|
||||
|
||||
_kill_active_tween()
|
||||
_bobber.global_position = _with_water_height(position)
|
||||
_bobber.global_position = _with_water_height(world_position)
|
||||
|
||||
|
||||
func play_outcome(outcome: StringName) -> void:
|
||||
|
|
@ -371,8 +371,12 @@ func _calculate_pickup_position(target: Vector3) -> Vector3:
|
|||
return player_on_water + outward * pickup_distance
|
||||
|
||||
|
||||
func _with_water_height(position: Vector3) -> Vector3:
|
||||
return Vector3(position.x, get_water_surface_height(), position.z)
|
||||
func _with_water_height(world_position: Vector3) -> Vector3:
|
||||
return Vector3(
|
||||
world_position.x,
|
||||
get_water_surface_height(),
|
||||
world_position.z,
|
||||
)
|
||||
|
||||
|
||||
func _update_line(delta: float) -> void:
|
||||
|
|
|
|||
|
|
@ -1082,7 +1082,7 @@ func get_fishable_water_region(
|
|||
query,
|
||||
32
|
||||
)
|
||||
var selected_region: FishableWaterRegionType
|
||||
var selected_region: FishableWaterRegionType = null
|
||||
for result: Dictionary in results:
|
||||
var collider: Object = result.get("collider")
|
||||
var region: FishableWaterRegionType = collider as FishableWaterRegionType
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ var _target: Vector3
|
|||
var _active: bool = false
|
||||
|
||||
|
||||
func setup(owner: Player) -> void:
|
||||
_owner = owner
|
||||
func setup(owning_player: Player) -> void:
|
||||
_owner = owning_player
|
||||
_bobber = MeshInstance3D.new()
|
||||
var bobber_mesh := SphereMesh.new()
|
||||
bobber_mesh.radius = 0.12
|
||||
|
|
@ -43,11 +43,11 @@ func show_cast(target: Vector3) -> void:
|
|||
_redraw_line()
|
||||
|
||||
|
||||
func update_bobber(position: Vector3) -> void:
|
||||
if not _active or not position.is_finite():
|
||||
func update_bobber(world_position: Vector3) -> void:
|
||||
if not _active or not world_position.is_finite():
|
||||
return
|
||||
_target = position
|
||||
_bobber.global_position = position
|
||||
_target = world_position
|
||||
_bobber.global_position = world_position
|
||||
_redraw_line()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue