3 protected SCR_RadioComponent m_RadioComp;
7 protected bool m_bTuneUp;
9 override bool CanBeShownScript(IEntity user)
14 CharacterControllerComponent charComp = CharacterControllerComponent.Cast(user.FindComponent(CharacterControllerComponent));
15 return charComp.GetInspect();
18 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
21 if (CanBePerformed(pUserEntity))
22 changeFreq = m_RadioComp.ChangeFrequencyStep(m_bTuneUp);
30 soundMan.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent.SOUND_ITEM_RADIO_TUNE_ERROR);
35 soundMan.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent.SOUND_ITEM_RADIO_TUNE_UP);
37 soundMan.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent.SOUND_ITEM_RADIO_TUNE_DOWN);
41 override bool HasLocalEffectOnlyScript()
46 override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
48 m_RadioComp = SCR_RadioComponent.Cast(pOwnerEntity.FindComponent(SCR_RadioComponent));
51 override bool GetActionNameScript(out
string outName)
53 BaseRadioComponent radioComp = m_RadioComp.GetRadioComponent();
62 float targetFreq = transceiver.GetFrequency() + transceiver.GetFrequencyResolution();
64 targetFreq = transceiver.GetFrequency() - transceiver.GetFrequencyResolution();
66 outName = WidgetManager.Translate(
"#AR-UserAction_TuneRadioToFrequency", targetFreq / 1000);