diff --git a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn index 02b764d..c4fdc0a 100644 --- a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn +++ b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://bvpmtfupny8iu"] +[gd_scene load_steps=20 format=3 uid="uid://bvpmtfupny8iu"] [ext_resource type="Script" path="res://src/game/ui/roomUI/RoomUIPanel.cs" id="1_tfcrp"] [ext_resource type="Texture2D" uid="uid://b67i86mtqrn32" path="res://resource/sprite/ui/roomUI/icon_bullet.png" id="2_ruc0p"] @@ -13,7 +13,8 @@ [ext_resource type="Texture2D" uid="uid://504f1r0mi33n" path="res://resource/sprite/weapon/weapon0005/Weapon0005.png" id="11_lsai4"] [ext_resource type="Texture2D" uid="uid://bsu7re1lxnr72" path="res://resource/sprite/ui/roomUI/Cooldown.png" id="11_p0smc"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="12_fgyob"] -[ext_resource type="Texture2D" uid="uid://dwysndc5ffski" path="res://resource/sprite/ui/roomUI/ChargeProgress.png" id="13_vuglj"] +[ext_resource type="Texture2D" uid="uid://dwysndc5ffski" path="res://resource/sprite/ui/roomUI/ChargeProgressBar.png" id="13_6w7qi"] +[ext_resource type="Texture2D" uid="uid://ck0w7at3oat5" path="res://resource/sprite/ui/roomUI/ChargeProgress.png" id="13_vuglj"] [sub_resource type="Gradient" id="1"] colors = PackedColorArray(0.4, 0.498039, 1, 1, 0.4, 0.498039, 1, 0.313726) @@ -218,7 +219,7 @@ texture = ExtResource("10_5d4np") stretch_mode = 3 -[node name="ActivePropGrey" type="Sprite2D" parent="Control/ActivePropBar"] +[node name="CooldownProgress" type="Sprite2D" parent="Control/ActivePropBar"] position = Vector2(1, 0.99999) scale = Vector2(43, 25) texture = ExtResource("11_p0smc") @@ -259,18 +260,25 @@ patch_margin_right = 2 patch_margin_bottom = 2 -[node name="ActivePropChargeProgress" type="NinePatchRect" parent="Control/ActivePropBar"] +[node name="ChargeProgressBar" type="NinePatchRect" parent="Control/ActivePropBar"] layout_mode = 1 anchors_preset = 9 anchor_bottom = 1.0 offset_right = 5.0 grow_vertical = 2 -texture = ExtResource("13_vuglj") +texture = ExtResource("13_6w7qi") patch_margin_left = 2 patch_margin_top = 3 patch_margin_right = 1 patch_margin_bottom = 3 +[node name="ChargeProgress" type="Sprite2D" parent="Control/ActivePropBar"] +position = Vector2(1, 1) +texture = ExtResource("13_vuglj") +centered = false +region_enabled = true +region_rect = Rect2(0, 0, 3, 25) + [node name="WeaponBar" type="Control" parent="Control"] layout_mode = 1 anchors_preset = 3 diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png index 4891c5c..6f2d7f7 100644 --- a/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png.import b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png.import index b36cc76..1af9ac6 100644 --- a/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png.import +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgress.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dwysndc5ffski" +uid="uid://ck0w7at3oat5" path="res://.godot/imported/ChargeProgress.png-a966b083a7f0e9adb2c3b308c3007e22.ctex" metadata={ "vram_texture": false diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgressBar.png b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgressBar.png new file mode 100644 index 0000000..4891c5c --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgressBar.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgressBar.png.import b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgressBar.png.import new file mode 100644 index 0000000..a93ead2 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/roomUI/ChargeProgressBar.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dwysndc5ffski" +path="res://.godot/imported/ChargeProgressBar.png-74d561037ef0bfb8e76d62f233513b79.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/roomUI/ChargeProgressBar.png" +dest_files=["res://.godot/imported/ChargeProgressBar.png-74d561037ef0bfb8e76d62f233513b79.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 diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index 8ecb549..9d01465 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -352,7 +352,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_k8ruh"] +[sub_resource type="Image" id="Image_rcdx1"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -362,7 +362,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_k8ruh") +image = SubResource("Image_rcdx1") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -372,7 +372,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_xwud4"] +[sub_resource type="Image" id="Image_jf38e"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -382,7 +382,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_xwud4") +image = SubResource("Image_jf38e") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -392,7 +392,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_ib356"] +[sub_resource type="Image" id="Image_pynnv"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -402,7 +402,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_ib356") +image = SubResource("Image_pynnv") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -412,7 +412,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_p4qf8"] +[sub_resource type="Image" id="Image_wl8j8"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -422,7 +422,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_p4qf8") +image = SubResource("Image_wl8j8") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -446,7 +446,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_3fxry"] +[sub_resource type="Image" id="Image_5qrbu"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -456,7 +456,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_3fxry") +image = SubResource("Image_5qrbu") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs index 04cd731..a2be35f 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp.cs @@ -77,7 +77,11 @@ } private float _chargeProgress = 1; - + + /// + /// 自动充能速度, 也就是每秒充能进度, 如果为0则表示不就行自动充能 + /// + public float AutoChargeSpeed { get; set; } //冷却计时器 private float _cooldownTimer = 0; @@ -130,6 +134,7 @@ public override void PackProcess(float delta) { + //冷却 if (_cooldownTimer > 0) { _cooldownTimer -= delta; @@ -141,6 +146,12 @@ OnCooldownFinish(); } } + + //自动充能 + if (AutoChargeSpeed > 0 && ChargeProgress < 1) + { + ChargeProgress += AutoChargeSpeed * delta; + } } /// diff --git a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs index 773ff62..74bf050 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/active/ActiveProp5000.cs @@ -1,6 +1,9 @@  using Godot; +/// +/// 医药箱, 使用后恢复一颗红心 +/// [Tool] public partial class ActiveProp5000 : ActiveProp { @@ -8,8 +11,6 @@ { AutoDestroy = true; MaxCount = 20; - Count = 20; - CooldownTime = 5; } public override bool OnCheckUse() diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs index a9872e0..4db890e 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs @@ -6,18 +6,24 @@ { private RoomUI.UiNode_ActivePropBar _activePropBar; private ShaderMaterial _shaderMaterial; - private Vector2 _startPos; - private Vector2 _startSize; + private Vector2 _startCooldownPos; + private Vector2 _startCooldownSize; + private Vector2 _startChargePos; + private Rect2 _startChargeRect; + + private bool _initCooldown = false; public ActivePropBar(RoomUI.UiNode_ActivePropBar activePropBar) { _activePropBar = activePropBar; _shaderMaterial = (ShaderMaterial)_activePropBar.L_ActivePropSprite.Instance.Material; - _startPos = _activePropBar.L_ActivePropGrey.Instance.Position; - _startSize = _activePropBar.L_ActivePropGrey.Instance.Scale; + _startCooldownPos = _activePropBar.L_CooldownProgress.Instance.Position; + _startCooldownSize = _activePropBar.L_CooldownProgress.Instance.Scale; + _startChargePos = _activePropBar.L_ChargeProgress.Instance.Position; + _startChargeRect = _activePropBar.L_ChargeProgress.Instance.RegionRect; SetActivePropTexture(null); - SetChargeProgressVisible(false); + SetChargeProgress(1); } public void OnShow() @@ -49,7 +55,10 @@ } //冷却 - SetActivePropCooldownProgress(prop.GetCooldownProgress()); + SetCooldownProgress(prop.GetCooldownProgress()); + + //充能进度 + SetChargeProgress(prop.ChargeProgress); } else { @@ -93,10 +102,10 @@ /// 设置道具冷却进度 /// /// 进度: 0 - 1 - public void SetActivePropCooldownProgress(float progress) + public void SetCooldownProgress(float progress) { progress = 1 - progress; - var colorRect = _activePropBar.L_ActivePropGrey.Instance; + var colorRect = _activePropBar.L_CooldownProgress.Instance; if (progress <= 0) { colorRect.Visible = false; @@ -113,9 +122,9 @@ colorRect.RegionRect = rect; //调整蒙板位置 - var height = _startSize.Y * progress; + var height = _startCooldownSize.Y * progress; var position = colorRect.Position; - position.Y = _startPos.Y + (_startSize.Y - height); + position.Y = _startCooldownPos.Y + (_startCooldownSize.Y - height); colorRect.Position = position; } } @@ -125,26 +134,72 @@ /// public void SetChargeProgressVisible(bool visible) { - var ninePatchRect = _activePropBar.L_ActivePropChargeProgress.Instance; + var ninePatchRect = _activePropBar.L_ChargeProgressBar.Instance; + var sprite = _activePropBar.L_CooldownProgress.Instance; + sprite.Visible = visible; + if (ninePatchRect.Visible == visible && _initCooldown) + { + return; + } + + _initCooldown = true; + ninePatchRect.Visible = visible; + _activePropBar.L_ChargeProgress.Instance.Visible = visible; //调整冷却蒙板大小 - var sprite = _activePropBar.L_ActivePropGrey.Instance; if (visible) { var rect = ninePatchRect.GetRect(); var position = sprite.Position; - position.X = _startPos.X + rect.Size.X - 1; + position.X = _startCooldownPos.X + rect.Size.X - 1; sprite.Position = position; var scale = sprite.Scale; - scale.X = _startSize.X - rect.Size.X + 1; + scale.X = _startCooldownSize.X - rect.Size.X + 1; sprite.Scale = scale; } else { - sprite.Position = _startPos; - sprite.Scale = _startSize; + sprite.Position = _startCooldownPos; + sprite.Scale = _startCooldownSize; + } + } + + /// + /// 设置充能进度 + /// + /// 进度: 0 - 1 + public void SetChargeProgress(float progress) + { + if (progress >= 1) + { + SetChargeProgressVisible(false); + } + else + { + SetChargeProgressVisible(true); + + var height = _startChargeRect.Size.Y * progress; + var rectY = _startChargeRect.Size.Y * (1 - progress); + var posY = _startChargePos.Y + rectY; + + var sprite = _activePropBar.L_ChargeProgress.Instance; + + var position = sprite.Position; + position.Y = posY; + sprite.Position = position; + + var rect = sprite.RegionRect; + var rectPosition = rect.Position; + rectPosition.Y = rectY; + rect.Position = rectPosition; + + var rectSize = rect.Size; + rectSize.Y = height; + rect.Size = rectSize; + + sprite.RegionRect = rect; } } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs index 2adb72e..9db9d95 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs @@ -258,12 +258,12 @@ } /// - /// 类型: , 路径: RoomUI.Control.ActivePropBar.ActivePropGrey + /// 类型: , 路径: RoomUI.Control.ActivePropBar.CooldownProgress /// - public class UiNode_ActivePropGrey : IUiNode + public class UiNode_CooldownProgress : IUiNode { - public UiNode_ActivePropGrey(Godot.Sprite2D node) : base(node) { } - public override UiNode_ActivePropGrey Clone() => new ((Godot.Sprite2D)Instance.Duplicate()); + public UiNode_CooldownProgress(Godot.Sprite2D node) : base(node) { } + public override UiNode_CooldownProgress Clone() => new ((Godot.Sprite2D)Instance.Duplicate()); } /// @@ -285,12 +285,21 @@ } /// - /// 类型: , 路径: RoomUI.Control.ActivePropBar.ActivePropChargeProgress + /// 类型: , 路径: RoomUI.Control.ActivePropBar.ChargeProgressBar /// - public class UiNode_ActivePropChargeProgress : IUiNode + public class UiNode_ChargeProgressBar : IUiNode { - public UiNode_ActivePropChargeProgress(Godot.NinePatchRect node) : base(node) { } - public override UiNode_ActivePropChargeProgress Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); + public UiNode_ChargeProgressBar(Godot.NinePatchRect node) : base(node) { } + public override UiNode_ChargeProgressBar Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: RoomUI.Control.ActivePropBar.ChargeProgress + /// + public class UiNode_ChargeProgress : IUiNode + { + public UiNode_ChargeProgress(Godot.Sprite2D node) : base(node) { } + public override UiNode_ChargeProgress Clone() => new ((Godot.Sprite2D)Instance.Duplicate()); } /// @@ -325,17 +334,17 @@ private UiNode_ActivePropSprite _L_ActivePropSprite; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropGrey + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.CooldownProgress /// - public UiNode_ActivePropGrey L_ActivePropGrey + public UiNode_CooldownProgress L_CooldownProgress { get { - if (_L_ActivePropGrey == null) _L_ActivePropGrey = new UiNode_ActivePropGrey(Instance.GetNodeOrNull("ActivePropGrey")); - return _L_ActivePropGrey; + if (_L_CooldownProgress == null) _L_CooldownProgress = new UiNode_CooldownProgress(Instance.GetNodeOrNull("CooldownProgress")); + return _L_CooldownProgress; } } - private UiNode_ActivePropGrey _L_ActivePropGrey; + private UiNode_CooldownProgress _L_CooldownProgress; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropCount @@ -364,17 +373,30 @@ private UiNode_ActivePropPanel _L_ActivePropPanel; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropChargeProgress + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ChargeProgressBar /// - public UiNode_ActivePropChargeProgress L_ActivePropChargeProgress + public UiNode_ChargeProgressBar L_ChargeProgressBar { get { - if (_L_ActivePropChargeProgress == null) _L_ActivePropChargeProgress = new UiNode_ActivePropChargeProgress(Instance.GetNodeOrNull("ActivePropChargeProgress")); - return _L_ActivePropChargeProgress; + if (_L_ChargeProgressBar == null) _L_ChargeProgressBar = new UiNode_ChargeProgressBar(Instance.GetNodeOrNull("ChargeProgressBar")); + return _L_ChargeProgressBar; } } - private UiNode_ActivePropChargeProgress _L_ActivePropChargeProgress; + private UiNode_ChargeProgressBar _L_ChargeProgressBar; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ChargeProgress + /// + public UiNode_ChargeProgress L_ChargeProgress + { + get + { + if (_L_ChargeProgress == null) _L_ChargeProgress = new UiNode_ChargeProgress(Instance.GetNodeOrNull("ChargeProgress")); + return _L_ChargeProgress; + } + } + private UiNode_ChargeProgress _L_ChargeProgress; public UiNode_ActivePropBar(Godot.Control node) : base(node) { } public override UiNode_ActivePropBar Clone() => new ((Godot.Control)Instance.Duplicate());