Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CreationDateTooltipDetail.c
Go to the documentation of this file.
3{
4 [Attribute("RowHolder")]
5 protected string m_sRowHolderName;
6
7 [Attribute(defvalue: "0.5 0.5 0.5 1", desc: "Color of Text.")]
8 protected ref Color m_WidgetColor;
9
10 [Attribute("{DAD5433E63B93061}UI/Textures/MainMenu/Icons/EventNotification_64x_UI.edds")]
12
13 [Attribute("1", desc: "If true will show an icon and given text when it is the entities birthday/creation day")]
15
16 //------------------------------------------------------------------------------------------------
17 override bool CreateDetail(SCR_EditableEntityComponent entity, Widget parent, TextWidget label, bool setFrameslot = true)
18 {
19 if (label)
20 label.SetColor(m_WidgetColor);
21
22 return super.CreateDetail(entity, parent, label, setFrameslot);
23 }
24
25 //------------------------------------------------------------------------------------------------
26 override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
27 {
28 SCR_ExtendedIdentityComponent extendedIdentityComponent = SCR_ExtendedIdentityComponent.Cast(entity.GetOwner().FindComponent(SCR_ExtendedIdentityComponent));
29 if (!extendedIdentityComponent)
30 return false;
31
32 //~ Check if allowed to show bio
33 BaseContainer editorSettings = GetGame().GetGameUserSettings().GetModule("SCR_EditorSettings");
34 bool showBioTooltip = true;
35
36 if (editorSettings)
37 editorSettings.Get("m_bShowIdentityBioTooltip", showBioTooltip);
38
39 if (!showBioTooltip)
40 return false;
41
43 if (!rowTooltip)
44 {
45 Widget rowHolder = widget.FindAnyWidget(m_sRowHolderName);
46 if (rowHolder)
47 rowTooltip = SCR_RowTooltipEditorUIComponent.Cast(rowHolder.FindHandler(SCR_RowTooltipEditorUIComponent));
48
49 if (!rowTooltip)
50 return false;
51 }
52
54 if (!identityManager)
55 return false;
56
57 int currentRowIndex;
58
59 //~ Set date of birth/creation
60 string format, day, month, age, year;
61 if (identityManager.GetCreationdayString(extendedIdentityComponent, format, day, month, year, age))
62 {
63 //~ Is Birthday/Creation day
64 if (m_bShowWidgetOnCreationDay && identityManager.IsCreationDay(extendedIdentityComponent))
65 {
66 if (rowTooltip.AddIcon(currentRowIndex, m_sCreationDayIcon, m_WidgetColor))
67 currentRowIndex++;
68 }
69
70 if (rowTooltip.AddText(currentRowIndex, format, m_WidgetColor, day, month, year, age))
71 currentRowIndex++;
72 }
73
74 //~ Place of creation
75 SCR_ExtendedIdentity extendedIdentity = extendedIdentityComponent.GetExtendedIdentity();
76 if (extendedIdentity)
77 {
78 SCR_UIInfo uiInfo = extendedIdentity.GetPlaceOfOriginUIInfo();
79 if (uiInfo && uiInfo.GetName())
80 {
81 if (rowTooltip.AddText(currentRowIndex, uiInfo.GetName(), m_WidgetColor))
82 currentRowIndex++;
83 }
84 }
85
86 return currentRowIndex > 0;
87 }
88};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
override bool CreateDetail(SCR_EditableEntityComponent entity, Widget parent, TextWidget label, bool setFrameslot=true)
bool IsCreationDay(SCR_ExtendedIdentityComponent identityComponent)
bool GetCreationdayString(SCR_ExtendedIdentityComponent identityComponent, out string format, out string day, out string month, out string year, out string age)
static SCR_IdentityManagerComponent GetInstance()
bool AddIcon(int rowIndex, ResourceName icon, Color color=null, string setName=string.Empty)
bool AddText(int rowIndex, string text, Color color=null, string param1=string.Empty, string param2=string.Empty, string param3=string.Empty, string param4=string.Empty, string param5=string.Empty)
SCR_FieldOfViewSettings Attribute