11 protected string m_sToggleInfoAction;
13 [
Attribute(
"#AR-EditorToggle_LoadingText_Text")]
14 protected string m_sAuthorNameLoading;
16 [
Attribute(
"#AR-CoreMenus_Tooltips_Unavailable")]
17 protected string m_sAuthorNameFailed;
20 protected string m_sReportUserAction;
23 protected string m_sActionContext;
26 protected float m_fTraceDistance;
28 protected bool m_ReportingActive;
29 protected bool m_IsInit;
30 protected bool m_bNameUpdateRequested;
38 CameraBase camera =
GetGame().GetCameraManager().CurrentCamera();
40 camera.GetTransform(transform);
46 array<IEntity> exludedEntities = {};
50 exludedEntities.Insert(excEnt);
52 excEnt = SCR_PlayerController.Cast(excEnt).GetControlledEntity();
54 exludedEntities.Insert(excEnt);
56 trace.ExcludeArray = exludedEntities;
58 GetGame().GetWorld().TraceMove(trace, null);
60 IEntity traceEntity = trace.TraceEnt;
63 m_CurrentDetails = null;
67 traceEntity = SCR_EntityHelper.GetMainParent(traceEntity,
true);
69 SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(traceEntity.
FindComponent(SCR_EditableEntityComponent));
72 m_CurrentDetails = null;
78 line[1] =
position + (transform[3] * m_fTraceDistance);
79 Shape.CreateLines(Color.RED,
ShapeFlags.NOZBUFFER, line, 1);
81 SCR_EditableEntityAuthor author = editableEntity.
GetAuthor();
82 if (!author || author.m_sAuthorUID.IsEmpty())
84 m_CurrentDetails = null;
90 oldName = m_CurrentDetails.m_sAuthorName;
92 m_CurrentDetails =
new SCR_CompositionDetails(oldName, author.m_iAuthorID, author.m_sAuthorUID, author.m_ePlatform, editableEntity.
GetDisplayName(), editableEntity.
GetAuthorLastUpdated(), editableEntity.GetOwner().GetOrigin());
94 if (!m_bNameUpdateRequested && m_CurrentDetails.m_sAuthorName.IsEmpty())
96 Print(
"CompositionInfoHandler - Name Cache Update Requested!",
LogLevel.VERBOSE);
98 m_bNameUpdateRequested =
true;
99 m_CompositionInfoDisplay.UpdateName(m_sAuthorNameLoading);
102 PlayerManager.RequestPlayerNameCacheUpdate({author.m_sAuthorUID});
105 return m_CurrentDetails;
113 Print(
"CompositionInfoHandler - Name Cache Updated",
LogLevel.VERBOSE);
117 Print(
"CompositionInfoHandler - Name Cache Update failed!",
LogLevel.VERBOSE);
120 m_bNameUpdateRequested =
false;
123 if (!m_CurrentDetails)
128 if (!m_CurrentDetails.m_sAuthorUID.IsEmpty())
131 m_CurrentDetails.m_sAuthorName = pm.GetPlayerNameByIdentity(m_CurrentDetails.m_sAuthorUID);
135 m_CurrentDetails.m_sAuthorName = pm.GetPlayerName(m_CurrentDetails.m_iAuthorID);
138 if (m_CurrentDetails.m_sAuthorName.IsEmpty())
140 m_CurrentDetails.m_sAuthorName = m_sAuthorNameFailed;
143 m_CompositionInfoDisplay.UpdateName(m_CurrentDetails.m_sAuthorName);
179 PlayerController pc =
GetGame().GetPlayerController();
183 SocialComponent sc = SocialComponent.Cast(pc.FindComponent(SocialComponent));
187 if (!m_CurrentDetails.m_sAuthorName.IsEmpty() && !m_CurrentDetails.m_iAuthorID > -1)
189 sc.ReportPlayer(m_CurrentDetails.m_iAuthorID,
SCR_EReportReason.NEGATIVE_ATTITUDE);
190 PrintFormat(
"Player: %1, with UID: %2. Was Reported", m_CurrentDetails.m_sAuthorName, m_CurrentDetails.m_iAuthorID, level:
LogLevel.NORMAL);
191 m_CompositionInfoDisplay.ShowReported();
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)