mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:15:45 +00:00
Separated ammo and notifications from hud
This commit is contained in:
parent
d644cece7f
commit
46c433e5f7
39 changed files with 258 additions and 86 deletions
|
|
@ -21,8 +21,8 @@ _name = "Intro"
|
|||
[sub_resource type="Resource" id="Resource_cfhv5"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0k62o"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -34,8 +34,8 @@ StartData = SubResource("Resource_cfhv5")
|
|||
[sub_resource type="Resource" id="Resource_tpb7s"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_edoov"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -47,8 +47,8 @@ StartData = SubResource("Resource_tpb7s")
|
|||
[sub_resource type="Resource" id="Resource_1sw5g"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 255
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_47bot"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -61,7 +61,7 @@ StartData = SubResource("Resource_1sw5g")
|
|||
script = ExtResource("1_ov731")
|
||||
EggIndex = 2
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([ExtResource("3_fydgr"), ExtResource("4_38yta"), ExtResource("5_em757"), ExtResource("6_sdmg8")])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mgdm6"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -79,8 +79,8 @@ _name = "Rebel Base"
|
|||
[sub_resource type="Resource" id="Resource_maxpt"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pein5"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -117,7 +117,7 @@ _name = "Default Scene"
|
|||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([ExtResource("7_b3oo5")])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6ijnv"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -136,8 +136,8 @@ metadata/_custom_type_script = "uid://dnthdjrx78u6m"
|
|||
[sub_resource type="Resource" id="Resource_7sue8"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 255
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ognca"]
|
||||
|
|
@ -151,8 +151,8 @@ metadata/_custom_type_script = "uid://dnthdjrx78u6m"
|
|||
[sub_resource type="Resource" id="Resource_olpjo"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_nbnej"]
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Amount = 20
|
|||
Max = 250
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 2
|
||||
UiType = 0
|
||||
Selectable = false
|
||||
AutoPickup = true
|
||||
InventorySprite = SubResource("AtlasTexture_3y0hf")
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 3
|
||||
Selectable = false
|
||||
AutoPickup = false
|
||||
InventorySprite = SubResource("AtlasTexture_ebbst")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = true
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 0
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("2_0vddk")
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Amount = 1
|
|||
Max = 99
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 1
|
||||
UiType = 6
|
||||
Selectable = false
|
||||
AutoPickup = false
|
||||
InventorySprite = SubResource("AtlasTexture_munhl")
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 3
|
||||
Selectable = false
|
||||
AutoPickup = false
|
||||
InventorySprite = SubResource("AtlasTexture_iasoh")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("2_4ibag")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_hq5ny")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 0
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_qo2ul")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_l7ik6")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_wkd5q")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_cr14o")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("2_eaoas")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("2_3abss")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_mj87v")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_cked8")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 22
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_h548w")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Amount = 1
|
|||
Max = 10
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 0
|
||||
UiType = 6
|
||||
Selectable = true
|
||||
AutoPickup = true
|
||||
InventorySprite = ExtResource("1_woor7")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 14
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_qxsuv")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Amount = 10
|
|||
Max = 50
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 2
|
||||
UiType = 0
|
||||
Selectable = false
|
||||
AutoPickup = true
|
||||
InventorySprite = ExtResource("1_nas3h")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Amount = 1
|
|||
Max = 100
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 0
|
||||
UiType = 6
|
||||
Selectable = false
|
||||
AutoPickup = true
|
||||
InventorySprite = ExtResource("1_nsfmo")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Amount = 1
|
|||
Max = 100
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 2
|
||||
UiType = 6
|
||||
Selectable = false
|
||||
AutoPickup = true
|
||||
InventorySprite = ExtResource("1_cang8")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 3
|
||||
Selectable = false
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_glhfu")
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ Amount = 1
|
|||
Max = 10
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 0
|
||||
UiType = 6
|
||||
Selectable = true
|
||||
AutoPickup = true
|
||||
InventorySprite = SubResource("AtlasTexture_gpot4")
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 3
|
||||
Selectable = false
|
||||
AutoPickup = false
|
||||
InventorySprite = SubResource("AtlasTexture_ew85h")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Amount = 10
|
|||
Max = 50
|
||||
PickupIfMaxed = false
|
||||
ConsumeOnUse = true
|
||||
UiType = 2
|
||||
UiType = 0
|
||||
Selectable = false
|
||||
AutoPickup = true
|
||||
InventorySprite = ExtResource("1_jt7l8")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Amount = 1
|
|||
Max = 1
|
||||
PickupIfMaxed = true
|
||||
ConsumeOnUse = false
|
||||
UiType = 1
|
||||
UiType = 0
|
||||
Selectable = true
|
||||
AutoPickup = false
|
||||
InventorySprite = ExtResource("1_2w24o")
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="MapResource" load_steps=5 format=3 uid="uid://b4u3cs6ietmow"]
|
||||
[gd_resource type="Resource" script_class="MapResource" load_steps=4 format=3 uid="uid://b4u3cs6ietmow"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://mja0rk7n2kln" path="res://Scripts/Resources/MapStartDataResource.cs" id="1_3bwtp"]
|
||||
[ext_resource type="Script" uid="uid://quy4d4tgvqfy" path="res://Scripts/Resources/MapResource.cs" id="1_5stb7"]
|
||||
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="1_dpitu"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_dpitu"]
|
||||
script = ExtResource("1_3bwtp")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("1_dpitu")]([])
|
||||
RemoveEquipment = Array[ExtResource("1_dpitu")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[resource]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=36 format=3 uid="uid://dkwi1hu1bixoe"]
|
||||
[gd_scene load_steps=37 format=3 uid="uid://dkwi1hu1bixoe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://baf6pxbvhqmjk" path="res://Scripts/Hud.cs" id="1_m0hb0"]
|
||||
[ext_resource type="PackedScene" uid="uid://cd3ee1adstcrw" path="res://Scenes/HUD/HudItemContainer.tscn" id="2_mattb"]
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://cihsd5rw8i5xm" path="res://Sprites/UI/ShieldBar_Foreground.png" id="13_j6myr"]
|
||||
[ext_resource type="StyleBox" uid="uid://24hh6h4juk3r" path="res://Resources/Styles/PixelStyleBoxRed_SquareBackground.tres" id="13_sjdna"]
|
||||
[ext_resource type="Script" uid="uid://cwd3sksjqpuy3" path="res://Scripts/Utils/FpsCounterLabel.cs" id="15_x61tu"]
|
||||
[ext_resource type="StyleBox" uid="uid://ctw2hju32l3rg" path="res://Resources/Styles/PixelStyleBoxRed.tres" id="17_bljno"]
|
||||
[ext_resource type="Texture2D" uid="uid://duwiasewxvcb5" path="res://Sprites/Items/Icicle_Gun.png" id="19_h6xwv"]
|
||||
[ext_resource type="Texture2D" uid="uid://c8fr1ea20odaw" path="res://Sprites/Items/Heart_Extend.png" id="19_j6myr"]
|
||||
[ext_resource type="Texture2D" uid="uid://cid62phhew3ep" path="res://Sprites/UI/StatusSprite02.png" id="19_n0pka"]
|
||||
|
|
@ -86,7 +87,7 @@ texture_margin_bottom = 3.0
|
|||
[sub_resource type="LabelSettings" id="LabelSettings_bkqle"]
|
||||
font_color = Color(0, 0.737255, 0.113725, 1)
|
||||
|
||||
[node name="HUD" type="CanvasLayer" node_paths=PackedStringArray("_healthLabel", "_healthBar", "_shieldLabel", "_shieldBar", "_motivationLabel", "_itemsContainer", "_gameOverPanel", "_fairyTerminatedPanel", "_hudInfoPanel", "PauseMenuContainer", "DebugMenuHolder")]
|
||||
[node name="HUD" type="CanvasLayer" node_paths=PackedStringArray("_healthLabel", "_healthBar", "_shieldLabel", "_shieldBar", "_motivationLabel", "_itemsContainer", "_gameOverPanel", "_fairyTerminatedPanel", "_hudInfoPanel", "NotificationsContainer", "WeaponContainer", "PauseMenuContainer", "DebugMenuHolder")]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_m0hb0")
|
||||
WeaponContainerTemplate = ExtResource("2_mattb")
|
||||
|
|
@ -101,6 +102,8 @@ _labelSettings = ExtResource("2_x7kl7")
|
|||
_gameOverPanel = NodePath("GameOver")
|
||||
_fairyTerminatedPanel = NodePath("FairyTerminated")
|
||||
_hudInfoPanel = NodePath("HudInfo")
|
||||
NotificationsContainer = NodePath("NotificationsContainer")
|
||||
WeaponContainer = NodePath("WeaponContainer")
|
||||
PauseMenuContainer = NodePath("PauseMenuContainer")
|
||||
PauseMenuScene = ExtResource("3_hxmxt")
|
||||
DebugMenuTemplate = ExtResource("4_gd1k6")
|
||||
|
|
@ -251,6 +254,24 @@ layout_mode = 2
|
|||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="NotificationsContainer" type="VBoxContainer" parent="."]
|
||||
offset_left = 161.0
|
||||
offset_top = 123.0
|
||||
offset_right = 317.0
|
||||
offset_bottom = 157.0
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 2
|
||||
|
||||
[node name="WeaponContainer" type="PanelContainer" parent="."]
|
||||
offset_left = 3.0
|
||||
offset_top = 132.0
|
||||
offset_right = 30.0
|
||||
offset_bottom = 151.0
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("9_sx5r0")
|
||||
theme_override_styles/panel = ExtResource("17_bljno")
|
||||
|
||||
[node name="BossHud" parent="." instance=ExtResource("5_vmict")]
|
||||
visible = false
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
script = ExtResource("4_u1i8n")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_rgw1q")]([ExtResource("3_6314l")])
|
||||
RemoveEquipment = Array[ExtResource("2_rgw1q")]([])
|
||||
RemoveEquipment = []
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_1tvdd"]
|
||||
|
|
@ -476,7 +476,7 @@ TimeModifiers = Array[ExtResource("50_6khjs")]([])
|
|||
WaitForCompletion = true
|
||||
metadata/_custom_type_script = "uid://c0ndqalsc4jve"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_okvfm"]
|
||||
[sub_resource type="Resource" id="Resource_rgw1q"]
|
||||
resource_local_to_scene = true
|
||||
script = ExtResource("39_83jc5")
|
||||
Patterns = Array[Object]([SubResource("Resource_kuo18")])
|
||||
|
|
@ -810,7 +810,7 @@ InvertSignal = true
|
|||
|
||||
[node name="FloorEmitter2" parent="Tilemaps/Actors" instance=ExtResource("44_b8ffn")]
|
||||
position = Vector2(601, 147)
|
||||
Script = SubResource("Resource_okvfm")
|
||||
Script = SubResource("Resource_rgw1q")
|
||||
InvertSignal = true
|
||||
|
||||
[node name="Camera" parent="Tilemaps/Actors" instance=ExtResource("48_r562v")]
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ ActivationType = 0
|
|||
Targets = Array[NodePath]([NodePath("../Rumia")])
|
||||
WaitForCompletion = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_jm0wb"]
|
||||
[sub_resource type="Resource" id="Resource_7lma1"]
|
||||
resource_local_to_scene = true
|
||||
script = ExtResource("49_0si7g")
|
||||
Target = NodePath(".")
|
||||
|
|
@ -1247,7 +1247,7 @@ Events = Array[ExtResource("62_w8skm")]([SubResource("Resource_068l7"), SubResou
|
|||
|
||||
[node name="BossBattleStartScript" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("43_kf3qc")]
|
||||
position = Vector2(-1487, -396)
|
||||
Events = Array[ExtResource("62_w8skm")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_jm0wb")])
|
||||
Events = Array[ExtResource("62_w8skm")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_7lma1")])
|
||||
|
||||
[node name="Enemy13" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("47_u1ve6")]
|
||||
position = Vector2(-1657, -788)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.UI;
|
||||
using Cirno.Scripts.Utils;
|
||||
|
||||
public partial class Hud : CanvasLayer
|
||||
{
|
||||
|
|
@ -44,7 +45,10 @@ public partial class Hud : CanvasLayer
|
|||
[Export] private Container _fairyTerminatedPanel;
|
||||
|
||||
[Export] private Container _hudInfoPanel;
|
||||
|
||||
[Export] public Container NotificationsContainer { get; private set; }
|
||||
|
||||
[Export] public Container WeaponContainer { get; private set; }
|
||||
|
||||
[ExportGroup("Pause Menu")] [Export]
|
||||
public Control PauseMenuContainer;
|
||||
[ExportGroup("Pause Menu")] [Export]
|
||||
|
|
@ -57,12 +61,16 @@ public partial class Hud : CanvasLayer
|
|||
[ExportGroup("Debug Menu")]
|
||||
[Export]
|
||||
public Control DebugMenuHolder { get; set; }
|
||||
|
||||
|
||||
|
||||
private Dictionary<string, WeaponAmmoCounter> _items = new();
|
||||
|
||||
private PauseMenu _pauseMenu;
|
||||
|
||||
private bool _playerDead = false; // useless
|
||||
|
||||
private WeaponAmmoCounter _weapon;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -78,9 +86,20 @@ public partial class Hud : CanvasLayer
|
|||
{
|
||||
var instance = ItemNotificationTemplate.Instantiate<ItemNotification>();
|
||||
|
||||
_itemsContainer.CallDeferred("add_child", instance);
|
||||
NotificationsContainer.CallDeferred("add_child", instance);
|
||||
|
||||
instance.Init(item, currentamount, ItemsNotificationTimeout);
|
||||
|
||||
if (item.UiType.HasAnyFlag(UiItemType.Ammo | UiItemType.Energy))
|
||||
{
|
||||
AddWeapon(item);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.UiType.HasAnyFlag(UiItemType.Icon | UiItemType.Count))
|
||||
{
|
||||
AddInventoryItem(item, currentamount);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowMessage(string text)
|
||||
|
|
@ -165,9 +184,22 @@ public partial class Hud : CanvasLayer
|
|||
//_selector.Position = _selector.tolo
|
||||
}
|
||||
|
||||
private void AddWeapon(LootItem item)
|
||||
{
|
||||
_weapon?.Delete();
|
||||
|
||||
var instance = WeaponContainerTemplate.Instantiate<WeaponAmmoCounter>();
|
||||
|
||||
WeaponContainer.CallDeferred("add_child", instance);
|
||||
|
||||
instance.Init(item);
|
||||
|
||||
_weapon = instance;
|
||||
}
|
||||
|
||||
public void AddInventoryItem(LootItem item, int currentAmount)
|
||||
{
|
||||
if (item.UiType == UiItemType.NoUI) return;
|
||||
if (item.UiType == 0) return;
|
||||
|
||||
if (!_items.TryGetValue(item.ItemKey, out var item1))
|
||||
{
|
||||
|
|
@ -355,13 +387,14 @@ public partial class Hud : CanvasLayer
|
|||
}
|
||||
|
||||
// Clear all items
|
||||
foreach (var hudItem in _items)
|
||||
{
|
||||
hudItem.Value.Delete();
|
||||
}
|
||||
_items.Clear();
|
||||
// foreach (var hudItem in _items)
|
||||
// {
|
||||
// hudItem.Value.Delete();
|
||||
// }
|
||||
// _items.Clear();
|
||||
|
||||
AddInventoryItem(item.Item, item.Count);
|
||||
AddWeapon(item.Item);
|
||||
//AddInventoryItem(item.Item, item.Count);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ public partial class LootItem : Resource
|
|||
[Export] public int Max;
|
||||
[Export] public bool PickupIfMaxed;
|
||||
[Export] public bool ConsumeOnUse;
|
||||
[Export] public UiItemType UiType;
|
||||
|
||||
[Export(PropertyHint.Flags, "Icon,Count,Ammo,Energy")]
|
||||
public UiItemType UiType { get; set; } = 0;
|
||||
[Export] public bool Selectable;
|
||||
[Export] public bool AutoPickup { get; private set; } = false;
|
||||
[Export] public Texture2D InventorySprite;
|
||||
|
|
@ -42,11 +44,4 @@ public partial class LootItem : Resource
|
|||
|
||||
return spawnedItem;
|
||||
}
|
||||
}
|
||||
|
||||
public enum UiItemType
|
||||
{
|
||||
NoUI,
|
||||
Icon,
|
||||
IconText
|
||||
}
|
||||
13
Scripts/Resources/UiItemType.cs
Normal file
13
Scripts/Resources/UiItemType.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace Cirno.Scripts.Resources;
|
||||
|
||||
[Flags]
|
||||
public enum UiItemType
|
||||
{
|
||||
Icon = 1 << 1,
|
||||
Count = 1 << 2,
|
||||
Ammo = 1 << 3,
|
||||
Energy = 1 << 4,
|
||||
|
||||
}
|
||||
1
Scripts/Resources/UiItemType.cs.uid
Normal file
1
Scripts/Resources/UiItemType.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://daol2o7sgpqio
|
||||
|
|
@ -13,39 +13,86 @@ public partial class WeaponAmmoCounter : Container
|
|||
[Export]
|
||||
public TextureRect AmmoIcon { get; private set; }
|
||||
|
||||
[Export]
|
||||
public Label TotalAmmoLabel { get; private set; }
|
||||
[Export]
|
||||
public Label LoadedAmmoLabel { get; private set; }
|
||||
// The actual ammo label
|
||||
[Export] public Label TotalAmmoLabel { get; private set; }
|
||||
|
||||
// Item count label
|
||||
[Export] public Label LoadedAmmoLabel { get; private set; }
|
||||
|
||||
public void Init(LootItem item)
|
||||
{
|
||||
Item = item;
|
||||
|
||||
// If it has icon show it
|
||||
// if it has count show it
|
||||
// if it has ammo show it
|
||||
|
||||
// What's the point of having count and ammo without icon?
|
||||
|
||||
Icon.Texture = item.InventorySprite;
|
||||
|
||||
InventoryManager.Instance.LoadedAmmoChanged += OnInstanceOnLoadedAmmoChanged;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(item.WeaponData.AmmoKey))
|
||||
if (!item.UiType.HasFlag(UiItemType.Icon))
|
||||
{
|
||||
TotalAmmoLabel.Hide();
|
||||
AmmoIcon.Hide();
|
||||
return;
|
||||
Icon.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Icon.Texture = item.InventorySprite;
|
||||
}
|
||||
|
||||
if (InventoryManager.Instance.TryGetItem(item.WeaponData.AmmoKey, out var ammoItem))
|
||||
if (!item.UiType.HasFlag(UiItemType.Count))
|
||||
{
|
||||
AmmoIcon.Texture = ammoItem.Item.InventorySprite;
|
||||
LoadedAmmoLabel.Hide();
|
||||
}
|
||||
|
||||
if (item.UiType.HasFlag(UiItemType.Ammo))
|
||||
{
|
||||
InventoryManager.Instance.LoadedAmmoChanged += OnInstanceOnLoadedAmmoChanged;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(item.WeaponData?.AmmoKey))
|
||||
{
|
||||
TotalAmmoLabel.Hide();
|
||||
AmmoIcon.Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (InventoryManager.Instance.TryGetItem(item.WeaponData?.AmmoKey, out var ammoItem))
|
||||
{
|
||||
AmmoIcon.Texture = ammoItem.Item.InventorySprite;
|
||||
}
|
||||
UpdateAmmoCounter();
|
||||
|
||||
// Register this only if there's ammo
|
||||
InventoryManager.Instance.TotalAmmoChanged += OnInstanceOnTotalAmmoChanged;
|
||||
}
|
||||
else
|
||||
{
|
||||
AmmoIcon.Hide();
|
||||
TotalAmmoLabel.Hide();
|
||||
|
||||
// Here sync the item count if it has no ammo but has count
|
||||
if (item.UiType.HasFlag(UiItemType.Count))
|
||||
{
|
||||
InventoryManager.Instance.ItemAdded += ItemAmountChanged;
|
||||
InventoryManager.Instance.ItemRemoved += ItemAmountRemoved;
|
||||
}
|
||||
|
||||
}
|
||||
//AmmoIcon.Texture = InventoryManager.Instance.
|
||||
|
||||
}
|
||||
|
||||
UpdateCounter();
|
||||
// Register this only if there's ammo
|
||||
InventoryManager.Instance.TotalAmmoChanged += OnInstanceOnTotalAmmoChanged;
|
||||
private void ItemAmountChanged(LootItem item, int currentAmount)
|
||||
{
|
||||
if (item.ItemKey == Item.ItemKey)
|
||||
{
|
||||
LoadedAmmoLabel.Text = currentAmount.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ItemAmountRemoved(string key, int currentAmount)
|
||||
{
|
||||
if (key == Item.ItemKey)
|
||||
{
|
||||
LoadedAmmoLabel.Text = currentAmount.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnInstanceOnLoadedAmmoChanged(StringName weaponKey, int count)
|
||||
|
|
@ -64,10 +111,12 @@ public partial class WeaponAmmoCounter : Container
|
|||
{
|
||||
InventoryManager.Instance.LoadedAmmoChanged -= OnInstanceOnLoadedAmmoChanged;
|
||||
InventoryManager.Instance.TotalAmmoChanged -= OnInstanceOnTotalAmmoChanged;
|
||||
InventoryManager.Instance.ItemAdded -= ItemAmountChanged;
|
||||
InventoryManager.Instance.ItemRemoved -= ItemAmountRemoved;
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
private void UpdateCounter()
|
||||
private void UpdateAmmoCounter()
|
||||
{
|
||||
TotalAmmoLabel.Text = InventoryManager.Instance.GetItemCount(Item.WeaponData.AmmoKey).ToString();
|
||||
}
|
||||
|
|
|
|||
48
Scripts/Utils/EnumsFlagsExtensions.cs
Normal file
48
Scripts/Utils/EnumsFlagsExtensions.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
|
||||
namespace Cirno.Scripts.Utils;
|
||||
|
||||
public static class EnumFlagsExtensions
|
||||
{
|
||||
public static bool HasAllFlags<T>(this T value, T flags) where T : Enum
|
||||
{
|
||||
var valueInt = Convert.ToUInt64(value);
|
||||
var flagsInt = Convert.ToUInt64(flags);
|
||||
return (valueInt & flagsInt) == flagsInt;
|
||||
}
|
||||
|
||||
public static bool HasAnyFlag<T>(this T value, T flags) where T : Enum
|
||||
{
|
||||
var valueInt = Convert.ToUInt64(value);
|
||||
var flagsInt = Convert.ToUInt64(flags);
|
||||
return (valueInt & flagsInt) != 0;
|
||||
}
|
||||
|
||||
public static bool HasNoFlags<T>(this T value, T flags) where T : Enum
|
||||
{
|
||||
var valueInt = Convert.ToUInt64(value);
|
||||
var flagsInt = Convert.ToUInt64(flags);
|
||||
return (valueInt & flagsInt) == 0;
|
||||
}
|
||||
|
||||
public static T AddFlags<T>(this T value, T flags) where T : Enum
|
||||
{
|
||||
var valueInt = Convert.ToUInt64(value);
|
||||
var flagsInt = Convert.ToUInt64(flags);
|
||||
return (T)Enum.ToObject(typeof(T), valueInt | flagsInt);
|
||||
}
|
||||
|
||||
public static T RemoveFlags<T>(this T value, T flags) where T : Enum
|
||||
{
|
||||
var valueInt = Convert.ToUInt64(value);
|
||||
var flagsInt = Convert.ToUInt64(flags);
|
||||
return (T)Enum.ToObject(typeof(T), valueInt & ~flagsInt);
|
||||
}
|
||||
|
||||
public static T ToggleFlags<T>(this T value, T flags) where T : Enum
|
||||
{
|
||||
var valueInt = Convert.ToUInt64(value);
|
||||
var flagsInt = Convert.ToUInt64(flags);
|
||||
return (T)Enum.ToObject(typeof(T), valueInt ^ flagsInt);
|
||||
}
|
||||
}
|
||||
1
Scripts/Utils/EnumsFlagsExtensions.cs.uid
Normal file
1
Scripts/Utils/EnumsFlagsExtensions.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d11mwshvtc327
|
||||
|
|
@ -23,6 +23,18 @@
|
|||
}
|
||||
},
|
||||
"res://Resources/Items/": {
|
||||
"ConsumeOnUse": {
|
||||
"visibility": 0.0
|
||||
},
|
||||
"ItemEffect": {
|
||||
"visibility": 0.0
|
||||
},
|
||||
"PickupIfMaxed": {
|
||||
"visibility": 0.0
|
||||
},
|
||||
"WeaponData": {
|
||||
"visibility": 0.0
|
||||
},
|
||||
"metadata/_custom_type_script": {
|
||||
"visibility": 0.0
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue