implementing zoom, amaze hotfixes
This commit is contained in:
parent
0564f994ec
commit
08ff85d768
|
|
@ -21,6 +21,7 @@ func _ready():
|
|||
connect("mouse_entered", Callable(self, "_on_mouse_entered"))
|
||||
|
||||
func _on_mouse_entered():
|
||||
if not State.focus_locked:
|
||||
input_ray_pickable = false
|
||||
ui.collapsed = false
|
||||
has_mouse = true
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ func _unhandled_input(event):
|
|||
viewport.push_input(event)
|
||||
|
||||
func _on_input_event(_camera: Camera3D, event: InputEvent, pos: Vector3, _normal: Vector3, _shape_idx: int):
|
||||
if not State.focus_locked:
|
||||
# Position of the event in Sprite3D local coordinates.
|
||||
var texture_3d_position = sprite.get_global_transform().affine_inverse() * pos
|
||||
#if !is_zero_approx(texture_3d_position.z):
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ var has_stage = false:
|
|||
set(focus):
|
||||
if focus:
|
||||
has_stage = true
|
||||
self.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||
self.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||
get_tree().call_group("interactables", "collapse")
|
||||
else:
|
||||
has_stage = false
|
||||
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
if is_node_ready():
|
||||
if focus:
|
||||
process_mode = Node.PROCESS_MODE_INHERIT
|
||||
|
|
@ -115,6 +115,7 @@ func _ready():
|
|||
if get_parent() == get_tree().root:
|
||||
populate_board(["c_void", 'c_joy', "p_wet", "p_thomas"])
|
||||
populate_board(["c_fighting", 'c_hit', "p_girly", "p_vent"])
|
||||
mementos_collected = 2
|
||||
|
||||
has_stage = has_stage
|
||||
|
||||
|
|
@ -199,6 +200,7 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent):
|
|||
if not sticky_note_container.get_child_count() == 0:
|
||||
sticky_note_container.get_child(current_sticky_note_id).clear_if_empty()
|
||||
current_context = NAVIGATE
|
||||
if is_board_complete(): emit_signal("board_completed")
|
||||
return
|
||||
else:
|
||||
_return_sticky_notes_to_panels()
|
||||
|
|
@ -313,6 +315,7 @@ func _input(event):
|
|||
card.attach_sticky_note(sticky_note_container.get_child(current_sticky_note_id).attached_sticky_note)
|
||||
current_context = NAVIGATE
|
||||
focus_stickies = false
|
||||
if is_board_complete(): emit_signal("board_completed")
|
||||
else:
|
||||
if !focus_stickies and card.has_sticky_note_attached():
|
||||
currently_active_node = card.remove_sticky_note()
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
mouse_filter = 1
|
||||
mouse_filter = 2
|
||||
script = ExtResource("3_8v4c4")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
|
|
|
|||
|
|
@ -132,3 +132,6 @@ func tween_transform_to(target: Transform2D):
|
|||
func reset_drag():
|
||||
if attached_to != null:
|
||||
attached_to.reclaim_sticky_note()
|
||||
|
||||
func _enter_tree():
|
||||
print("enter_tree")
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ var has_stage = false:
|
|||
if focus:
|
||||
process_mode = Node.PROCESS_MODE_INHERIT
|
||||
self.show()
|
||||
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
self.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||
else:
|
||||
self.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
self.hide()
|
||||
process_mode = Node.PROCESS_MODE_DISABLED
|
||||
has_stage = focus
|
||||
|
|
@ -116,6 +116,8 @@ func _input(event):
|
|||
if event.is_action_pressed("ui_accept"):
|
||||
pick(curr_selection_id)
|
||||
elif event.is_action_pressed("skip"):
|
||||
##fixme: using skip causes a lot of invalid state
|
||||
return
|
||||
if selection_state == CARDS_SELECTED:
|
||||
transition()
|
||||
show_posts()
|
||||
|
|
@ -160,9 +162,9 @@ func pick(id: int):
|
|||
print("Winning ID ", id)
|
||||
|
||||
elif options[0].text == "":
|
||||
winning_id = 0
|
||||
else:
|
||||
winning_id = 1
|
||||
else:
|
||||
winning_id = 0
|
||||
|
||||
output.append(options.pop_at(winning_id))
|
||||
anim_players.pop_at(winning_id).play("shuffle")
|
||||
|
|
|
|||
|
|
@ -1493,6 +1493,7 @@ anchor_right = 1.0
|
|||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_pjntm")
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
|
|
|
|||
|
|
@ -58,6 +58,16 @@ var on_crouch_cooldown:bool = false
|
|||
@onready var camera:Camera3D = $Yaw/Pitch/Mount/Camera3D
|
||||
@onready var focus_ray: RayCast3D = $Yaw/Pitch/Mount/Camera3D/RayCast3D
|
||||
|
||||
var zoomed:
|
||||
set(zoom):
|
||||
if zoomed != zoom:
|
||||
if zoom:
|
||||
var zoom_tween = create_tween()
|
||||
zoom_tween.tween_property(camera, "fov", camera.fov*0.5, 0.5)
|
||||
else:
|
||||
var zoom_tween = create_tween()
|
||||
zoom_tween.tween_property(camera, "fov", camera.fov*2, 0.5)
|
||||
zoomed = zoom
|
||||
signal ui_entered
|
||||
var has_entered:bool = false
|
||||
signal ui_exited
|
||||
|
|
@ -77,12 +87,18 @@ func _process(_delta):
|
|||
has_entered = true
|
||||
focus_ray.get_collider().reveal()
|
||||
|
||||
if has_entered and has_stage:
|
||||
if has_stage:
|
||||
if has_entered:
|
||||
if focus_ray.get_collider() == null:
|
||||
emit_signal("ui_exited")
|
||||
has_entered = false
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
State.pass_stage_to(focus_ray.get_collider())
|
||||
else:
|
||||
if Input.is_action_just_pressed("zoom_in_controller"):
|
||||
zoomed = true
|
||||
elif Input.is_action_just_released("zoom_in_controller"):
|
||||
zoomed = false
|
||||
|
||||
func _physics_process(delta:float):
|
||||
if has_stage:
|
||||
|
|
@ -155,6 +171,11 @@ func _input(event:InputEvent):
|
|||
_handle_mouse_input(event)
|
||||
get_viewport().set_input_as_handled()
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
if Input.is_action_just_pressed("zoom_in_mouse"):
|
||||
zoomed = true
|
||||
elif Input.is_action_just_pressed("zoom_out_mouse"):
|
||||
zoomed = false
|
||||
else:
|
||||
State.free_focus()
|
||||
get_tree().call_group("interactables", "reveal")
|
||||
#if event.is_action_pressed("ui_accept"):
|
||||
|
|
|
|||
|
|
@ -124,6 +124,21 @@ skip={
|
|||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
zoom_in_mouse={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":4,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
zoom_out_mouse={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":5,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
zoom_in_controller={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue