3 protected TurretComponent m_Turret;
7 override void DisplayUpdate(IEntity owner,
float timeSlice)
12 if (m_WeaponState.m_bReloading)
17 UpdateMagazineIndicator_Reloading(
false);
20 super.DisplayUpdate(owner, timeSlice);
26 super.OnMuzzleChanged(weapon, muzzle, prevMuzzle);
29 #ifndef WEAPON_INFO_BLOCK_WATERFALL_EVENTS
30 OnTurretReload_init(weapon);
42 #ifdef WEAPON_INFO_DEBUG_WATERFALL_EVENTS
43 Print(
"OnTurretReload_init");
44 Print(
string.Format(
" weapon: %1", weapon));
45 Print(
string.Format(
" finished: %1",
false));
55 #ifdef WEAPON_INFO_DEBUG
57 _print(
string.Format(
" weapon: %1", weapon));
58 _print(
string.Format(
" finished: %1", finished));
59 _print(
string.Format(
" turretController: %1", turretController));
65 m_WeaponState.m_bReloading = !finished;
67 UpdateMagazineIndicator_Reloading(finished);
71 protected void UpdateMagazineIndicator_Reloading(
bool finished)
73 float rldProgress = 0;
81 rldProgress = Math.Clamp((rldDuration - rldTime) / rldDuration, 0, 1);
84 m_Widgets.m_ReloadOutline.SetMaskProgress(rldProgress);
85 m_Widgets.m_ReloadOutline.SetVisible(rldProgress > 0);
87 m_Widgets.m_ReloadBackground.SetMaskProgress(rldProgress);
88 m_Widgets.m_ReloadBackground.SetVisible(rldProgress > 0);
92 override bool DisplayStartDrawInit(IEntity owner)
97 m_Turret = TurretComponent.Cast(owner.FindComponent(TurretComponent));
107 ChimeraCharacter character = ChimeraCharacter.Cast(slot.GetOccupant());
112 m_WeaponManager = BaseWeaponManagerComponent.Cast(owner.FindComponent(BaseWeaponManagerComponent));
120 AddEventHandlers(owner);
126 override void AddEventHandlers(IEntity owner)
143 override void RemoveEventHandlers(IEntity owner)
161 override SCR_2DSightsComponent GetSights()
166 SCR_2DSightsComponent sights = SCR_2DSightsComponent.Cast(m_Turret.FindComponent(SCR_2DSightsComponent));