Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SCR_AttributesManagerEditorComponent Interface Reference

Manager ofeditor attributes. More...

Inheritance diagram for SCR_AttributesManagerEditorComponent:
[legend]

Public Member Functions

void StartEditing (Managed item)
 Start attributes editing of single item.
 
void StartEditing (notnull array< Managed > items, bool onlyServer=true)
 Start attributes editing of multiple items.
 
void ConfirmEditing ()
 Confirm changes made during editing.
 
void CancelEditing ()
 Cancel changes made during editing.
 
void Reset (bool telegraphChange)
 Reset values of currently edited attributes to the state they had when the editing started.
 
bool CanOpenAttributeDialog (notnull array< Managed > items)
 
bool SetAttributeVariable (TypeName type, SCR_BaseEditorAttributeVar var)
 Sets the value of an attribute in the atribute window This is called seperetly from the UI and is for attributes to influence other attributes.
 
bool GetAttributeVariable (TypeName type, out SCR_BaseEditorAttributeVar var)
 Gets the value of an attribute in the atribute window.
 
int GetActiveAttributesOfType (TypeName type, notnull out array< SCR_BaseEditorAttribute > attributes, bool includedInherit=true, SCR_BaseEditorAttribute ignoreAttribute=null)
 Get list of all attributes of given type (or inherits from type)
 
bool GetActiveAttribute (TypeName type, out SCR_BaseEditorAttribute attribute)
 Gets the attribute in the atribute window.
 
bool SetAttributeEnabled (TypeName type, bool enabled)
 Called to send out an event that the attribute is enabled or disabled.
 
bool SetAttributeSelected (TypeName type, bool selected, int index=-1)
 Called to send out an event that the attribute should be selected.
 
bool SetAttributeAsSubAttribute (TypeName type)
 Called to send out an event that makes sure the given attribute knows it is a sub attribute for another attribute which sets so visual differences.
 
SCR_BaseEditorAttribute GetAttributeRef (TypeName type)
 
int GetEditedAttributes (out notnull array< SCR_BaseEditorAttribute > outAttributes)
 Get currently edited attributes.
 
int GetEditedItems (out notnull array< Managed > outitems)
 Get currently edited items.
 
ScriptInvoker GetOnAttributesRequest ()
 Get event called when request for editing attributes is sent to server.
 
ScriptInvoker GetOnAttributesStart ()
 Get event called when editing attributes is confirmed by server.
 
ScriptInvoker GetOnAttributesConfirm ()
 Get event called when editing attributes is confirmed.
 
ScriptInvoker GetOnAttributesCancel ()
 Get event called when editing attributes is canceled.
 
ScriptInvoker GetOnResetAttributes ()
 Get event called when attributes are reset.
 
ScriptInvoker GetOnAttributeChangesApplied ()
 Get event called when attribute changes are applied.
 
ScriptInvoker GetOnAttributeDescriptionChanged ()
 Get event called when attribute description changes and should be displayed in the attribute UI dailog.
 
ScriptInvoker GetOnAttributeCategoryChanged ()
 Get script invoker that is called everytime category is changed.
 
SCR_EditorAttributeUIInfo GetConflictingAttributeUIInfo ()
 Info displayed when attribute is locked if it is a conflicting attribute.
 
void SetCurrentCategory (ResourceName category)
 Set current category config.
 
ResourceName GetCurrentCategory ()
 
bool GetChangedAttributesOnce ()
 Get if user has changed attributes once.
 
void SetAttributeDescription (SCR_EditorAttributeUIInfo uiInfo, string customDescription=string.Empty, string param1=string.Empty, string param2=string.Empty, string param3=string.Empty)
 Calls an event to set the attribute Description displayed in the Attributes dialog.
 
override void EOnEditorActivate ()
 When the component is activated.
 
override void EOnEditorDeactivate ()
 When the component is deactivated.
 
override void EOnEditorInit ()
 When the entity is created.
 
override void EOnEditorInitServer ()
 When the entity is created (called on server)
 
- Public Member Functions inherited from SCR_BaseEditorComponent
sealed void OnInitBase ()
 
sealed void OnDeleteBase ()
 
sealed void OnRequestBase (bool isOpen)
 
sealed void OnOpenedBase ()
 
sealed void OnClosedBase ()
 
sealed void OnPreActivateBase ()
 
sealed void OnActivateBase ()
 
sealed bool OnActivateAsyncBase (int attempt)
 
sealed void OnPostActivateBase ()
 
sealed void OnDeactivateBase ()
 
sealed void OnPostDeactivateBase ()
 
sealed bool OnDeactivateAsyncBase (int attempt)
 
sealed void OnEffectBase (SCR_BaseEditorEffect effect)
 
SCR_EditorManagerEntity GetManager ()
 Get editor manager this component belongs to.
 
SCR_BaseEditorComponent FindEditorComponent (TypeName type, bool showError=false, bool modeFirst=false)
 Get the editor manager to which this component belongs.
 
EntityComponentPrefabData GetEditorComponentData ()
 Get prefab data of this component.
 
bool IsRemoved ()
 Check if the component is being deleted.
 
void ResetEditorComponent ()
 Reset values controlled by the component.
 
ScriptInvoker GetOnEffect ()
 Get event called when an effect is activated.
 
void InitServer ()
 
void InitOwner ()
 
override void OnPostInit (IEntity owner)
 
void SCR_BaseEditorComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
void ~SCR_BaseEditorComponent ()
 

Static Public Attributes

const int SNAPSHOT_SIZE = 96
 

Protected Member Functions

void StartEditingServer (array< int > itemIds)
 
void StartEditingOwner (notnull array< int > attributesIds, notnull array< ref SCR_BaseEditorAttributeVar > attributesVars, notnull array< ref EEditorAttributeMultiSelect > attributesMultiSelect)
 
bool GetIsAttributeDuplicate (TypeName type)
 
void ConfirmEditingServer (notnull array< int > attributesIds, notnull array< ref SCR_BaseEditorAttributeVar > attributesVars, int PlayerID)
 
void CancelEditingServer ()
 
void Clean ()
 
int GetVariables (bool onlyServer, notnull array< Managed > items, notnull out array< int > outIds, notnull out array< ref SCR_BaseEditorAttributeVar > outVars, notnull out array< ref EEditorAttributeMultiSelect > outAttributesMultiSelect)
 
- Protected Member Functions inherited from SCR_BaseEditorComponent
bool IsOnEditorManager ()
 
bool IsOwner ()
 
bool IsProxy ()
 
bool IsMaster ()
 
bool IsAdmin ()
 
SCR_BaseEditorComponent GetParentComponent ()
 
void SetParentComponent (SCR_BaseEditorComponent parent)
 
void SendNotification (ENotification notificationID, int selfID=0, int targetID=0, vector position=vector.Zero)
 
void EOnEditorDelete ()
 When the entity is destroyed.
 
void EOnEditorRequest (bool isOpen)
 When opening/closing request is sent to server.
 
void EOnEditorOpen ()
 When the editor is opened.
 
void EOnEditorClose ()
 When the editor is closed.
 
void EOnEditorPreActivate ()
 Before the component is activated.
 
bool EOnEditorActivateAsync (int attempt)
 When the component is activated.
 
void EOnEditorPostActivate ()
 When the component is activated, but after EOnEditorActivate() function was called in all components.
 
bool EOnEditorDeactivateAsync (int attempt)
 When the component is deactivated.
 
void EOnEditorPostDeactivate ()
 When the component is deactivated, but after the next mode is activated.
 
void EOnEditorDebug (array< string > debugTexts)
 Every frame while the editor is opened and debug menu is shown.
 
void EOnEffect (SCR_BaseEditorEffect effect)
 When an effect is created in reaction an an event.
 
void EOnEditorDeleteServer ()
 When the entity is destroyed (called on server)
 
void EOnEditorOpenServer ()
 When the editor is opened (called on server)
 
void EOnEditorOpenServerCallback ()
 When the editor is opened (called on server after async loading finished on client)
 
void EOnEditorCloseServer ()
 When the editor is closed (called on server)
 
void EOnEditorCloseServerCallback ()
 When the editor is closed (called on server after async loading finished on client)
 
void EOnEditorActivateServer ()
 When the component is activated (called on server)
 
void EOnEditorDeactivateServer ()
 When the component is deactivated (called on server)
 

Protected Attributes

ref SCR_EditorAttributeUIInfo m_ConflictingAttributeUIInfo
 
bool m_bHasChangedAttributesOnce = false
 
ResourceName m_CurrentCategory
 
- Protected Attributes inherited from SCR_BaseEditorComponent
SCR_EditorBaseEntity m_Owner
 
SCR_EditorManagerEntity m_Manager
 
SCR_BaseEditorComponent m_Parent
 
RplComponent m_RplComponent
 

Additional Inherited Members

- Static Public Member Functions inherited from SCR_BaseEditorComponent
static Managed GetInstance (TypeName type, bool showError=false, bool modeFirst=false)
 Get the local instance of a component attached on editor manager (SCR_EditorManagerEntity).
 
static Managed GetInstance (SCR_EditorBaseEntity editorManager, TypeName type, bool showError=false)
 Get instance of a component attached on specific editor manager / mode (SCR_EditorBaseEntity).
 
static int GetAllInstances (TypeName type, out notnull array< Managed > outComponents)
 Get component instances on editor manager (SCR_EditorBaseEntity) and all its modes (SCR_EditorModeEntity).
 

Detailed Description

Manager ofeditor attributes.

All available attributes (SCR_BaseEditorAttribute and inherited classes) are defined here, each attribute (added in the EditorMode prefab) must be an unique class inherited from SCR_BaseEditorAttribute!

To edit attributes, follow these steps:

  1. Call StartEditing() to create snapshots of all attributes and open them for editing
  2. Call ConfirmEditing() to confirm changes or CancelEditing() to do nothing

Member Function Documentation

◆ CancelEditing()

void SCR_AttributesManagerEditorComponent.CancelEditing ( )

Cancel changes made during editing.

Must be called on editor owner.

◆ CancelEditingServer()

void SCR_AttributesManagerEditorComponent.CancelEditingServer ( )
protected

◆ CanOpenAttributeDialog()

bool SCR_AttributesManagerEditorComponent.CanOpenAttributeDialog ( notnull array< Managed >  items)
Parameters
[in]items
Returns

◆ Clean()

void SCR_AttributesManagerEditorComponent.Clean ( )
protected

◆ ConfirmEditing()

void SCR_AttributesManagerEditorComponent.ConfirmEditing ( )

Confirm changes made during editing.

Must be called on editor owner.

◆ ConfirmEditingServer()

void SCR_AttributesManagerEditorComponent.ConfirmEditingServer ( notnull array< int >  attributesIds,
notnull array< ref SCR_BaseEditorAttributeVar attributesVars,
int  PlayerID 
)
protected

◆ EOnEditorActivate()

override void SCR_AttributesManagerEditorComponent.EOnEditorActivate ( )

When the component is activated.

Implements SCR_BaseEditorComponent.

◆ EOnEditorDeactivate()

override void SCR_AttributesManagerEditorComponent.EOnEditorDeactivate ( )

When the component is deactivated.

Implements SCR_BaseEditorComponent.

◆ EOnEditorInit()

override void SCR_AttributesManagerEditorComponent.EOnEditorInit ( )

When the entity is created.

Implements SCR_BaseEditorComponent.

◆ EOnEditorInitServer()

override void SCR_AttributesManagerEditorComponent.EOnEditorInitServer ( )

When the entity is created (called on server)

Implements SCR_BaseEditorComponent.

◆ GetActiveAttribute()

bool SCR_AttributesManagerEditorComponent.GetActiveAttribute ( TypeName  type,
out SCR_BaseEditorAttribute  attribute 
)

Gets the attribute in the atribute window.

Parameters
[in]typeClass of attribute
[out]attributeattribute to get
Returns
if the class is succesfully found

◆ GetActiveAttributesOfType()

int SCR_AttributesManagerEditorComponent.GetActiveAttributesOfType ( TypeName  type,
notnull out array< SCR_BaseEditorAttribute attributes,
bool  includedInherit = true,
SCR_BaseEditorAttribute  ignoreAttribute = null 
)

Get list of all attributes of given type (or inherits from type)

Parameters
[in]typeClass of attribute
[out]attributeslist of attributes of type
[in]includedInheritIf true will also get inherent classes else will only get the attributes of given type
[in]ignoreAttributeAdd if a given attribute should be ignored
Returns
Count of the found attributes

◆ GetAttributeRef()

SCR_BaseEditorAttribute SCR_AttributesManagerEditorComponent.GetAttributeRef ( TypeName  type)
Parameters
[in]type
Returns

◆ GetAttributeVariable()

bool SCR_AttributesManagerEditorComponent.GetAttributeVariable ( TypeName  type,
out SCR_BaseEditorAttributeVar  var 
)

Gets the value of an attribute in the atribute window.

Parameters
[in]typeClass of attribute to set value
[out]varValue to get
Returns
bool if the class is succesfully found

◆ GetChangedAttributesOnce()

bool SCR_AttributesManagerEditorComponent.GetChangedAttributesOnce ( )

Get if user has changed attributes once.

Returns
m_bHasChangedAttributesOnce

◆ GetConflictingAttributeUIInfo()

SCR_EditorAttributeUIInfo SCR_AttributesManagerEditorComponent.GetConflictingAttributeUIInfo ( )

Info displayed when attribute is locked if it is a conflicting attribute.

Returns
The conflicting attribute UI info

◆ GetCurrentCategory()

ResourceName SCR_AttributesManagerEditorComponent.GetCurrentCategory ( )
Returns
Get current category config.

◆ GetEditedAttributes()

int SCR_AttributesManagerEditorComponent.GetEditedAttributes ( out notnull array< SCR_BaseEditorAttribute outAttributes)

Get currently edited attributes.

Parameters
[in]outAttributesArray to be filled with attributes
Returns
Number of attributes

◆ GetEditedItems()

int SCR_AttributesManagerEditorComponent.GetEditedItems ( out notnull array< Managed >  outitems)

Get currently edited items.

Parameters
[in]outAttributesArray to be filled with items
Returns
Number of items

◆ GetIsAttributeDuplicate()

bool SCR_AttributesManagerEditorComponent.GetIsAttributeDuplicate ( TypeName  type)
protected

◆ GetOnAttributeCategoryChanged()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributeCategoryChanged ( )

Get script invoker that is called everytime category is changed.

Returns
Script invoker OnAttributeCategoryChanged

◆ GetOnAttributeChangesApplied()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributeChangesApplied ( )

Get event called when attribute changes are applied.

Returns
Script invoker

◆ GetOnAttributeDescriptionChanged()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributeDescriptionChanged ( )

Get event called when attribute description changes and should be displayed in the attribute UI dailog.

Returns
Script invoker Event_OnAttributeDescriptionChanged

◆ GetOnAttributesCancel()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributesCancel ( )

Get event called when editing attributes is canceled.

Called only for editor user.

Returns
Script invoker

◆ GetOnAttributesConfirm()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributesConfirm ( )

Get event called when editing attributes is confirmed.

Called only for editor user.

Returns
Script invoker

◆ GetOnAttributesRequest()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributesRequest ( )

Get event called when request for editing attributes is sent to server.

Called only for editor user.

Returns
Script invoker

◆ GetOnAttributesStart()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnAttributesStart ( )

Get event called when editing attributes is confirmed by server.

Called only for editor user.

Returns
Script invoker

◆ GetOnResetAttributes()

ScriptInvoker SCR_AttributesManagerEditorComponent.GetOnResetAttributes ( )

Get event called when attributes are reset.

Returns
Script invoker

◆ GetVariables()

int SCR_AttributesManagerEditorComponent.GetVariables ( bool  onlyServer,
notnull array< Managed >  items,
notnull out array< int >  outIds,
notnull out array< ref SCR_BaseEditorAttributeVar outVars,
notnull out array< ref EEditorAttributeMultiSelect >  outAttributesMultiSelect 
)
protected

◆ Reset()

void SCR_AttributesManagerEditorComponent.Reset ( bool  telegraphChange)

Reset values of currently edited attributes to the state they had when the editing started.

Must be called on editor owner.

Parameters
[in]telegraphChangeTrue to update GUI when attribute value is changed

◆ SetAttributeAsSubAttribute()

bool SCR_AttributesManagerEditorComponent.SetAttributeAsSubAttribute ( TypeName  type)

Called to send out an event that makes sure the given attribute knows it is a sub attribute for another attribute which sets so visual differences.

Parameters
[in]typeclass of attribute
Returns
if the class is succesfully found

◆ SetAttributeDescription()

void SCR_AttributesManagerEditorComponent.SetAttributeDescription ( SCR_EditorAttributeUIInfo  uiInfo,
string  customDescription = string::Empty,
string  param1 = string::Empty,
string  param2 = string::Empty,
string  param3 = string::Empty 
)

Calls an event to set the attribute Description displayed in the Attributes dialog.

Parameters
[in]uiInfo
[in]customDescription
[in]param1param in text
[in]param2param in text
[in]param3param in text

◆ SetAttributeEnabled()

bool SCR_AttributesManagerEditorComponent.SetAttributeEnabled ( TypeName  type,
bool  enabled 
)

Called to send out an event that the attribute is enabled or disabled.

Parameters
[in]typeClass of attribute to set value
[in]enabledenable value to set
Returns
if the class is succesfully found

◆ SetAttributeSelected()

bool SCR_AttributesManagerEditorComponent.SetAttributeSelected ( TypeName  type,
bool  selected,
int  index = -1 
)

Called to send out an event that the attribute should be selected.

Think of a slider being used which is also set by presets

Parameters
[in]typeclass of attribute to set value
[in]selectedvalue to set
[in]indexoptionally an index of a element that needs to be set selected
Returns
if the class is succesfully found

◆ SetAttributeVariable()

bool SCR_AttributesManagerEditorComponent.SetAttributeVariable ( TypeName  type,
SCR_BaseEditorAttributeVar  var 
)

Sets the value of an attribute in the atribute window This is called seperetly from the UI and is for attributes to influence other attributes.

Parameters
[in]typeClass of attribute to set value
[in]varvalue to set
Returns
bool if the class is succesfully found

◆ SetCurrentCategory()

void SCR_AttributesManagerEditorComponent.SetCurrentCategory ( ResourceName  category)

Set current category config.

Parameters
[in]categoryCategory config

◆ StartEditing() [1/2]

void SCR_AttributesManagerEditorComponent.StartEditing ( Managed  item)

Start attributes editing of single item.

Must be called on editor owner.

Parameters
[in]item
Returns
item Edited MapItem

◆ StartEditing() [2/2]

void SCR_AttributesManagerEditorComponent.StartEditing ( notnull array< Managed >  items,
bool  onlyServer = true 
)

Start attributes editing of multiple items.

Must be called on editor owner.

  • Server attributes will be sent to server, which will fill them with values and send them back.
  • Once back, Event_OnAttributesStart is invoked.
  • If all attributes are local, no server verification is performed.
    Parameters
    [in]items
    [in]onlyServer
    Returns
    item Edited items (must be explicitly array<Managed>, not another type! Even when the array element itself inherits from Managed)

◆ StartEditingOwner()

void SCR_AttributesManagerEditorComponent.StartEditingOwner ( notnull array< int >  attributesIds,
notnull array< ref SCR_BaseEditorAttributeVar attributesVars,
notnull array< ref EEditorAttributeMultiSelect >  attributesMultiSelect 
)
protected

◆ StartEditingServer()

void SCR_AttributesManagerEditorComponent.StartEditingServer ( array< int >  itemIds)
protected

Member Data Documentation

◆ m_bHasChangedAttributesOnce

bool SCR_AttributesManagerEditorComponent.m_bHasChangedAttributesOnce = false
protected

◆ m_ConflictingAttributeUIInfo

ref SCR_EditorAttributeUIInfo SCR_AttributesManagerEditorComponent.m_ConflictingAttributeUIInfo
protected

◆ m_CurrentCategory

ResourceName SCR_AttributesManagerEditorComponent.m_CurrentCategory
protected

◆ SNAPSHOT_SIZE

const int SCR_AttributesManagerEditorComponent.SNAPSHOT_SIZE = 96
static

The documentation for this interface was generated from the following file: