16 float m_fActiveTimeout;
25 void HideTransmission()
51 class SCR_VonDisplay : SCR_InfoDisplayExtended
53 [
Attribute(
"{2EFEA2AF1F38E7F0}UI/Textures/Icons/icons_wrapperUI-64.m_sImageSet")];
56 [
Attribute(
"{ABC6B36856013403}UI/Textures/Icons/icons_wrapperUI-64-glow.m_sImageSet")];
59 [
Attribute(
"{25221F619214A722}UI/layouts/HUD/VON/VoNOverlay_Element.layout")];
80 const ref Color
COLOR_WHITE = Color.FromSRGBA(255, 255, 255, 255);
139 frequency = transmitter.GetFrequency();
163 if (!widget.IsVisible())
198 pTransmission.m_bIsAdditional =
true;
199 pTransmission.m_bVisible =
true;
204 pTransmission.m_bIsAdditional =
false;
207 pTransmission.m_fQuality = quality;
214 if (pTransmission.m_bIsActive ==
false
215 || pTransmission.m_RadioTransceiver != receiver
216 || (receiver && pTransmission.m_fFrequency != frequency)
222 pTransmission.HideTransmission();
227 pTransmission.m_bIsActive =
true;
228 pTransmission.m_fActiveTimeout = 0;
240 data.m_RadioTransceiver = radioTransceiver;
241 data.m_bForceUpdate =
false;
248 int controlledID =
GetGame().GetPlayerController().GetPlayerId();
251 if (controlledID && factionMgr)
253 playerFaction = factionMgr.SGetPlayerFaction(controlledID);
254 data.m_Faction = factionMgr.SGetPlayerFaction(
data.m_iPlayerID);
257 bool enemyTransmission;
258 if (IsReceiving && playerFaction && playerFaction.IsFactionEnemy(
data.m_Faction))
260 if (!radioTransceiver)
263 enemyTransmission =
true;
266 if (!
data.m_wBaseWidget)
269 if (
data.m_bIsAdditional)
273 data.m_bIsAnimating =
true;
274 data.m_wBaseWidget.SetVisible(
true);
275 data.m_Widgets.m_wIcon.SetVisible(
true);
276 data.m_Widgets.m_wMicFrame.SetVisible(
false);
277 data.m_Widgets.m_wChannelFrame.SetVisible(
false);
278 data.m_Widgets.m_wFrequency.SetVisible(
false);
279 data.m_Widgets.m_wSeparator.SetVisible(
false);
282 if (radioTransceiver)
287 data.m_fFrequency = frequency;
288 adjustedFreq = Math.Round(
data.m_fFrequency * 0.1) / 100;
290 data.m_Widgets.m_wFrequency.SetVisible(
true);
292 if (adjustedFreq == 0)
293 Print(
"SCR_VonDisplay: Incoming frequency 0 | base: " + frequency +
" | adjusted: " + adjustedFreq, LogLevel.WARNING);
301 if (sDeviceIcon !=
string.Empty)
312 if (!enemyTransmission)
314 data.m_Entity =
GetGame().GetPlayerManager().GetPlayerControlledEntity(
data.m_iPlayerID);
315 SCR_PossessingManagerComponent possMgr = SCR_PossessingManagerComponent.GetInstance();
316 if (
data.m_Entity && possMgr && possMgr.IsPossessing(
data.m_iPlayerID))
318 SCR_CharacterIdentityComponent scrCharIdentity = SCR_CharacterIdentityComponent.Cast(
data.m_Entity.FindComponent(SCR_CharacterIdentityComponent));
322 array<string> nameParams = {};
323 scrCharIdentity.GetFormattedFullName(name, nameParams);
324 data.m_Widgets.m_wName.SetTextFormat(name, nameParams[0], nameParams[1], nameParams[2])
328 CharacterIdentityComponent charIdentity = CharacterIdentityComponent.Cast(
data.m_Entity.FindComponent(CharacterIdentityComponent));
329 if (charIdentity && charIdentity.GetIdentity())
330 data.m_Widgets.m_wName.SetText(charIdentity.GetIdentity().GetName());
341 data.m_Widgets.m_wName.SetVisible(
true);
343 if (radioTransceiver)
344 data.m_Widgets.m_wSeparator.SetVisible(
false);
348 data.m_Widgets.m_wIcon.SetColor(Color.FromInt(GUIColors.ORANGE.PackToInt()));
349 data.m_Widgets.m_wName.SetText(
string.Empty);
350 data.m_Widgets.m_wName.SetVisible(
false);
352 if (radioTransceiver)
358 int factionHQFrequency =
SCR_Faction.Cast(playerFaction).GetFactionRadioFrequency();
359 if (factionHQFrequency == frequency)
362 data.m_Widgets.m_wChannelFrame.SetVisible(
true);
382 if (!
data.m_wBaseWidget)
385 if (
data.m_bIsActive)
387 data.m_wBaseWidget.SetVisible(
true);
388 data.m_bVisible =
true;
391 if (
data.m_fAlpha > 0.99)
394 data.m_bIsAnimating =
false;
400 if (
data.m_fAlpha < 0.01)
405 data.m_bIsActive =
false;
406 data.m_bIsAnimating =
false;
407 data.m_fActiveTimeout = 0;
408 data.m_bVisible =
false;
412 data.HideTransmission();
419 data.m_wBaseWidget.SetOpacity(
data.m_fAlpha);
437 string formatText =
"#AR-VON_ChannelHint";
438 m_wSelectedVON.SetTextFormat(formatText, radioEntry.GetUIInfo().GetName(), radioEntry.GetTransceiverNumber(), radioEntry.GetDisplayText());
456 if (isServerDisabled)
523 for (
int i = 0; i < count; i++)
596 w.RemoveFromHierarchy();
656 for (
int i = count; i >= 0; i--)
669 if (pTransmission.m_bIsActive)
671 pTransmission.m_fActiveTimeout += timeSlice;
675 pTransmission.m_bIsActive =
false;
676 pTransmission.m_bIsAnimating =
true;
681 if (pTransmission.m_bIsAnimating)
682 OpacityFade(pTransmission, timeSlice, isAdditional);
685 if (!pTransmission.m_bVisible)
687 if (pTransmission.m_iPlayerID)
745 for (
int i = 0; i < count; i++)