mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-07 20:05:55 +00:00
Cheat gun recolor
This commit is contained in:
parent
dfe936461e
commit
2e01cd19e2
7 changed files with 54 additions and 11 deletions
|
|
@ -24,11 +24,7 @@ public partial class WeaponAmmoCounter : Container
|
|||
|
||||
Icon.Texture = item.InventorySprite;
|
||||
|
||||
InventoryManager.Instance.LoadedAmmoChanged += (weaponKey, count) =>
|
||||
{
|
||||
if (weaponKey != Item.WeaponData.ItemKey) return;
|
||||
LoadedAmmoLabel.Text = count.ToString();
|
||||
};
|
||||
InventoryManager.Instance.LoadedAmmoChanged += OnInstanceOnLoadedAmmoChanged;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(item.WeaponData.AmmoKey))
|
||||
{
|
||||
|
|
@ -52,6 +48,12 @@ public partial class WeaponAmmoCounter : Container
|
|||
InventoryManager.Instance.TotalAmmoChanged += OnInstanceOnTotalAmmoChanged;
|
||||
}
|
||||
|
||||
private void OnInstanceOnLoadedAmmoChanged(StringName weaponKey, int count)
|
||||
{
|
||||
if (weaponKey != Item.WeaponData.ItemKey) return;
|
||||
LoadedAmmoLabel.Text = count.ToString();
|
||||
}
|
||||
|
||||
private void OnInstanceOnTotalAmmoChanged(StringName ammoKey, int count)
|
||||
{
|
||||
if (ammoKey != Item.WeaponData.AmmoKey) return;
|
||||
|
|
@ -60,6 +62,7 @@ public partial class WeaponAmmoCounter : Container
|
|||
|
||||
public void Delete()
|
||||
{
|
||||
InventoryManager.Instance.LoadedAmmoChanged -= OnInstanceOnLoadedAmmoChanged;
|
||||
InventoryManager.Instance.TotalAmmoChanged -= OnInstanceOnTotalAmmoChanged;
|
||||
QueueFree();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue