12 static ref ScriptInvoker s_OnRankChanged =
new ScriptInvoker();
19 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
50 s_OnRankChanged.Invoke(prevRank, newRank,
m_Owner, silent);
67 return comp.GetCharacterRank();
76 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(unit);
80 Faction faction = character.GetFaction();
90 static string GetCharacterRankName(IEntity unit)
101 SCR_Faction faction = comp.GetCharacterFaction(unit);
106 return faction.GetRankName(rank);
112 static string GetCharacterRankNameUpperCase(IEntity unit)
123 SCR_Faction faction = comp.GetCharacterFaction(unit);
128 return faction.GetRankNameUpperCase(rank);
134 static string GetCharacterRankNameShort(IEntity unit)
145 SCR_Faction faction = comp.GetCharacterFaction(unit);
150 return faction.GetRankNameShort(rank);
156 static ResourceName GetCharacterRankInsignia(IEntity unit)
167 SCR_Faction faction = comp.GetCharacterFaction(unit);
172 return faction.GetRankInsignia(rank);
200 if (!ChimeraCharacter.Cast(owner))
201 Print(
"SCR_CharacterRankComponent must be attached to ChimeraCharacter!", LogLevel.ERROR);
221 [
Attribute(defvalue:
"", uiwidget: UIWidgets.EditBox,
desc:
"Rank name")]
222 protected string m_sRankName;
224 [
Attribute(defvalue:
"", uiwidget: UIWidgets.EditBox,
desc:
"Rank name (upper case)")]
225 protected string m_sRankNameUpper;
227 [
Attribute(defvalue:
"", uiwidget: UIWidgets.EditBox,
desc:
"Rank name (short)")]
228 protected string m_sRankNameShort;
230 [
Attribute(
"",
"Rank insignia quad name in MilitaryIcons.imageset")]
231 protected string m_sInsignia;
249 string GetRankNameUpperCase()
256 string GetRankNameShort()
263 string GetRankInsignia()
275 [
Attribute(
"0", UIWidgets.CheckBox,
"Renegade",
"Is this rank considered hostile by friendlies?")]
276 protected bool m_bIsRenegade;
278 [
Attribute(
"100", UIWidgets.EditBox,
"XP required to get promoted to this rank.")]
279 protected int m_iRequiredXP;
293 return m_bIsRenegade;
300 return m_iRequiredXP;