Weapon draw and holster

This commit is contained in:
Alexey 2025-07-27 12:32:18 +03:00
commit b4a6dadc43
18 changed files with 428 additions and 9 deletions

View file

@ -1,4 +1,4 @@
[gd_resource type="AnimationLibrary" load_steps=16 format=3 uid="uid://57ng8lwnt2k4"] [gd_resource type="AnimationLibrary" load_steps=21 format=3 uid="uid://57ng8lwnt2k4"]
[ext_resource type="Texture2D" uid="uid://cy3ija8ratxjq" path="res://base/assets/sprites/guns/gangstaholder/shoot1.png" id="1_rooin"] [ext_resource type="Texture2D" uid="uid://cy3ija8ratxjq" path="res://base/assets/sprites/guns/gangstaholder/shoot1.png" id="1_rooin"]
[ext_resource type="Texture2D" uid="uid://cd4m4g44rmwrc" path="res://base/assets/sprites/guns/gangstaholder/shoot2.png" id="2_57rwx"] [ext_resource type="Texture2D" uid="uid://cd4m4g44rmwrc" path="res://base/assets/sprites/guns/gangstaholder/shoot2.png" id="2_57rwx"]
@ -11,6 +11,9 @@
[ext_resource type="Texture2D" uid="uid://cvw7h7fsfdjln" path="res://base/assets/sprites/guns/gangstaholder/reload6.png" id="9_y5ueg"] [ext_resource type="Texture2D" uid="uid://cvw7h7fsfdjln" path="res://base/assets/sprites/guns/gangstaholder/reload6.png" id="9_y5ueg"]
[ext_resource type="Texture2D" uid="uid://ditbn0dkyjj6e" path="res://base/assets/sprites/guns/gangstaholder/reload7.png" id="10_tf0tm"] [ext_resource type="Texture2D" uid="uid://ditbn0dkyjj6e" path="res://base/assets/sprites/guns/gangstaholder/reload7.png" id="10_tf0tm"]
[ext_resource type="Texture2D" uid="uid://dftqlo1lltx5f" path="res://base/assets/sprites/guns/gangstaholder/static.png" id="11_fahg7"] [ext_resource type="Texture2D" uid="uid://dftqlo1lltx5f" path="res://base/assets/sprites/guns/gangstaholder/static.png" id="11_fahg7"]
[ext_resource type="Texture2D" uid="uid://dooqsempiufkq" path="res://base/assets/sprites/guns/gangstaholder/holster1.png" id="12_vwudn"]
[ext_resource type="Texture2D" uid="uid://pwe72f0xx10w" path="res://base/assets/sprites/guns/gangstaholder/holster2.png" id="13_p7jc5"]
[ext_resource type="Texture2D" uid="uid://rbxq3ro5l2ec" path="res://base/assets/sprites/guns/gangstaholder/holster3.png" id="14_t6dve"]
[sub_resource type="Animation" id="Animation_i1xqq"] [sub_resource type="Animation" id="Animation_i1xqq"]
length = 0.001 length = 0.001
@ -26,6 +29,18 @@ tracks/0/keys = {
"update": 1, "update": 1,
"values": [null] "values": [null]
} }
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_8sdfx"] [sub_resource type="Animation" id="Animation_8sdfx"]
resource_name = "shoot" resource_name = "shoot"
@ -106,10 +121,98 @@ tracks/0/keys = {
"values": [ExtResource("11_fahg7")] "values": [ExtResource("11_fahg7")]
} }
[sub_resource type="Animation" id="Animation_5sdma"]
resource_name = "holster"
length = 0.40001
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(-7.45058e-09, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [ExtResource("12_vwudn"), ExtResource("13_p7jc5"), ExtResource("14_t6dve")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(-7.45058e-09, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, true, false]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"finish_task"
}]
}
[sub_resource type="Animation" id="Animation_vwudn"]
resource_name = "draw"
length = 0.30001
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [ExtResource("14_t6dve"), ExtResource("13_p7jc5"), ExtResource("12_vwudn")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.3),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"finish_task"
}]
}
[resource] [resource]
_data = { _data = {
&"RESET": SubResource("Animation_i1xqq"), &"RESET": SubResource("Animation_i1xqq"),
&"draw": SubResource("Animation_vwudn"),
&"fire": SubResource("Animation_8sdfx"), &"fire": SubResource("Animation_8sdfx"),
&"holster": SubResource("Animation_5sdma"),
&"reload": SubResource("Animation_08xoc"), &"reload": SubResource("Animation_08xoc"),
&"static": SubResource("Animation_ma1q3") &"static": SubResource("Animation_ma1q3")
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dooqsempiufkq"
path="res://.godot/imported/holster1.png-ed894e9f91eb85e44cb846add92792c6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://base/assets/sprites/guns/gangstaholder/holster1.png"
dest_files=["res://.godot/imported/holster1.png-ed894e9f91eb85e44cb846add92792c6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://pwe72f0xx10w"
path="res://.godot/imported/holster2.png-af3825befe4ad6e7b2592f029e180b38.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://base/assets/sprites/guns/gangstaholder/holster2.png"
dest_files=["res://.godot/imported/holster2.png-af3825befe4ad6e7b2592f029e180b38.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://rbxq3ro5l2ec"
path="res://.godot/imported/holster3.png-b07ec38b6bf6862ded6903ac4ceb4c72.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://base/assets/sprites/guns/gangstaholder/holster3.png"
dest_files=["res://.godot/imported/holster3.png-b07ec38b6bf6862ded6903ac4ceb4c72.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://3icyo6ynxk20"
path="res://.godot/imported/holster1.png-2602c55778f79990712e5c75aa06d593.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://base/assets/sprites/guns/placeholder/holster1.png"
dest_files=["res://.godot/imported/holster1.png-2602c55778f79990712e5c75aa06d593.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://5b28gs37bo7a"
path="res://.godot/imported/holster2.png-dc76912fc373334c61a5388a89263a42.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://base/assets/sprites/guns/placeholder/holster2.png"
dest_files=["res://.godot/imported/holster2.png-dc76912fc373334c61a5388a89263a42.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dxmu14ucuokfl"
path="res://.godot/imported/holster3.png-909df3f4424bd631b47bb34bfa0145a6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://base/assets/sprites/guns/placeholder/holster3.png"
dest_files=["res://.godot/imported/holster3.png-909df3f4424bd631b47bb34bfa0145a6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -1,4 +1,4 @@
[gd_resource type="AnimationLibrary" load_steps=16 format=3 uid="uid://cw8bt4hqxpk55"] [gd_resource type="AnimationLibrary" load_steps=21 format=3 uid="uid://cw8bt4hqxpk55"]
[ext_resource type="Texture2D" uid="uid://cf7avgppv4kfk" path="res://base/assets/sprites/guns/placeholder/static.png" id="1_yheqn"] [ext_resource type="Texture2D" uid="uid://cf7avgppv4kfk" path="res://base/assets/sprites/guns/placeholder/static.png" id="1_yheqn"]
[ext_resource type="Texture2D" uid="uid://ij02cx0xdckw" path="res://base/assets/sprites/guns/placeholder/reload1.png" id="5_ve5jf"] [ext_resource type="Texture2D" uid="uid://ij02cx0xdckw" path="res://base/assets/sprites/guns/placeholder/reload1.png" id="5_ve5jf"]
@ -11,6 +11,9 @@
[ext_resource type="Texture2D" uid="uid://b55h6w4km2c3u" path="res://base/assets/sprites/guns/placeholder/reload6.png" id="10_x8exi"] [ext_resource type="Texture2D" uid="uid://b55h6w4km2c3u" path="res://base/assets/sprites/guns/placeholder/reload6.png" id="10_x8exi"]
[ext_resource type="Texture2D" uid="uid://bp1frp3sm8bic" path="res://base/assets/sprites/guns/placeholder/shoot3.png" id="11_0d256"] [ext_resource type="Texture2D" uid="uid://bp1frp3sm8bic" path="res://base/assets/sprites/guns/placeholder/shoot3.png" id="11_0d256"]
[ext_resource type="Texture2D" uid="uid://b4fp0oo8qcino" path="res://base/assets/sprites/guns/placeholder/reload7.png" id="11_bkso5"] [ext_resource type="Texture2D" uid="uid://b4fp0oo8qcino" path="res://base/assets/sprites/guns/placeholder/reload7.png" id="11_bkso5"]
[ext_resource type="Texture2D" uid="uid://3icyo6ynxk20" path="res://base/assets/sprites/guns/placeholder/holster1.png" id="12_y82fu"]
[ext_resource type="Texture2D" uid="uid://5b28gs37bo7a" path="res://base/assets/sprites/guns/placeholder/holster2.png" id="13_7aydm"]
[ext_resource type="Texture2D" uid="uid://dxmu14ucuokfl" path="res://base/assets/sprites/guns/placeholder/holster3.png" id="14_x8exi"]
[sub_resource type="Animation" id="Animation_i1xqq"] [sub_resource type="Animation" id="Animation_i1xqq"]
length = 0.001 length = 0.001
@ -26,6 +29,18 @@ tracks/0/keys = {
"update": 1, "update": 1,
"values": [null] "values": [null]
} }
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_8sdfx"] [sub_resource type="Animation" id="Animation_8sdfx"]
resource_name = "shoot" resource_name = "shoot"
@ -106,10 +121,98 @@ tracks/0/keys = {
"values": [ExtResource("1_yheqn")] "values": [ExtResource("1_yheqn")]
} }
[sub_resource type="Animation" id="Animation_bkso5"]
resource_name = "holster"
length = 0.40001
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(7.45058e-09, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [ExtResource("12_y82fu"), ExtResource("13_7aydm"), ExtResource("14_x8exi")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(7.45058e-09, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, true, false]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"finish_task"
}]
}
[sub_resource type="Animation" id="Animation_y82fu"]
resource_name = "draw"
length = 0.30001
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [ExtResource("14_x8exi"), ExtResource("13_7aydm"), ExtResource("12_y82fu")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.3),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"finish_task"
}]
}
[resource] [resource]
_data = { _data = {
&"RESET": SubResource("Animation_i1xqq"), &"RESET": SubResource("Animation_i1xqq"),
&"draw": SubResource("Animation_y82fu"),
&"fire": SubResource("Animation_8sdfx"), &"fire": SubResource("Animation_8sdfx"),
&"holster": SubResource("Animation_bkso5"),
&"reload": SubResource("Animation_08xoc"), &"reload": SubResource("Animation_08xoc"),
&"static": SubResource("Animation_ma1q3") &"static": SubResource("Animation_ma1q3")
} }

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=8 format=3 uid="uid://dwx5tcatj35gu"] [gd_scene load_steps=8 format=3 uid="uid://dwx5tcatj35gu"]
[ext_resource type="Script" uid="uid://dts8lbivkgsmj" path="res://base/scripts/player/player.gd" id="1_1w3ab"] [ext_resource type="Script" uid="uid://dts8lbivkgsmj" path="res://base/scripts/player/player.gd" id="1_1w3ab"]
[ext_resource type="Texture2D" uid="uid://cy3ija8ratxjq" path="res://base/assets/sprites/guns/gangstaholder/shoot1.png" id="2_gt0rj"] [ext_resource type="Texture2D" uid="uid://dxmu14ucuokfl" path="res://base/assets/sprites/guns/placeholder/holster3.png" id="2_gt0rj"]
[ext_resource type="PackedScene" uid="uid://bb6ovrbusyxpi" path="res://base/scenes/weapons/weapon_base.tscn" id="2_ma1q3"] [ext_resource type="PackedScene" uid="uid://bb6ovrbusyxpi" path="res://base/scenes/weapons/weapon_base.tscn" id="2_ma1q3"]
[ext_resource type="Script" uid="uid://byhp4pklbjltn" path="res://base/scripts/player/weapon_container.gd" id="3_1w3ab"] [ext_resource type="Script" uid="uid://byhp4pklbjltn" path="res://base/scripts/player/weapon_container.gd" id="3_1w3ab"]
[ext_resource type="Script" uid="uid://diu6eno2ag6ga" path="res://base/scripts/player/weapon_slot.gd" id="4_gt0rj"] [ext_resource type="Script" uid="uid://diu6eno2ag6ga" path="res://base/scripts/player/weapon_slot.gd" id="4_gt0rj"]

View file

@ -6,10 +6,10 @@ class_name CommandQueue
## Commands that can be pushed to queue ## Commands that can be pushed to queue
enum Command { enum Command {
NONE, NONE,
TAKE_WEAPON,
FIRE, FIRE,
STOP_FIRING, STOP_FIRING,
RELOAD, RELOAD,
DRAW_WEAPON,
HOLSTER_WEAPON, HOLSTER_WEAPON,
TAKE_ZAZA, TAKE_ZAZA,
LIGHT_ZAZA, LIGHT_ZAZA,

View file

@ -6,6 +6,7 @@ extends CharacterBody3D
@export var horizontal_sensivity = 0.005 @export var horizontal_sensivity = 0.005
var queue: CommandQueue = CommandQueue.new() var queue: CommandQueue = CommandQueue.new()
var queue_data: Dictionary = {}
@onready var camera: Camera3D = $"Camera" @onready var camera: Camera3D = $"Camera"
@onready var weapon_player: AnimationPlayer = $"HUD/Weapon/AnimationPlayer" @onready var weapon_player: AnimationPlayer = $"HUD/Weapon/AnimationPlayer"
@ -49,13 +50,12 @@ func _process(_delta: float) -> void:
# Slot changing logic # Slot changing logic
var slot_action = false var slot_action = false
var slot_id = 0
for slot in slot_actions.size(): for slot in slot_actions.size():
if Input.is_action_just_pressed(slot_actions[slot]): if Input.is_action_just_pressed(slot_actions[slot]):
slot_action = true slot_action = true
slot_id = slot queue_data['slot_id'] = slot
if slot_action: if slot_action:
weapons.select_slot(slot_id) push_copied_command(CommandQueue.Command.HOLSTER_WEAPON, weapon_sides)
# Stop firing logic # Stop firing logic
if not current_weapon.fire_mode is SingleFireMode: if not current_weapon.fire_mode is SingleFireMode:
@ -109,7 +109,8 @@ func on_weapon_slot_selected():
current_weapon.fire_allowed.connect(finish_task) current_weapon.fire_allowed.connect(finish_task)
weapon_player.add_animation_library("current", current_weapon.animation_library) weapon_player.add_animation_library("current", current_weapon.animation_library)
weapon_player.play("current/static")
push_copied_command(CommandQueue.Command.DRAW_WEAPON, current_weapon.uses_hands)
update_ammo_label() update_ammo_label()
@ -192,6 +193,10 @@ func handle_ended_right_command(command: CommandQueue.Command):
weapon_player.play('current/static') weapon_player.play('current/static')
current_weapon.reload() current_weapon.reload()
update_ammo_label() update_ammo_label()
CommandQueue.Command.HOLSTER_WEAPON:
weapons.select_slot(queue_data['slot_id'])
CommandQueue.Command.DRAW_WEAPON:
weapon_player.play('current/static')
func handle_started_left_command(command: CommandQueue.Command): func handle_started_left_command(command: CommandQueue.Command):
match command: match command:
@ -203,6 +208,10 @@ func handle_started_right_command(command: CommandQueue.Command):
current_weapon.request_fire() current_weapon.request_fire()
CommandQueue.Command.STOP_FIRING: CommandQueue.Command.STOP_FIRING:
queue.pop() queue.pop()
CommandQueue.Command.DRAW_WEAPON:
weapon_player.play('current/draw')
CommandQueue.Command.HOLSTER_WEAPON:
weapon_player.play('current/holster')
func handle_current_left_command(command: CommandQueue.Command): func handle_current_left_command(command: CommandQueue.Command):
match command: match command:

View file

@ -15,7 +15,7 @@ var ammo: int
@export var fire_mode: BaseFireMode @export var fire_mode: BaseFireMode
## Weapon animation library. Should contain "static", "fire", "reload" animations ## Weapon animation library. Should contain "static", "fire", "reload", "holster", "draw" animations
@export var animation_library: AnimationLibrary @export var animation_library: AnimationLibrary
var is_firing: bool = false var is_firing: bool = false