diff --git a/addons/nodot/autoload/CollectableManager.gd b/addons/nodot/autoload/CollectableManager.gd index 364f8b4f..4409de96 100644 --- a/addons/nodot/autoload/CollectableManager.gd +++ b/addons/nodot/autoload/CollectableManager.gd @@ -36,12 +36,6 @@ class Collectable: var node: Node func _init(collectable_node: Node): - if collectable_node.actual_collectable_root_node: - node = collectable_node.actual_collectable_root_node - else: - node = collectable_node - node.position = Vector3.ZERO - icon = collectable_node.icon display_name = collectable_node.display_name description = collectable_node.description diff --git a/addons/nodot/kits/FirstPerson/FirstPersonItemsContainer.gd b/addons/nodot/kits/FirstPerson/FirstPersonItemsContainer.gd index 8ec5d923..7cda8d0c 100644 --- a/addons/nodot/kits/FirstPerson/FirstPersonItemsContainer.gd +++ b/addons/nodot/kits/FirstPerson/FirstPersonItemsContainer.gd @@ -25,10 +25,14 @@ func _ready() -> void: ) GlobalSignal.add_listener("carry_ended", self, "on_carry_ended") - -func _physics_process(delta: float) -> void: + +func _input(event: InputEvent) -> void: + if not character.is_authority(): return + if get_input(): reload() + +func _physics_process(delta: float) -> void: action() func get_input(): @@ -150,9 +154,6 @@ func action(): zoom() "zoomout": zoomout() - - if character.input_states["reload"]: - reload() func discharge() -> void: if !enabled: return diff --git a/addons/nodot/kits/FirstPerson/FirstPersonMouseInput.gd b/addons/nodot/kits/FirstPerson/FirstPersonMouseInput.gd index 3f16612d..544df4a6 100644 --- a/addons/nodot/kits/FirstPerson/FirstPersonMouseInput.gd +++ b/addons/nodot/kits/FirstPerson/FirstPersonMouseInput.gd @@ -82,6 +82,9 @@ func action(delta: float): if not is_multiplayer_authority(): return if !enabled or is_editor or !character.input_enabled: return + if Input.is_action_pressed(action_action): + input_buffer.append({"type": "mouse_action", "action": "action"}) + var input: Dictionary = get_input(delta) character.input_states["mouse_action"] = input.mouse_action @@ -92,6 +95,19 @@ func get_input(delta: float) -> Dictionary: var look_angle: Vector2 = Vector2.ZERO var mouse_action: String = "" + if Input.is_action_pressed(item_next_action): + input_buffer.append({"type": "mouse_action", "action": "next_item"}) + elif Input.is_action_pressed(item_previous_action): + input_buffer.append({"type": "mouse_action", "action": "previous_item"}) + elif Input.is_action_pressed(action_action): + input_buffer.append({"type": "mouse_action", "action": "action"}) + elif Input.is_action_just_released(action_action): + input_buffer.append({"type": "mouse_action", "action": "release_action"}) + elif Input.is_action_pressed(zoom_action): + input_buffer.append({"type": "mouse_action", "action": "zoom"}) + elif Input.is_action_just_released(zoom_action): + input_buffer.append({"type": "mouse_action", "action": "zoomout"}) + for entry in input_buffer: if entry["type"] == "mouse_motion": var mouse_movement: Vector2 = entry["event"]