mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-21 19:43:03 +00:00
updated insta-reload single clip weapon labels to display in format of "xxx" instead of "xxx-xxx" (#133)
This commit is contained in:
parent
6f0605f839
commit
549922f7b9
1 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue