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

Public Member Functions

void CreateEditablePrefab (WorldEditorAPI api, ResourceName prefab, bool onlyUpdate=false, map< string, SCR_EEditablePrefabResult > results=null)
 Create or update editable entity prefab.
 
void UpdateEditablePrefab (WorldEditorAPI api, ResourceName prefab)
 
string VerifyEditablePrefab (WorldEditorAPI api, ResourceName prefab, bool onlyFileChanges=false)
 
bool MoveFile (string prevPath, string newPath)
 Move a file and its meta file from one path to another.
 
void LogResults (notnull map< string, SCR_EEditablePrefabResult > results)
 Print auto-configuration results to log.
 
string GetSourcePath ()
 Get source path.
 
string GetTargetPath ()
 Get raw target path.
 
string GetTargetPathAuto ()
 Get path of auto folder in target path.
 
string GetPrefix ()
 Get prefix added to editable entity prefabs.
 
bool IsValid ()
 Check if the config is configured correctly.
 
bool CreateDirectoryFor (out string filePath, string addon="")
 Create a directory for editable entity prefab on given path.
 
bool CreateWorld ()
 Create empty world which can be safely edited.
 
void GetLinks (bool forced=false)
 Initialise links to and from editable prefabs.
 
bool GetLinkFromSource (string guid, out ResourceName linkedPrefab=ResourceName.Empty)
 Get a link from a prefab to its editable prefab.
 
bool GetLinkFromTarget (string guid, out ResourceName linkedPrefab=ResourceName.Empty)
 Get a link from editable prefab to its source prefab.
 
bool IsEditableEntity (ResourceName prefab)
 Check if the prefab is an editable entity.
 
ResourceName GetSourcePrefab (ResourceName prefab)
 Get source prefab of editable entity prefab.
 
void EditablePrefabsConfig ()
 

Static Public Member Functions

static EditablePrefabsConfig GetConfig (ResourceName configPath)
 Get config from a prefab.
 

Protected Member Functions

ResourceName MoveEditablePrefab (WorldEditorAPI api, string prevPath, string newPath)
 Move existing editable prefab to a new path (includes also renaming the prefab)
 
void DeleteEditablePrefab (WorldEditorAPI api, string prefabPath)
 Delete existing editable prefab.
 
bool UpdateChildPrefabs (WorldEditorAPI api, IEntitySource entitySource, array< ref SCR_EditorLinkEntry > links, bool forceDisable=false, map< string, SCR_EEditablePrefabResult > results=null, int depth=0)
 
void DisableComponent (WorldEditorAPI api, IEntitySource entitySource, BaseContainer componentSource, array< ref ContainerIdPathEntry > componentsPath)
 
void BackupFile (string filePath, out notnull array< string > backup)
 
void CompareBackup (string filePath, notnull array< string > backup)
 
ResourceName GetResourceNameLink (BaseContainer container)
 
EditablePrefabsSetting GetSettings (string prefabPath)
 
bool IsBlacklisted (string path)
 

Protected Attributes

ResourceName m_SourceDirectory
 
ResourceName m_TargetDirectory
 
string m_sAutoFolderName
 
string m_sFileNamePrefix
 
string m_sSourceBlacklist
 
ref array< ResourceName > m_SupportEntities
 
ref array< ref EditablePrefabsSettingm_Settings
 
bool m_bIsValid
 
string m_sSourcePath
 
string m_sTargetPath
 
string m_sTargetPathAuto
 
ref map< string, string > m_mLinksFromTarget
 
ref map< string, string > m_mLinksFromSource
 
ref array< string > m_aSourceBlacklist = {}
 
string m_sCurrentAddon = "$ArmaReforger:"
 

Static Protected Attributes

static const string ADDON_PREFIX = "$profile:"
 
static const string WORLD_PATH = "worlds/Plugins/EditablePrefabsConfig"
 
static const string WORLD_NAME = "EditablePrefabsWorld"
 
static const string META_EXTENSION = ".meta"
 
static const string COPY_EXTENSION = "_copy"
 

Constructor & Destructor Documentation

◆ EditablePrefabsConfig()

void EditablePrefabsConfig.EditablePrefabsConfig ( )

Member Function Documentation

◆ BackupFile()

void EditablePrefabsConfig.BackupFile ( string  filePath,
out notnull array< string >  backup 
)
protected

◆ CompareBackup()

void EditablePrefabsConfig.CompareBackup ( string  filePath,
notnull array< string >  backup 
)
protected

◆ CreateDirectoryFor()

bool EditablePrefabsConfig.CreateDirectoryFor ( out string  filePath,
string  addon = "" 
)

Create a directory for editable entity prefab on given path.

Parameters
[in]filePathprefab path
[in]addon
Returns
true if created

◆ CreateEditablePrefab()

void EditablePrefabsConfig.CreateEditablePrefab ( WorldEditorAPI  api,
ResourceName  prefab,
bool  onlyUpdate = false,
map< string, SCR_EEditablePrefabResult >  results = null 
)

Create or update editable entity prefab.

Parameters
[in]apiWorld Editor API
[in]prefabSource prefab

— Not in 'Auto' folder

◆ CreateWorld()

bool EditablePrefabsConfig.CreateWorld ( )

Create empty world which can be safely edited.

Returns

◆ DeleteEditablePrefab()

void EditablePrefabsConfig.DeleteEditablePrefab ( WorldEditorAPI  api,
string  prefabPath 
)
protected

Delete existing editable prefab.

◆ DisableComponent()

void EditablePrefabsConfig.DisableComponent ( WorldEditorAPI  api,
IEntitySource  entitySource,
BaseContainer  componentSource,
array< ref ContainerIdPathEntry >  componentsPath 
)
protected

◆ GetConfig()

static EditablePrefabsConfig EditablePrefabsConfig.GetConfig ( ResourceName  configPath)
static

Get config from a prefab.

Parameters
[in]configPathprefab
Returns
config

◆ GetLinkFromSource()

bool EditablePrefabsConfig.GetLinkFromSource ( string  guid,
out ResourceName  linkedPrefab = ResourceName::Empty 
)

Get a link from a prefab to its editable prefab.

Parameters
[in]guidprefab GUID
[out]linkedPrefabfound prefab
Returns
true if found

◆ GetLinkFromTarget()

bool EditablePrefabsConfig.GetLinkFromTarget ( string  guid,
out ResourceName  linkedPrefab = ResourceName::Empty 
)

Get a link from editable prefab to its source prefab.

Parameters
[in]guidprefab GUID
[out]linkedPrefabfound prefab
Returns
true if found

◆ GetLinks()

void EditablePrefabsConfig.GetLinks ( bool  forced = false)

Initialise links to and from editable prefabs.

Parameters
[in]forced

◆ GetPrefix()

string EditablePrefabsConfig.GetPrefix ( )

Get prefix added to editable entity prefabs.

Returns
prefix

◆ GetResourceNameLink()

ResourceName EditablePrefabsConfig.GetResourceNameLink ( BaseContainer  container)
protected

◆ GetSettings()

EditablePrefabsSetting EditablePrefabsConfig.GetSettings ( string  prefabPath)
protected

◆ GetSourcePath()

string EditablePrefabsConfig.GetSourcePath ( )

Get source path.

Returns
path without GUID

◆ GetSourcePrefab()

ResourceName EditablePrefabsConfig.GetSourcePrefab ( ResourceName  prefab)

Get source prefab of editable entity prefab.

Parameters
[in]prefabQueried prefab
Returns
Source prefab

◆ GetTargetPath()

string EditablePrefabsConfig.GetTargetPath ( )

Get raw target path.

Returns
path without GUID

◆ GetTargetPathAuto()

string EditablePrefabsConfig.GetTargetPathAuto ( )

Get path of auto folder in target path.

Returns
path without GUID

◆ IsBlacklisted()

bool EditablePrefabsConfig.IsBlacklisted ( string  path)
protected

◆ IsEditableEntity()

bool EditablePrefabsConfig.IsEditableEntity ( ResourceName  prefab)

Check if the prefab is an editable entity.

Returns
True if it's an editable entity

◆ IsValid()

bool EditablePrefabsConfig.IsValid ( )

Check if the config is configured correctly.

Returns
true if valid

◆ LogResults()

void EditablePrefabsConfig.LogResults ( notnull map< string, SCR_EEditablePrefabResult >  results)

Print auto-configuration results to log.

Parameters
[in]resultsmap of confired prefabs with their results

◆ MoveEditablePrefab()

ResourceName EditablePrefabsConfig.MoveEditablePrefab ( WorldEditorAPI  api,
string  prevPath,
string  newPath 
)
protected

Move existing editable prefab to a new path (includes also renaming the prefab)

Parameters
[in]prevPathCurrent path
[in]newPathNew path
Returns
New path with GUID

◆ MoveFile()

bool EditablePrefabsConfig.MoveFile ( string  prevPath,
string  newPath 
)

Move a file and its meta file from one path to another.

Parameters
[in]prevPathcurrent path (without GUIDs)
[in]newPathnew path (without GUIDs)
Returns

◆ UpdateChildPrefabs()

bool EditablePrefabsConfig.UpdateChildPrefabs ( WorldEditorAPI  api,
IEntitySource  entitySource,
array< ref SCR_EditorLinkEntry links,
bool  forceDisable = false,
map< string, SCR_EEditablePrefabResult >  results = null,
int  depth = 0 
)
protected

◆ UpdateEditablePrefab()

void EditablePrefabsConfig.UpdateEditablePrefab ( WorldEditorAPI  api,
ResourceName  prefab 
)
Parameters
[in]api
[in]prefab

◆ VerifyEditablePrefab()

string EditablePrefabsConfig.VerifyEditablePrefab ( WorldEditorAPI  api,
ResourceName  prefab,
bool  onlyFileChanges = false 
)
Parameters
[in]api
[in]prefab
[in]onlyFileChanges
Returns

Member Data Documentation

◆ ADDON_PREFIX

const string EditablePrefabsConfig.ADDON_PREFIX = "$profile:"
staticprotected

◆ COPY_EXTENSION

const string EditablePrefabsConfig.COPY_EXTENSION = "_copy"
staticprotected

◆ m_aSourceBlacklist

ref array<string> EditablePrefabsConfig.m_aSourceBlacklist = {}
protected

◆ m_bIsValid

bool EditablePrefabsConfig.m_bIsValid
protected

◆ m_mLinksFromSource

ref map<string, string> EditablePrefabsConfig.m_mLinksFromSource
protected

◆ m_mLinksFromTarget

ref map<string, string> EditablePrefabsConfig.m_mLinksFromTarget
protected

◆ m_sAutoFolderName

string EditablePrefabsConfig.m_sAutoFolderName
protected

◆ m_sCurrentAddon

string EditablePrefabsConfig.m_sCurrentAddon = "$ArmaReforger:"
protected

◆ m_Settings

ref array<ref EditablePrefabsSetting> EditablePrefabsConfig.m_Settings
protected

◆ m_sFileNamePrefix

string EditablePrefabsConfig.m_sFileNamePrefix
protected

◆ m_SourceDirectory

ResourceName EditablePrefabsConfig.m_SourceDirectory
protected

◆ m_sSourceBlacklist

string EditablePrefabsConfig.m_sSourceBlacklist
protected

◆ m_sSourcePath

string EditablePrefabsConfig.m_sSourcePath
protected

◆ m_sTargetPath

string EditablePrefabsConfig.m_sTargetPath
protected

◆ m_sTargetPathAuto

string EditablePrefabsConfig.m_sTargetPathAuto
protected

◆ m_SupportEntities

ref array<ResourceName> EditablePrefabsConfig.m_SupportEntities
protected

◆ m_TargetDirectory

ResourceName EditablePrefabsConfig.m_TargetDirectory
protected

◆ META_EXTENSION

const string EditablePrefabsConfig.META_EXTENSION = ".meta"
staticprotected

◆ WORLD_NAME

const string EditablePrefabsConfig.WORLD_NAME = "EditablePrefabsWorld"
staticprotected

◆ WORLD_PATH

const string EditablePrefabsConfig.WORLD_PATH = "worlds/Plugins/EditablePrefabsConfig"
staticprotected

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