diff --git a/base/scripts/player/command_queue.gd b/base/scripts/player/command_queue.gd index 37d6673..c2bc34f 100644 --- a/base/scripts/player/command_queue.gd +++ b/base/scripts/player/command_queue.gd @@ -17,7 +17,6 @@ enum Command { signal command_pushed(commands: Dictionary) signal command_popped(commands: Array[CommandQueue.Command]) -signal command_started(command: Array[CommandQueue.Command]) ## Human-readable hand numbers. You could even make extra hands with it, if you wish enum Side { LEFT, RIGHT } @@ -45,8 +44,6 @@ func push(pushed_commands: Dictionary) -> void: for side in commands: command_queue[side].push_back(commands[side]) command_pushed.emit(commands) - if command_queue[Side.LEFT].size() == 1: - start_command() ## Remove first command from queue and signal about it func pop() -> void: @@ -57,16 +54,6 @@ func pop() -> void: for side in Side.values(): commands.push_back(command_queue[side].pop_front()) command_popped.emit(commands) - # Start new command - if command_queue[Side.LEFT].size() > 0: - start_command() - -## Get current commands and emit command_started -func start_command() -> void: - var commands = [] - for side in Side.values(): - commands.push_back(current_command(side)) - command_started.emit(commands) ## Returns currently executed command for given side func current_command(side: CommandQueue.Side) -> CommandQueue.Command: diff --git a/base/scripts/player/player.gd b/base/scripts/player/player.gd index 1207c73..e575bef 100644 --- a/base/scripts/player/player.gd +++ b/base/scripts/player/player.gd @@ -21,7 +21,6 @@ var slot_actions: Array[StringName] = [ "slot_primary", "slot_secondary", "slot_ func _ready() -> void: queue.command_pushed.connect(on_queue_command_pushed) queue.command_popped.connect(on_queue_command_popped) - queue.command_started.connect(on_queue_command_started) weapons.slot_selected.connect(on_weapon_slot_selected) @@ -96,6 +95,7 @@ func on_weapon_slot_selected(): weapon_player.remove_animation_library("current") current_weapon = weapons.current_weapon + print('im here') current_weapon.fired.connect(on_weapon_fired) current_weapon.fire_failed.connect(finish_task) @@ -135,14 +135,6 @@ func on_queue_command_popped(commands): CommandQueue.Side.RIGHT: handle_ended_right_command(commands[i]) -func on_queue_command_started(commands): - for i in CommandQueue.Side.size(): - match CommandQueue.Side.values()[i]: - CommandQueue.Side.LEFT: - handle_started_left_command(commands[i]) - CommandQueue.Side.RIGHT: - handle_started_right_command(commands[i]) - func update_ammo_label(): ammo_label.text = "{ammo}/{max}".format({ ammo = current_weapon.ammo, @@ -181,15 +173,6 @@ func handle_ended_right_command(command: CommandQueue.Command): current_weapon.reload() update_ammo_label() -func handle_started_left_command(command: CommandQueue.Command): - match command: - pass - -func handle_started_right_command(command: CommandQueue.Command): - match command: - CommandQueue.Command.FIRE: - current_weapon.request_fire() - func handle_current_left_command(command: CommandQueue.Command): match command: pass @@ -197,5 +180,4 @@ func handle_current_left_command(command: CommandQueue.Command): func handle_current_right_command(command: CommandQueue.Command): match command: CommandQueue.Command.FIRE: - if not current_weapon.is_firing: - current_weapon.request_fire() + current_weapon.request_fire()