Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SingleMagazineWidgetComponent_RocketPod.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override void UpdateAmmoCount(BaseWeaponComponent weapon)
5 {
6 int curAmmo = weapon.GetCurrentMuzzle().GetAmmoCount();
7 int maxAmmo = weapon.GetCurrentMuzzle().GetMaxAmmoCount();
8
9 if (maxAmmo == 0)
10 {
11 Print("Division by 0! Weapon Max Ammo not set in " + this, LogLevel.ERROR);
12 return;
13 }
14
15 float fillPercent = curAmmo / maxAmmo;
16 m_wMagazineProgress.SetMaskProgress(fillPercent);
17
18 m_wMagazineEmpty.SetVisible(curAmmo == 0);
19 }
20
21 //------------------------------------------------------------------------------------------------
23 {
24 SCR_RocketEjectorMuzzleComponent muzzle = SCR_RocketEjectorMuzzleComponent.Cast(weapon.GetCurrentMuzzle());
25 if (!muzzle)
26 return 0;
27
28 IEntity rocket = muzzle.GetBarrelProjectile(muzzle.GetCurrentBarrelIndex());
29 if (!rocket)
30 return 0;
31
33 if (!magInfoComp)
34 return 0;
35
36 MagazineUIInfo rocketInfoUI = MagazineUIInfo.Cast(magInfoComp.GetUIInfo());
37 if (!rocketInfoUI)
38 return 0;
39
40 return rocketInfoUI.GetAmmoTypeFlags();
41 }
42}
EAmmoType
proto external Managed FindComponent(typename typeName)
EAmmoType GetAmmoTypeFlags()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14