Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseRadialCommand.c
Go to the documentation of this file.
1[BaseContainerProps("", "Entry of one command"), SCR_BaseGroupCommandTitleField("m_sCommandName")]
3{
4 [Attribute("", UIWidgets.EditBox, "Unique name of the command")]
5 protected string m_sCommandName;
6
7 [Attribute("", UIWidgets.EditBox, "Display name of the command, in future will replace the one in commanding menu conf")]
8 protected string m_sCommandDisplayName;
9
10 [Attribute("{2EFEA2AF1F38E7F0}UI/Textures/Icons/icons_wrapperUI-64.imageset", UIWidgets.ResourceNamePicker, "Imageset source for display icon" )]
12
13 [Attribute("", UIWidgets.EditBox, "Name of the icon associated to the command, taken from appropriate imageset set in the radial menu" )]
14 protected string m_sIconName;
15
16 [Attribute(SCR_ECharacterRank.INVALID.ToString(), UIWidgets.ComboBox, desc: "Rank that is requried in order to use this command.\nINVALID == no requirement", enums: ParamEnumArray.FromEnum(SCR_ECharacterRank))]
17 protected SCR_ECharacterRank m_eRequiredRank;
18
21
22 protected static const LocalizedString CANNOT_PERFORM_RANK_TOO_LOW = "#AR-Commanding_CannotPefrorm_RankTooLow";
23 protected static const LocalizedString CANNOT_EXECUTE_SOLDIER_NA = "#AR-Commanding_CannotExecute_SoldierNotAvailable";
24
25 //------------------------------------------------------------------------------------------------
29 // Returns true if the command was executed succesfully, false otherwise.
30 bool Execute(IEntity cursorTarget, IEntity target, vector targetPosition, int playerID, bool isClient)
31 {
32 return true;
33 }
34
35 //------------------------------------------------------------------------------------------------
36 void VisualizeCommand(vector targetPosition);
37
38 //------------------------------------------------------------------------------------------------
39 void VisualizeCommandPreview(vector targetPosition);
40
41 //------------------------------------------------------------------------------------------------
43 string GetIconName()
44 {
45 return m_sIconName;
46 }
47
48 //------------------------------------------------------------------------------------------------
51 {
53 }
54
55 //------------------------------------------------------------------------------------------------
61
62 //------------------------------------------------------------------------------------------------
65 {
66 return m_sCommandName;
67 }
68
69 //------------------------------------------------------------------------------------------------
72 {
73 return true;
74 }
75
76 //------------------------------------------------------------------------------------------------
79 {
80 return true;
81 }
82
83 //------------------------------------------------------------------------------------------------
86 {
87 return true;
88 }
89
90 //------------------------------------------------------------------------------------------------
93 {
94 return true;
95 }
96
97 //------------------------------------------------------------------------------------------------
102 bool CanBePerformed(notnull SCR_ChimeraCharacter user)
103 {
104 if (m_eRequiredRank == SCR_ECharacterRank.INVALID)
105 return true;
106
107 if (!SCR_XPHandlerComponent.IsXpSystemEnabled())
108 return true;
109
110 SCR_ECharacterRank currentRank = SCR_CharacterRankComponent.GetCharacterRank(user);
111 if (currentRank < m_eRequiredRank)
112 {
113 SCR_Faction userFaction = SCR_Faction.Cast(user.GetFaction());
114 if (!userFaction)
115 return false;
116
117 SCR_RankContainer userRanks = userFaction.GetRanks();
118 string requiredRankName = userRanks.GetRankName(m_eRequiredRank);
119
120 if (requiredRankName == string.Empty) // If we dont define this rank in this faction, we will attempt to get the next one that would qualify.
121 requiredRankName = userRanks.GetRankName(userRanks.GetNextRank(m_eRequiredRank));
122
123 string currentRankName = userRanks.GetRankName(currentRank);
124 SetCannotPerformReason(WidgetManager.Translate(CANNOT_PERFORM_RANK_TOO_LOW, requiredRankName, currentRankName));
125 return false;
126 }
127
128 return true;
129 }
130
131 //------------------------------------------------------------------------------------------------
137 {
138 return true;
139 }
140
141 //------------------------------------------------------------------------------------------------
142 protected void SetCannotExecuteReason(LocalizedString newReason)
143 {
144 m_sCannotExecuteReason = newReason;
145 }
146
147 //------------------------------------------------------------------------------------------------
148 protected void SetCannotPerformReason(LocalizedString newReason)
149 {
150 m_sCannotPerformReason = newReason;
151 }
152
153 //------------------------------------------------------------------------------------------------
158
159 //------------------------------------------------------------------------------------------------
164}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
bool CanBeExecuted(IEntity target)
void SetCannotExecuteReason(LocalizedString newReason)
bool Execute(IEntity cursorTarget, IEntity target, vector targetPosition, int playerID, bool isClient)
void SetCannotPerformReason(LocalizedString newReason)
void VisualizeCommandPreview(vector targetPosition)
LocalizedString GetCannotExecuteReason()
static const LocalizedString CANNOT_PERFORM_RANK_TOO_LOW
static const LocalizedString CANNOT_EXECUTE_SOLDIER_NA
LocalizedString GetCannotPerformReason()
SCR_ECharacterRank m_eRequiredRank
LocalizedString m_sCannotPerformReason
LocalizedString m_sCannotExecuteReason
bool CanBePerformed(notnull SCR_ChimeraCharacter user)
void VisualizeCommand(vector targetPosition)
SCR_RankContainer GetRanks()
SCR_ECharacterRank GetNextRank(SCR_ECharacterRank rankID)
string GetRankName(SCR_ECharacterRank rankID)
SCR_FieldOfViewSettings Attribute