Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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")]
5  protected ref SCR_EditorContentBrowserDisplayConfig m_ContentBrowserConfig;
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_EditorContentBrowserDisplayConfig
Definition: SCR_EditorContentBrowserDisplayConfig.c:5
SCR_EditableEntityUIInfo
Definition: SCR_EditableEntityUIInfo.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_ContentBrowserEditorComponent
Definition: SCR_ContentBrowserEditorComponent.c:16
SCR_BaseContextAction
Definition: SCR_BaseContextAction.c:7
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_FindInContentBrowserContextAction
Definition: SCR_FindInContentBrowserContextAction.c:2
SCR_EditorContentBrowserSaveStateData
Definition: SCR_EditorContentBrowserStateData.c:5
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468