Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TaskTextBaseEditorAttribute.c
Go to the documentation of this file.
3 {
4  [Attribute(SCR_Enum.GetDefault(ETaskTextType.NONE), UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ETaskTextType))]
5  protected ETaskTextType m_TextType;
6 
7  [Attribute("#AR-Editor_Attribute_CustomTaskName_LocationPlaceholder", desc: "Param used in the SCR_DropdownWithParamAttributeUIComponent to indicate for the player what will be replaced with the location name", uiwidget: UIWidgets.LocaleEditBox)]
8  protected LocalizedString m_sLocationPlaceholderText;
9 
10  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
11  {
13  if (task && IsValidTaskType(task.GetTextType()))
14  return SCR_BaseEditorAttributeVar.CreateInt(task.GetTextIndex());
15  else
16  return null;
17  }
18  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
19  {
20  if (!var)
21  return;
22 
24  task.SetTextIndex(var.GetInt());
25  }
26  override int GetEntries(notnull array<ref SCR_BaseEditorAttributeEntry> outEntries)
27  {
28  //~ First entry is always the param used in the UI
29  outEntries.Insert(new SCR_BaseEditorAttributeEntryText(m_sLocationPlaceholderText));
30 
31  SCR_TextsTaskManagerComponent textsComponent = SCR_TextsTaskManagerComponent.GetInstance();
32  if (!textsComponent)
33  return 0;
34 
35  array<ref SCR_UIDescription> infos = {};
36  int count = textsComponent.GetTexts(m_TextType, infos);
37  string text;
38  for (int i; i < count; i++)
39  outEntries.Insert( new SCR_BaseEditorAttributeEntryText(infos[i].GetName()));
40 
41  return outEntries.Count();
42  }
43 
44  protected bool IsValidTaskType(ETaskTextType taskType)
45  {
46  return taskType == m_TextType;
47  }
48 };
SCR_Enum
Definition: SCR_Enum.c:1
GetName
string GetName()
Definition: SCR_ScenarioFrameworkLayerBase.c:85
SCR_TaskTextBaseEditorAttribute
Definition: SCR_TaskTextBaseEditorAttribute.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
BaseContainerCustomTitleField
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition: SCR_KeyBindingMenuConfig.c:113
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
SCR_BaseEditorAttributeEntryText
void SCR_BaseEditorAttributeEntryText(string text)
Definition: SCR_BaseEditorAttribute.c:486
SCR_EditableTaskComponent
void SCR_EditableTaskComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_EditableTaskComponent.c:223
LocalizedString
Definition: LocalizedString.c:21
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