4 Widget m_wChangeMuzzle;
7 EventHandlerManagerComponent m_EventHandlerManager;
11 override void HandlerAttached(Widget w)
13 GetGame().GetInputManager().AddActionListener(
"CharacterChangeAmmo", EActionTrigger.DOWN, Action_ChangeAmmo);
14 GetGame().GetInputManager().AddActionListener(
"CharacterChangeMuzzle", EActionTrigger.DOWN, Action_ChangeMuzzle);
16 m_wChangeAmmo = w.FindAnyWidget(
"ChangeAmmo");
17 m_wChangeMuzzle = w.FindAnyWidget(
"ChangeMuzzle");
18 m_wSafety = w.FindAnyWidget(
"Safety");
19 m_wRaiseWeapon = w.FindAnyWidget(
"RaiseWeapon");
21 ChimeraCharacter character = ChimeraCharacter.Cast(
SCR_PlayerController.GetLocalControlledEntity());
25 m_EventHandlerManager = EventHandlerManagerComponent.Cast(character.FindComponent(EventHandlerManagerComponent));
29 BaseWeaponManagerComponent weaponManager = BaseWeaponManagerComponent.Cast(character.FindComponent(BaseWeaponManagerComponent));
33 m_CurrentWeapon = weaponManager.GetCurrent();
34 OnWeaponChanged(m_CurrentWeapon);
37 override void HandlerDeattached(Widget w)
46 m_CurrentWeapon = weapon;
51 m_wRaiseWeapon.SetVisible(
false);
52 m_wChangeMuzzle.SetVisible(
false);
53 m_wChangeAmmo.SetVisible(
false);
54 m_wSafety.SetVisible(
false);
62 m_wRaiseWeapon.SetVisible(
true);
65 array<BaseMuzzleComponent> a;
66 int count = weapon.GetMuzzlesList(a);
67 m_wChangeMuzzle.SetVisible(count > 1);
70 bool hasSafetyMode =
false;
74 array<BaseFireMode> fireModes;
75 muzzle.GetFireModesList(fireModes);
85 m_wSafety.SetVisible(hasSafetyMode);
88 void Action_ChangeAmmo()
90 if (!m_CurrentWeapon || !m_wChangeAmmo.IsVisible())
96 void Action_ChangeMuzzle()
98 if (!m_CurrentWeapon || !m_wChangeMuzzle.IsVisible())