Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CommentEditableEntityUIComponent.c
Go to the documentation of this file.
2{
3 protected static const string WIDGET_TEXT = "Text"; //--- ToDo: Don't hardcode
4 protected static const string WIDGET_ICON = "Icon"; //--- ToDo: Don't hardcode
5 protected static const string WIDGET_EXTENDED_ICON = "Icon_ExtendablePrefabs";
7
9
10 //------------------------------------------------------------------------------------------------
12 {
13 Widget widget = GetWidget();
14 if (!widget)
15 return;
16
17 GenericEntity owner = entity.GetOwner();
18 if (!owner)
19 return;
20
21 SCR_EditableCommentComponent comment = SCR_EditableCommentComponent.Cast(entity);
22 if (!comment)
23 return;
24
25 TextWidget textWidget = TextWidget.Cast(widget.FindAnyWidget(WIDGET_TEXT));
26 if (textWidget)
27 comment.ApplyTo(textWidget);
28
29 ImageWidget iconWidget = ImageWidget.Cast(widget.FindAnyWidget(WIDGET_ICON));
30 if (iconWidget)
31 comment.ApplyTo(iconWidget);
32
35 return;
36
38 if (!m_wExtendedIcon)
39 return;
40
41 SCR_CompositionSlotManagerComponent slotManager = SCR_CompositionSlotManagerComponent.GetInstance();
42 if (slotManager)
43 slotManager.GetOnEntityChanged().Insert(OnEntityChanged);
44
45 if (slotManager)
46 m_wExtendedIcon.SetVisible(!slotManager.IsOccupied(owner) && m_ContentBrowserComponent.IsExtendedEntity(entity));
47 else
48 m_wExtendedIcon.SetVisible(false);
49 }
50
51 //------------------------------------------------------------------------------------------------
54 void OnEntityChanged(SCR_CompositionSlotManagerComponent slotManager, IEntity slot)
55 {
57 return;
58
60 m_wExtendedIcon.SetVisible(!slotManager.IsOccupied(slot) && m_ContentBrowserComponent.IsExtendedEntity(m_Entity));
61 }
62}
override GenericEntity GetOwnerScripted()
Widget GetWidget()
static Managed GetInstance(typename type, bool showError=false, bool modeFirst=false)
override void OnInit(SCR_EditableEntityComponent entity, SCR_UIInfo info, SCR_EditableEntityBaseSlotUIComponent slot)
SCR_ContentBrowserEditorComponent m_ContentBrowserComponent
void OnEntityChanged(SCR_CompositionSlotManagerComponent slotManager, IEntity slot)
IEntity GetEntity()