From 549922f7b9f8f8822c9f60211761aef28485faad Mon Sep 17 00:00:00 2001 From: Aleksejs Sergejevs <17292064+Quickz@users.noreply.github.com> Date: Fri, 15 Jul 2022 20:37:33 +0300 Subject: [PATCH] updated insta-reload single clip weapon labels to display in format of "xxx" instead of "xxx-xxx" (#133) --- Assets/Scripts/UI/HUD.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/UI/HUD.cs b/Assets/Scripts/UI/HUD.cs index 62cb9966..f4eb1c72 100644 --- a/Assets/Scripts/UI/HUD.cs +++ b/Assets/Scripts/UI/HUD.cs @@ -206,7 +206,16 @@ namespace SanAndreasUnity.UI { this.weaponImage.texture = weaponTextureToDisplay; this.weaponAmmoText.enabled = true; - string ammoText = weapon != null ? weapon.AmmoOutsideOfClip + "-" + weapon.AmmoInClip : string.Empty; + string ammoText = string.Empty; + + if (weapon != null) + { + if (weapon.ReloadTime == 0f && weapon.AmmoClipSize == 1) + ammoText = weapon.TotalAmmo.ToString(); + else + ammoText = $"{weapon.AmmoOutsideOfClip}-{weapon.AmmoInClip}"; + } + if (this.weaponAmmoText.text != ammoText) this.weaponAmmoText.text = ammoText;