武器切换逻辑/ui初版

master
chendian 2 years ago
parent c616fbda0b
commit ae8b17fc4f

@ -4,8 +4,8 @@
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_gik08"]
[ext_resource type="Animation" uid="uid://daopmieibx3b7" path="res://resource/skill_animation/hero01_long_attack01.tres" id="2_6nbpq"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="2_f3mmj"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_og1bb"]
[ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="4_id85o"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="5_nk6nw"]
[resource]
script = ExtResource("1_gik08")
@ -18,6 +18,7 @@ name = ""
skill_animation = ExtResource("2_6nbpq")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_6ven2")])
attack_particle = ExtResource("2_f3mmj")
free_lock = false
refresh_animation = false
sprite_frams = ExtResource("3_og1bb")
animation_name = "long_attack01"
sprite_frams = ExtResource("5_nk6nw")
animation_name = "short_attack01"

@ -0,0 +1,24 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://bcxglqq08pymr"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_r3o2x"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="2_vsxc2"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="3_gsnqk"]
[ext_resource type="Animation" uid="uid://bkre61dn64j2f" path="res://resource/skill_animation/hero01_short_attack01.tres" id="4_f30l7"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="5_8vcrr"]
[ext_resource type="Resource" uid="uid://pnhii1a83axg" path="res://config/weapon/short.tres" id="6_fxdqr"]
[resource]
script = ExtResource("3_gsnqk")
weapon = ExtResource("6_fxdqr")
stance_from = 0
stance_to = 1
break_level = 3
action = "attack_light"
name = ""
skill_animation = ExtResource("4_f30l7")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_r3o2x")])
attack_particle = ExtResource("2_vsxc2")
free_lock = false
refresh_animation = false
sprite_frams = ExtResource("5_8vcrr")
animation_name = "short_attack01"

@ -0,0 +1,24 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://cm7nbxogmlvp5"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_nmank"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="2_kal4c"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="3_8ixmd"]
[ext_resource type="Animation" uid="uid://xfuwfwtw4cna" path="res://resource/skill_animation/hero01_short_attack02.tres" id="4_mepfm"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="5_dxfya"]
[ext_resource type="Resource" uid="uid://pnhii1a83axg" path="res://config/weapon/short.tres" id="6_e44nf"]
[resource]
script = ExtResource("3_8ixmd")
weapon = ExtResource("6_e44nf")
stance_from = 1
stance_to = 2
break_level = 3
action = "attack_light"
name = ""
skill_animation = ExtResource("4_mepfm")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_nmank")])
attack_particle = ExtResource("2_kal4c")
free_lock = false
refresh_animation = false
sprite_frams = ExtResource("5_dxfya")
animation_name = "short_attack02"

@ -0,0 +1,24 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://bex4a43t6ettj"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_5om0v"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="2_dp0ac"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="3_8rsme"]
[ext_resource type="Animation" uid="uid://bdyjvq185tdk6" path="res://resource/skill_animation/hero01_short_attack03.tres" id="4_7ws6s"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="5_40215"]
[ext_resource type="Resource" uid="uid://pnhii1a83axg" path="res://config/weapon/short.tres" id="6_pclwt"]
[resource]
script = ExtResource("3_8rsme")
weapon = ExtResource("6_pclwt")
stance_from = 2
stance_to = 3
break_level = 3
action = "attack_light"
name = ""
skill_animation = ExtResource("4_7ws6s")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_5om0v")])
attack_particle = ExtResource("2_dp0ac")
free_lock = false
refresh_animation = false
sprite_frams = ExtResource("5_40215")
animation_name = "short_attack03"

@ -0,0 +1,24 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://cya7i41k08jgc"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_hd2st"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="2_hs5u3"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="3_44lu2"]
[ext_resource type="Animation" uid="uid://c8qll8wcn633m" path="res://resource/skill_animation/hero01_short_attack04.tres" id="4_rcj2c"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="5_owk7o"]
[ext_resource type="Resource" uid="uid://pnhii1a83axg" path="res://config/weapon/short.tres" id="6_ht3kv"]
[resource]
script = ExtResource("3_44lu2")
weapon = ExtResource("6_ht3kv")
stance_from = 3
stance_to = 4
break_level = 3
action = "attack_light"
name = ""
skill_animation = ExtResource("4_rcj2c")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_hd2st")])
attack_particle = ExtResource("2_hs5u3")
free_lock = false
refresh_animation = false
sprite_frams = ExtResource("5_owk7o")
animation_name = "short_attack04"

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=3 format=3 uid="uid://chjmqxgcrhcaa"]
[ext_resource type="Texture2D" uid="uid://c3fhegpkyr54r" path="res://resource/ui/icon/chain.png" id="1_jnfil"]
[ext_resource type="Script" path="res://script/config/weapon_cfg.gd" id="1_yeb4s"]
[resource]
script = ExtResource("1_yeb4s")
name = ""
icon = ExtResource("1_jnfil")

@ -1,7 +1,9 @@
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=2 format=3 uid="uid://c6alg8pmqfdxm"]
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=3 format=3 uid="uid://c6alg8pmqfdxm"]
[ext_resource type="Script" path="res://script/config/weapon_cfg.gd" id="1_03rlg"]
[ext_resource type="Texture2D" uid="uid://b3m6ksvhbsrgq" path="res://resource/ui/icon/fist.png" id="1_24loa"]
[resource]
script = ExtResource("1_03rlg")
name = ""
icon = ExtResource("1_24loa")

@ -1,7 +1,9 @@
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=2 format=3 uid="uid://cy3wwalxeyro0"]
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=3 format=3 uid="uid://cy3wwalxeyro0"]
[ext_resource type="Script" path="res://script/config/weapon_cfg.gd" id="1_ihw7q"]
[ext_resource type="Texture2D" uid="uid://ksw3dvkdv6ud" path="res://resource/ui/icon/long.png" id="1_v1ej3"]
[resource]
script = ExtResource("1_ihw7q")
name = ""
icon = ExtResource("1_v1ej3")

@ -1,7 +1,9 @@
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=2 format=3 uid="uid://pnhii1a83axg"]
[gd_resource type="Resource" script_class="WeaponCfg" load_steps=3 format=3 uid="uid://pnhii1a83axg"]
[ext_resource type="Script" path="res://script/config/weapon_cfg.gd" id="1_gwwxv"]
[ext_resource type="Texture2D" uid="uid://b08amntj1fmbu" path="res://resource/ui/icon/short.png" id="1_kjkjb"]
[resource]
script = ExtResource("1_gwwxv")
name = ""
icon = ExtResource("1_kjkjb")

@ -144,6 +144,16 @@ lock={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":76,"key_label":0,"unicode":108,"echo":false,"script":null)
]
}
weapon_pre={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"echo":false,"script":null)
]
}
weapon_next={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
]
}
[memory]

File diff suppressed because one or more lines are too long

@ -0,0 +1,43 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://bkre61dn64j2f"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="1_wo4do"]
[resource]
resource_name = "hero01_short_attack01"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [ExtResource("1_wo4do")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": ["short_attack01"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4]
}

@ -0,0 +1,43 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://xfuwfwtw4cna"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="1_tj0pt"]
[resource]
resource_name = "hero01_short_attack02"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [ExtResource("1_tj0pt")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": ["short_attack02"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4]
}

@ -0,0 +1,43 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://bdyjvq185tdk6"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="1_pwjxo"]
[resource]
resource_name = "hero01_short_attack03"
length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [ExtResource("1_pwjxo")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": ["short_attack03"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
}

@ -0,0 +1,43 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://c8qll8wcn633m"]
[ext_resource type="SpriteFrames" uid="uid://cndpnxtdh37ii" path="res://resource/animation/character/hero01_short_attack.aseprite" id="1_n6b6e"]
[resource]
resource_name = "hero01_short_attack04"
length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [ExtResource("1_n6b6e")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": ["short_attack04"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
}

@ -1,4 +1,4 @@
[gd_resource type="AnimationLibrary" load_steps=12 format=3 uid="uid://croik07a1qko5"]
[gd_resource type="AnimationLibrary" load_steps=16 format=3 uid="uid://croik07a1qko5"]
[ext_resource type="Animation" uid="uid://p8l0puqxrkwh" path="res://resource/skill_animation/hero01_long_air_attack01.tres" id="1_b46g3"]
[ext_resource type="Animation" uid="uid://daopmieibx3b7" path="res://resource/skill_animation/hero01_long_attack01.tres" id="1_nwjtl"]
@ -10,6 +10,10 @@
[ext_resource type="Animation" uid="uid://cwm116apu63n1" path="res://resource/skill_animation/hero01_long_flash.tres" id="5_fumom"]
[ext_resource type="Animation" uid="uid://bjnkrte7660pt" path="res://resource/skill_animation/hero01_long_skill01.tres" id="5_kt0qw"]
[ext_resource type="Animation" uid="uid://iprcbf277rf4" path="res://resource/skill_animation/hero01_long_skill02.tres" id="7_ui68j"]
[ext_resource type="Animation" uid="uid://c8qll8wcn633m" path="res://resource/skill_animation/hero01_short_attack04.tres" id="11_bxi8a"]
[ext_resource type="Animation" uid="uid://xfuwfwtw4cna" path="res://resource/skill_animation/hero01_short_attack02.tres" id="11_h2vlt"]
[ext_resource type="Animation" uid="uid://bdyjvq185tdk6" path="res://resource/skill_animation/hero01_short_attack03.tres" id="11_kejyu"]
[ext_resource type="Animation" uid="uid://bkre61dn64j2f" path="res://resource/skill_animation/hero01_short_attack01.tres" id="11_n0dhn"]
[ext_resource type="Animation" uid="uid://b8ypa7uw0uam5" path="res://resource/skill_animation/monster01_attack01.tres" id="11_q5gn4"]
[resource]
@ -24,5 +28,9 @@ _data = {
"hero01_long_flash": ExtResource("5_fumom"),
"hero01_long_skill01": ExtResource("5_kt0qw"),
"hero01_long_skill02": ExtResource("7_ui68j"),
"hero01_short_attack01": ExtResource("11_n0dhn"),
"hero01_short_attack02": ExtResource("11_h2vlt"),
"hero01_short_attack03": ExtResource("11_kejyu"),
"hero01_short_attack04": ExtResource("11_bxi8a"),
"monster01_attack01": ExtResource("11_q5gn4")
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -0,0 +1,51 @@
[gd_scene load_steps=4 format=3 uid="uid://chi3x0mugaiu4"]
[ext_resource type="Texture2D" uid="uid://7138jsp4yabf" path="res://resource/ui/hud/weapon_slot.png" id="1_3hxat"]
[ext_resource type="Script" path="res://script/ui/hud/weapon_item_sub.gd" id="1_y2xym"]
[ext_resource type="Texture2D" uid="uid://ksw3dvkdv6ud" path="res://resource/ui/icon/long.png" id="2_88p8f"]
[node name="Weapon" type="Control"]
layout_mode = 3
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -80.0
offset_top = -16.0
offset_right = -48.0
offset_bottom = 16.0
grow_horizontal = 2
grow_vertical = 2
pivot_offset = Vector2(16, 16)
script = ExtResource("1_y2xym")
[node name="WeaponSlot" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -16.0
offset_top = -16.0
offset_right = 16.0
offset_bottom = 16.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("1_3hxat")
[node name="WeaponIcon" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -32.0
offset_top = -32.0
offset_right = 32.0
offset_bottom = 32.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_88p8f")

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://7138jsp4yabf"
path="res://.godot/imported/weapon_slot.png-bacb9f2e821dbb9aec3c7545701537c2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/ui/hud/weapon_slot.png"
dest_files=["res://.godot/imported/weapon_slot.png-bacb9f2e821dbb9aec3c7545701537c2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c3fhegpkyr54r"
path="res://.godot/imported/chain.png-7b7acb3d808d6512c3b713380a1e477d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/ui/icon/chain.png"
dest_files=["res://.godot/imported/chain.png-7b7acb3d808d6512c3b713380a1e477d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3m6ksvhbsrgq"
path="res://.godot/imported/fist.png-2d4cf0e40d05495c4dd8edd9aa79da8b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/ui/icon/fist.png"
dest_files=["res://.godot/imported/fist.png-2d4cf0e40d05495c4dd8edd9aa79da8b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ksw3dvkdv6ud"
path="res://.godot/imported/long.png-fcc62240e454dee10a26599dc280a754.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/ui/icon/long.png"
dest_files=["res://.godot/imported/long.png-fcc62240e454dee10a26599dc280a754.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b08amntj1fmbu"
path="res://.godot/imported/short.png-d108f7418edf48fbc177f96299bea103.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resource/ui/icon/short.png"
dest_files=["res://.godot/imported/short.png-d108f7418edf48fbc177f96299bea103.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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=0

@ -10,11 +10,10 @@
[node name="Status" parent="." index="1"]
speed_up_rate = -0.5
skill_float_speed = 0.0
[node name="View" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.693056, 0)
animation = &"long_attack03"
animation = &"long_air_attack01"
[node name="Combo" type="Node3D" parent="." index="8"]
unique_name_in_owner = true

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://126wph4owvoy"]
[gd_scene load_steps=18 format=3 uid="uid://126wph4owvoy"]
[ext_resource type="Texture2D" uid="uid://cwhu1ec03t3c8" path="res://resource/ui/hud/headbar_hp_empty.png" id="1_flgf6"]
[ext_resource type="Script" path="res://script/ui/hud/hud_page.gd" id="1_t7dgf"]
@ -8,6 +8,8 @@
[ext_resource type="Texture2D" uid="uid://xogtpwyb862f" path="res://resource/ui/hud/_hud_design.png" id="5_qqrb8"]
[ext_resource type="Script" path="res://script/ui/hud/lock_item.gd" id="5_usy8x"]
[ext_resource type="Texture2D" uid="uid://dx2vp753yvh4y" path="res://render/texture/shape/lock.png" id="6_hmslt"]
[ext_resource type="Script" path="res://script/ui/hud/weapon_item.gd" id="7_3g1k3"]
[ext_resource type="PackedScene" uid="uid://chi3x0mugaiu4" path="res://resource/ui/hud/weapon_item.tscn" id="8_nlmif"]
[ext_resource type="Shader" path="res://render/shader/loading.gdshader" id="9_lv4gd"]
[sub_resource type="Animation" id="Animation_ikdwl"]
@ -89,14 +91,14 @@ script = ExtResource("1_t7dgf")
position = Vector2(320, 180)
texture = ExtResource("5_qqrb8")
[node name="Player" type="Control" parent="HudPage"]
[node name="PlayerStatusItem" type="Control" parent="HudPage"]
anchors_preset = 0
offset_left = 29.0
offset_top = 29.0
offset_right = 29.0
offset_bottom = 29.0
[node name="HpBar" type="TextureProgressBar" parent="HudPage/Player"]
[node name="HpBar" type="TextureProgressBar" parent="HudPage/PlayerStatusItem"]
visible = false
layout_mode = 0
offset_left = -13.0
@ -128,6 +130,38 @@ libraries = {
"": SubResource("AnimationLibrary_wbtxq")
}
[node name="WeaponItem" type="Control" parent="HudPage"]
anchors_preset = 0
offset_left = 56.0
offset_top = 304.0
offset_right = 88.0
offset_bottom = 336.0
pivot_offset = Vector2(16, 16)
script = ExtResource("7_3g1k3")
[node name="Weapon1" parent="HudPage/WeaponItem" instance=ExtResource("8_nlmif")]
layout_mode = 1
[node name="Weapon2" parent="HudPage/WeaponItem" instance=ExtResource("8_nlmif")]
layout_mode = 1
offset_left = -48.0
offset_right = -16.0
[node name="Weapon3" parent="HudPage/WeaponItem" instance=ExtResource("8_nlmif")]
layout_mode = 1
offset_left = -16.0
offset_right = 16.0
[node name="Weapon4" parent="HudPage/WeaponItem" instance=ExtResource("8_nlmif")]
layout_mode = 1
offset_left = 16.0
offset_right = 48.0
[node name="Weapon5" parent="HudPage/WeaponItem" instance=ExtResource("8_nlmif")]
layout_mode = 1
offset_left = 48.0
offset_right = 80.0
[node name="HeadBarPage" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
@ -136,6 +170,7 @@ offset_bottom = 40.0
script = ExtResource("3_6chl0")
[node name="LoadingPage" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0

@ -16,3 +16,6 @@ const drag_air : float = 5
const starting_level : String = "level00_test1.tscn"
const level_loading_min_time : float = 0.5
const level_loading_control_time : float = 0.2
#ui
const weapon_hide_duration : float = 2

@ -114,3 +114,15 @@ func get_all_player_skill():
if res is PlayerSkillCfg:
ret.append(res)
return ret
func get_player_skill_by_weapon(weapon:WeaponCfg):
var ret = []
var dir_path = "res://config/player_skill"
var dir = DirAccess.open(dir_path)
for file in dir.get_files():
var path = dir_path + "/" + file
var res = load(path)
if res is PlayerSkillCfg:
if res.weapon == weapon:
ret.append(res)
return ret

@ -91,5 +91,5 @@ func add_attack(from:int,dir:Vector2,attack:AttackCfg):battle.add_attack(from,di
func show_hit_text(value:String):SignalManager.character_hit_text.emit(id(),value)
func show_hit_damage(value:float):SignalManager.character_hit_damage.emit(id(),value)
func add_mp(value:float):battle.add_mp(value)
func set_target(target:int):set_status("target",target);SignalManager.character_target_changed.emit(id(),target)
func set_target(target:int):set_status("target",target)
func cast_particle(resource:Resource):effect.cast_particle(resource)

@ -14,9 +14,10 @@ var skill_map = {} #input -> skill[]
var input_list = [] #指令缓存
func _ready():
for player_skill_res in Util.get_all_player_skill():
var player_skill = player_skill_res as PlayerSkillCfg
add_skill(player_skill.action,player_skill_res)
# test
add_weapon(load("res://config/weapon/long.tres"))
add_weapon(load("res://config/weapon/short.tres"))
add_weapon(load("res://config/weapon/fist.tres"))
func _process(delta):
update_input_alive(delta)
@ -74,6 +75,9 @@ func update_break_by_level(break_level:Enum.EBreakLevel):
var stance_from = player_skill_cfg.stance_from
if stance_from != status.stance and stance_from != Enum.EStance.Any:
continue
if player_skill_cfg.weapon:
if player_skill_cfg.weapon != status.weapon_list[status.weapon_index]:
continue
skill.cast_skill(skill_cfg,status.input_dir)
status.stance = player_skill_cfg.stance_to
refresh_input(i)
@ -104,3 +108,16 @@ func add_skill(action:String,skillCfg:PlayerSkillCfg):
skill_map[action] = []
skill_map[action].append(skillCfg)
func add_weapon(weapon:WeaponCfg):
status.weapon_list.append(weapon)
for player_skill_res in Util.get_player_skill_by_weapon(weapon):
var player_skill = player_skill_res as PlayerSkillCfg
add_skill(player_skill.action,player_skill_res)
status.emit_status("weapon_list")
status.set_status("weapon_index",0)
func weapon_index_change(value:int):
if status.weapon_list:
var target_index = status.weapon_index + value
target_index = target_index % len(status.weapon_list)
status.set_status("weapon_index",target_index)

@ -3,13 +3,23 @@ class_name PlayerAction
@onready var character = (get_owner() as Character)
@onready var status = (%Status as Status)
@onready var combo = (%Combo as Combo)
func check_action(key:String,is_pressed:bool) -> bool:
if is_pressed and check_action_pressed(key):
return true
match key:
"lock":lock(is_pressed)
_:return false
return true
func check_action_pressed(key:String) -> bool:
match key:
"weapon_pre":combo.weapon_index_change(-1)
"weapon_next":combo.weapon_index_change(1)
_:return false
return true
func lock(is_pressed:bool):
var has_target = status.target != 0
if is_pressed == has_target:

@ -68,6 +68,8 @@ class_name Status
@export var input_dir : Vector2 #指令方向
@export var stance : Enum.EStance #技能姿态
@export var break_level : Enum.EBreakLevel #打断等级
@export var weapon_list = [] #武器列表
@export var weapon_index : int #当前武器下标
@export_category("动画触发器")
@export var trigger_jump : bool #跳跃
@ -84,3 +86,6 @@ func get_status(status_name:String):return get(status_name)
func set_status(status_name:String,value):
set(status_name,value)
SignalManager.character_status_changed.emit(id,status_name,value)
func emit_status(status_name:String):
SignalManager.character_status_changed.emit(id,status_name,get_status(status_name))

@ -3,3 +3,4 @@ extends Resource
class_name WeaponCfg
@export var name : String
@export var icon : Texture2D

@ -13,7 +13,6 @@ signal character_create
signal character_die
signal character_destroy
signal character_pos_changed
signal character_target_changed
signal character_hit_floor
signal character_ui_pos_changed
signal character_status_changed

@ -1,9 +1,14 @@
extends Control
@onready var sub_item_list = [$LockItem,$WeaponItem]
func _ready():
pass # Replace with function body.
SignalManager.character_status_changed.connect(on_character_status_changed)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func on_character_status_changed(id:int,status_name:String,value):
if id != Global.character_mgr.get_player_id():
return
var func_name = "on_%s_changed" % status_name
for sub_item in sub_item_list:
if sub_item.has_method(func_name):
sub_item.call(func_name,value)

@ -1,14 +1,11 @@
extends Control
class_name LockItem
@onready var animation = $AnimationPlayer as AnimationPlayer
@onready var camera: CameraManager = Global.camera_mgr
var target : Character
var target_pos : Vector3
func _ready():
SignalManager.character_target_changed.connect(on_character_target_changed)
visible = false
animation.play("rotate")
@ -16,8 +13,6 @@ func _process(delta):
if target:
position = camera.get_screen_pos(target.ui_pos_center())
func on_character_target_changed(id:int,target_id:int):
if id != Global.character_mgr.get_player_id():
return
func on_target_changed(target_id:int):
target = Global.character_mgr.get_character(target_id)
visible = target != null

@ -0,0 +1,33 @@
extends Control
@onready var weapon_item_list = [$Weapon1,$Weapon2,$Weapon3,$Weapon4,$Weapon5]
var duration : float
func _process(delta):
if visible:
duration -= delta
if duration <= 0:
visible = false
var weapon_list : Array
var weapon_index_list = [0,0,0,0,0]
func on_weapon_list_changed(list:Array):
weapon_list = list
func on_weapon_index_changed(index:int):
for i in range(5):
weapon_index_list[i] = (i + index + len(weapon_list) - 2) % len(weapon_list)
update_weapon()
func update_weapon():
if visible:
pass
else:
for i in range(5):
var weapon_item_sub = weapon_item_list[i] as WeaponItemSub
var weapon_cfg = weapon_list[weapon_index_list[i]] as WeaponCfg
weapon_item_sub.set_texture(weapon_cfg.icon)
visible = true
duration = Setting.weapon_hide_duration

@ -0,0 +1,7 @@
extends Control
class_name WeaponItemSub
@onready var icon_rect = $WeaponIcon as TextureRect
func set_texture(value:Texture2D):
icon_rect.texture = value
Loading…
Cancel
Save