8 [
Attribute(defvalue:
"1", uiwidget:
UIWidgets.ComboBox,
desc:
"Rank", enums: ParamEnumArray.FromEnum(SCR_ECharacterRank))]
9 protected SCR_ECharacterRank
m_iRank;
22 SCR_ECharacterRank oldRank =
m_iRank;
62 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(
m_Owner);
70 int playerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(character);
72 PlayerController playerController =
GetGame().GetPlayerManager().GetPlayerController(playerId);
73 if (!playerController)
77 if (!playerFactionAffiliation)
83 if (!factionManager.SetPlayerFaction(character, campaignFaction))
96 SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(component.GetPlayerId());
100 groupController.CreateAndJoinGroup(component.GetAffiliatedFaction(),
true);
124 protected void OnRankChanged(SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank,
bool silent)
126 s_OnRankChanged.Invoke(prevRank, newRank,
m_Owner, silent);
136 return SCR_ECharacterRank.INVALID;
141 return SCR_ECharacterRank.INVALID;
143 return comp.GetCharacterRank();
152 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(unit);
156 Faction faction = character.GetFaction();
168 static string GetRankName(
IEntity unit, SCR_ECharacterRank rank)
177 SCR_Faction faction = comp.GetCharacterFaction(unit);
187 static string GetCharacterRankName(
IEntity unit)
197 SCR_ECharacterRank rank = comp.GetCharacterRank();
198 SCR_Faction faction = comp.GetCharacterFaction(unit);
209 static string GetCharacterRankNameUpperCase(
IEntity unit)
219 SCR_ECharacterRank rank = comp.GetCharacterRank();
220 SCR_Faction faction = comp.GetCharacterFaction(unit);
231 static string GetCharacterRankNameShort(
IEntity unit)
241 SCR_ECharacterRank rank = comp.GetCharacterRank();
242 SCR_Faction faction = comp.GetCharacterFaction(unit);
253 static ResourceName GetCharacterRankInsignia(
IEntity unit)
263 SCR_ECharacterRank rank = comp.GetCharacterRank();
264 SCR_Faction faction = comp.GetCharacterFaction(unit);
281 writer.WriteIntRange(
m_iRank, 0, SCR_ECharacterRank.INVALID-1);
289 reader.ReadIntRange(
m_iRank, 0, SCR_ECharacterRank.INVALID-1);
298 Print(
"SCR_CharacterRankComponent must be attached to ChimeraCharacter!",
LogLevel.ERROR);
ArmaReforgerScripted GetGame()
override bool RplLoad(ScriptBitReader reader)
SCR_BaseGameMode GetGameMode()
override bool RplSave(ScriptBitWriter writer)
SCR_ECharacterRank m_iRank
SCR_Faction GetCharacterFaction(IEntity unit)
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SetCharacterRank(SCR_ECharacterRank rank, bool silent=false)
void FinishFactionSwitch(SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
Callback method for ensuring that completed faction switches are set up correctly.
void OnRankChanged(SCR_ECharacterRank prevRank, SCR_ECharacterRank newRank, bool silent)
SCR_ECharacterRank GetCharacterRank()
void RpcDoSetCharacterRank(SCR_ECharacterRank newRank, SCR_ECharacterRank prevRank, bool silent)
void SpecialRankHandling(SCR_ECharacterRank newRank, SCR_ECharacterRank prevRank)
Helper method for specific ranks with custom logic attached to them.
void AttemptSwitchFaction(SCR_CampaignFaction campaignFaction)
Helper method for attempting to switch factions.
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
bool IsRenegadePunishedExile()
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
enum EVehicleType IEntity
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
SCR_RankContainer GetRanks()
OnPlayerFactionResponseInvoker GetOnPlayerFactionResponseInvoker_S()
string GetRankNameShort(SCR_ECharacterRank rankID)
string GetRankNameUpperCase(SCR_ECharacterRank rankID)
string GetRankInsignia(SCR_ECharacterRank rankID)
string GetRankName(SCR_ECharacterRank rankID)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.