Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_LoadCasualtySupportStationUserAction.c
Go to the documentation of this file.
2{
3 [Attribute("#AR-UserAction_LoadCasualty_NoSpace", desc: "Text shown when character can not be loaded as there is no space in the vehicle", uiwidget: UIWidgets.LocaleEditBox)]
5
6 protected CharacterControllerComponent m_CharacterController;
7 protected FactionAffiliationComponent m_FactionAffiliation;
8
9 //------------------------------------------------------------------------------------------------
11 {
12 return ESupportStationType.LOAD_CASUALTY;
13 }
14
15 //------------------------------------------------------------------------------------------------
16 protected override void DelayedInit(IEntity owner)
17 {
18 if (!owner)
19 return;
20
21 super.DelayedInit(owner);
22
24 if (!character)
25 return;
26
27 m_CharacterController = character.GetCharacterController();
28 m_FactionAffiliation = FactionAffiliationComponent.Cast(owner.FindComponent(FactionAffiliationComponent));
29 }
30
31 //------------------------------------------------------------------------------------------------
33 {
34 //~ No space to load casualty
35 if (reasonInvalid == ESupportStationReasonInvalid.LOAD_CASUALTY_NO_SPACE)
36 return m_sInvalidNoSpace;
37
38 return super.GetInvalidPerformReasonString(reasonInvalid);
39 }
40
41 //------------------------------------------------------------------------------------------------
42 override bool CanBeShownScript(IEntity user)
43 {
44 if (!m_CharacterController || m_CharacterController.GetLifeState() != ECharacterLifeState.INCAPACITATED)
45 return false;
46
48 {
49 FactionAffiliationComponent userFactionAffiliation = FactionAffiliationComponent.Cast(user.FindComponent(FactionAffiliationComponent));
50 if (userFactionAffiliation)
51 {
52 //~ Do not show if character is an enemy
53 Faction ownerFaction = m_FactionAffiliation.GetAffiliatedFaction();
54 if (ownerFaction && ownerFaction.IsFactionEnemy(userFactionAffiliation.GetAffiliatedFaction()))
55 return false;
56 }
57 }
58
59 return super.CanBeShownScript(user);
60 }
61}
ESupportStationType
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
override LocalizedString GetInvalidPerformReasonString(ESupportStationReasonInvalid reasonInvalid)
ECharacterLifeState
SCR_FieldOfViewSettings Attribute