Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FindInContentBrowserContextAction.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Display config, only header is used, labels are filled by action")]
6
7 protected bool GetEntityLabels(SCR_EditableEntityComponent editableEntity, out array<EEditableEntityLabel> entityLabels)
8 {
9 if (editableEntity)
10 {
11 SCR_EditableEntityUIInfo editableUiInfo = SCR_EditableEntityUIInfo.Cast(editableEntity.GetInfo());
12 if (editableUiInfo)
13 {
14 editableUiInfo.GetEntityLabels(entityLabels);
15 return !entityLabels.IsEmpty();
16 }
17 }
18 return false;
19 }
20
21 override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
22 {
23 return hoveredEntity != null && selectedEntities.Contains(hoveredEntity) && !SCR_EditableFactionComponent.Cast(hoveredEntity);
24 }
25
26 override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
27 {
29 if (hoveredEntity && contentBrowserManager)
30 {
31 SCR_EditableEntityUIInfo uiInfo = SCR_EditableEntityUIInfo.Cast(hoveredEntity.GetInfo());
32
33 int itemIndex = contentBrowserManager.FindIndexOfInfo(uiInfo);
34 if (itemIndex == -1) return;
35
36 int pageIndex = Math.AbsInt(itemIndex / contentBrowserManager.GetPageEntryCount());
37
39 //resultState.SetPageIndex(pageIndex);
40
41 array<EEditableEntityLabel> prefabLabels = {};
42 uiInfo.GetEntityLabels(prefabLabels);
43
44 resultState.SetLabels(prefabLabels);
45 string localizedEntityName = WidgetManager.Translate(uiInfo.GetName());
46
47 //array<string> localizedWords = {};
48 //localizedEntityName.Split(" ", localizedWords, true);
49 //resultState.SetSearchString(string.Format("%1 %2", localizedWords[0] + localizedWords[1]));
50
51 resultState.SetSearchString(localizedEntityName);
52
53 contentBrowserManager.OpenBrowserState(resultState, m_ContentBrowserConfig);
54 }
55 }
56};
SCR_EAIThreatSectorFlags flags
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:13
int FindIndexOfInfo(SCR_EditableEntityUIInfo info)
bool OpenBrowserState(SCR_EditorContentBrowserSaveStateData saveState, SCR_EditorContentBrowserDisplayConfig displayConfig=null)
SCR_UIInfo GetInfo(IEntity owner=null)
int GetEntityLabels(out notnull array< EEditableEntityLabel > entityLabels)
override LocalizedString GetName()
void SetLabels(notnull array< EEditableEntityLabel > savedLabels, bool checkForInvalid=false)
override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
ref SCR_EditorContentBrowserDisplayConfig m_ContentBrowserConfig
bool GetEntityLabels(SCR_EditableEntityComponent editableEntity, out array< EEditableEntityLabel > entityLabels)
SCR_FieldOfViewSettings Attribute