7 private SignalsManagerComponent m_SignalManager;
8 private int m_iPushButtonStart;
10 const static int RESET_BUTTON_TIME = 500;
11 const static float BUTTON_PRESSED_STATE = -0.005;
12 const static int BUTTON_DEFAULT_STATE = 0;
15 override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
19 m_SignalManager = SignalsManagerComponent.Cast(pOwnerEntity.FindComponent(SignalsManagerComponent));
23 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
27 PlayerController playerController =
GetGame().GetPlayerController();
28 if (!playerController)
33 if (!firingRangeNetworkEntity)
37 int playerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity);
40 firingRangeNetworkEntity.ClearPlayerScore(playerID, m_FiringRangeManager);
42 firingRangeNetworkEntity.RemoveIndicators(pOwnerEntity, m_FiringRangeManager);
44 firingRangeNetworkEntity.SetPlayerScoreMax(playerID, m_LineController.GetMaxScoreInRound(), m_FiringRangeManager);
46 firingRangeNetworkEntity.ErectRandomTargets(pOwnerEntity,playerID);
49 m_SignalManager.SetSignalValue(m_iPushButtonStart, BUTTON_PRESSED_STATE);
50 GetGame().GetCallqueue().CallLater(ResetStartButton, RESET_BUTTON_TIME,
false);
54 override bool CanBeShownScript(IEntity user)
57 if (m_FiringRangeManager)
58 return m_LineController.GetFiringLineOwnerId() == m_LineController.NO_TARGET_OWNER;
64 override bool GetActionNameScript(out
string outName)
66 outName = (
"#AR-FiringRange_ActionStartRound-UC");
71 override bool HasLocalEffectOnlyScript()
77 void ResetStartButton()
79 m_SignalManager.SetSignalValue(m_iPushButtonStart, BUTTON_DEFAULT_STATE);