Added UI focus tracking
This commit is contained in:
@ -43,11 +43,9 @@ func _unhandled_input(event):
|
||||
|
||||
match event.is_pressed():
|
||||
true:
|
||||
DisplayServer.mouse_set_mode(DisplayServer.MOUSE_MODE_CAPTURED)
|
||||
look_enabled = true
|
||||
start_look()
|
||||
false:
|
||||
DisplayServer.mouse_set_mode(DisplayServer.MOUSE_MODE_VISIBLE)
|
||||
look_enabled = false
|
||||
end_look()
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("zoom_in", true):
|
||||
@ -96,6 +94,15 @@ func _process(delta):
|
||||
|
||||
look_at(center)
|
||||
|
||||
func start_look():
|
||||
DisplayServer.mouse_set_mode(DisplayServer.MOUSE_MODE_CAPTURED)
|
||||
look_enabled = true
|
||||
UI.unfocus()
|
||||
|
||||
func end_look():
|
||||
DisplayServer.mouse_set_mode(DisplayServer.MOUSE_MODE_VISIBLE)
|
||||
look_enabled = false
|
||||
|
||||
func on_distance_changed():
|
||||
target_distance = clampf(target_distance, zoom_min, zoom_max)
|
||||
Global.camera_attributes.dof_blur_far_distance = target_distance + 1.0
|
||||
|
Reference in New Issue
Block a user