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

Workbench plugin for generation of windows & glass prefabs. More...

Inheritance diagram for SCR_GenerateWindowsPrefabsTool:
[legend]

Public Attributes

bool m_bUsePureIEntitySource
 

Protected Member Functions

void CreateGlassButton ()
 
void CreateSashesButton ()
 
void CreateFramesButton ()
 
void UpdateSashPrefabs ()
 
void UpdateWindowPrefabs ()
 
void CreateAndFillPrefabFromXOBs (notnull array< string > xobCriteria, notnull array< ref array< string > > fillerCriteria, ResourceName basePrefab, ResourceName saveDirectory)
 Create a Prefab with the found XOBs.
 
bool CreateAndSaveBaseAndDefaultPrefabFromXOB (map< string, ResourceName > prefabMap, ResourceName xobPath, ResourceName parentPrefab, string absoluteSaveDir)
 Save both _base prefab (empty) and a default prefab (inheriting from the base one, with created children)
 
bool SaveEntitySourceAsNewTemplate (notnull IEntitySource entitySource, string absoluteFilePath)
 As its name says, take the provided entitySource and save it as a new Prefab.
 
void CreateGlass ()
 Create a prefab from the provided XOBs.
 
ResourceName GetDestroyedGlassModelPath (ResourceName resourceName, int variant)
 Get path to destroyed glass model.
 
string GetDamageMask (ResourceName resourceName)
 Get damage mask string.
 
string GetDamageVariants (ResourceName resourceName)
 Get all variants (resourceName + "00", "01", "02" etc) present in data.
 
int GetGlassCount (ResourceName glassResourceName)
 Count how many damage variants exist.
 
void RefreshPrefabs (notnull array< string > prefabCriteria, notnull array< ref array< string > > fillerCriteria)
 Update prefabs - to use other prefabs deduced from bone names.
 
bool RefreshPrefab (notnull map< string, ResourceName > boneResourceNames, ResourceName prefabResourceName)
 
map< string, ResourceName > PrefabSearchMap (notnull array< ref array< string > > searchStringGroups)
 Get prefab search result as a map of filename (lowercase)/resourceName.
 
array< ResourceName > GetListedSelectedOrOpenedResources (string wantedExtension="", array< string > keywords=null, array< ResourceName > resourceNames=null)
 Get defined array resources or selected resources - filtered by keyword.
 
array< IEntitySource > CreateEntitySourcesFromBoneNames (notnull map< string, ResourceName > prefabMap, notnull IEntitySource entitySource, bool addToParent)
 
IEntitySource CreateEntitySourceFromBoneName (notnull map< string, ResourceName > prefabMap, string boneName, IEntitySource parent)
 
array< ref Resource > CreateResourcesFromBoneNames (notnull map< string, ResourceName > prefabMap, notnull IEntitySource entitySource)
 
Resource CreateResourceFromBoneName (notnull map< string, ResourceName > prefabMap, string boneName)
 
array< string > GetBoneNames (notnull IEntity entity)
 Get useful bone names without e.g Scene_Root or COM_.
 
ResourceName FindAdaptedPrefab (notnull map< string, ResourceName > prefabMap, string boneName)
 Find the prefab adapted to the provided bone name.
 

Protected Attributes

int m_iAddonToUse
 
bool m_bRemoveExistingChildren
 
ResourceName m_sGlassBasePrefab
 
ResourceName m_sGlassSavePath
 
ref array< ResourceName > m_aGlassVariants
 
int m_iGlassDmgCount
 
string m_sGlassName
 
bool m_bUseMultiPhaseDestruction
 
ResourceName m_sSashBasePrefab
 
ResourceName m_sSashSavePath
 
ResourceName m_sWindowBasePrefab
 
ResourceName m_sWindowSavePath
 

Static Protected Attributes

static const string BASE_PREFAB_SUFFIX = "_base"
 
static const string MESHOBJECT_CLASSNAME = "MeshObject"
 
static const string HIERARCHY_CLASSNAME = "Hierarchy"
 
static const string GENERICENTITY_CLASSNAME = "GenericEntity"
 
static const ref array< string > GLASS_CRITERIA = { "glass_", "x" }
 
static const ref array< string > SASH_CRITERIA = { "winsash_", "x" }
 
static const ref array< string > WINDOW_CRITERIA = { "win_", "x" }
 
static const ref array< string > BONE_CRITERIA = { "x" }
 these criteria must target/filter ALL bones (window or sash), so no "glass_" filter in there
 

Detailed Description

Workbench plugin for generation of windows & glass prefabs.

Multiple buttons for:

Member Function Documentation

◆ CreateAndFillPrefabFromXOBs()

void SCR_GenerateWindowsPrefabsTool.CreateAndFillPrefabFromXOBs ( notnull array< string >  xobCriteria,
notnull array< ref array< string > >  fillerCriteria,
ResourceName  basePrefab,
ResourceName  saveDirectory 
)
protected

Create a Prefab with the found XOBs.

◆ CreateAndSaveBaseAndDefaultPrefabFromXOB()

bool SCR_GenerateWindowsPrefabsTool.CreateAndSaveBaseAndDefaultPrefabFromXOB ( map< string, ResourceName >  prefabMap,
ResourceName  xobPath,
ResourceName  parentPrefab,
string  absoluteSaveDir 
)
protected

Save both _base prefab (empty) and a default prefab (inheriting from the base one, with created children)

Returns
true on success, false on failure

◆ CreateEntitySourceFromBoneName()

IEntitySource SCR_GenerateWindowsPrefabsTool.CreateEntitySourceFromBoneName ( notnull map< string, ResourceName >  prefabMap,
string  boneName,
IEntitySource  parent 
)
protected
Parameters
[in]parentcan be null
Returns
the created entity's entitySource

◆ CreateEntitySourcesFromBoneNames()

array< IEntitySource > SCR_GenerateWindowsPrefabsTool.CreateEntitySourcesFromBoneNames ( notnull map< string, ResourceName >  prefabMap,
notnull IEntitySource  entitySource,
bool  addToParent 
)
protected
Returns
the created entities' entitySources

◆ CreateFramesButton()

void SCR_GenerateWindowsPrefabsTool.CreateFramesButton ( )
protected

◆ CreateGlass()

void SCR_GenerateWindowsPrefabsTool.CreateGlass ( )
protected

Create a prefab from the provided XOBs.

◆ CreateGlassButton()

void SCR_GenerateWindowsPrefabsTool.CreateGlassButton ( )
protected

◆ CreateResourceFromBoneName()

Resource SCR_GenerateWindowsPrefabsTool.CreateResourceFromBoneName ( notnull map< string, ResourceName >  prefabMap,
string  boneName 
)
protected
Returns
the created entity's Resource (for ref reasons)

◆ CreateResourcesFromBoneNames()

array< ref Resource > SCR_GenerateWindowsPrefabsTool.CreateResourcesFromBoneNames ( notnull map< string, ResourceName >  prefabMap,
notnull IEntitySource  entitySource 
)
protected
Returns
the created entities' entitySources

◆ CreateSashesButton()

void SCR_GenerateWindowsPrefabsTool.CreateSashesButton ( )
protected

◆ FindAdaptedPrefab()

ResourceName SCR_GenerateWindowsPrefabsTool.FindAdaptedPrefab ( notnull map< string, ResourceName >  prefabMap,
string  boneName 
)
protected

Find the prefab adapted to the provided bone name.

Returns
the prefab's ResourceName, string.Empty if not found

◆ GetBoneNames()

array< string > SCR_GenerateWindowsPrefabsTool.GetBoneNames ( notnull IEntity  entity)
protected

Get useful bone names without e.g Scene_Root or COM_.

◆ GetDamageMask()

string SCR_GenerateWindowsPrefabsTool.GetDamageMask ( ResourceName  resourceName)
protected

Get damage mask string.

Returns
resourceNameDirPath/Dmg/resourceNameFileName with ".xob" replaced by "_dmg_"

◆ GetDamageVariants()

string SCR_GenerateWindowsPrefabsTool.GetDamageVariants ( ResourceName  resourceName)
protected

Get all variants (resourceName + "00", "01", "02" etc) present in data.

Returns
comma-separated resourceNames

◆ GetDestroyedGlassModelPath()

ResourceName SCR_GenerateWindowsPrefabsTool.GetDestroyedGlassModelPath ( ResourceName  resourceName,
int  variant 
)
protected

Get path to destroyed glass model.

◆ GetGlassCount()

int SCR_GenerateWindowsPrefabsTool.GetGlassCount ( ResourceName  glassResourceName)
protected

Count how many damage variants exist.

◆ GetListedSelectedOrOpenedResources()

array< ResourceName > SCR_GenerateWindowsPrefabsTool.GetListedSelectedOrOpenedResources ( string  wantedExtension = "",
array< string >  keywords = null,
array< ResourceName >  resourceNames = null 
)
protected

Get defined array resources or selected resources - filtered by keyword.

Parameters
[in]resourceNames
[in]wantedExtensionwithout the separating period, e.g "xob"
[in]keywords(lowercase) mandatory keywords that must exist in resource filename
Returns
array of results - either selected or array-listed ResourceNames

◆ PrefabSearchMap()

map< string, ResourceName > SCR_GenerateWindowsPrefabsTool.PrefabSearchMap ( notnull array< ref array< string > >  searchStringGroups)
protected

Get prefab search result as a map of filename (lowercase)/resourceName.

Returns
filenameLC-prefabResourceName pair map - (e.g "glass_100x42"-"{6B82AB4CBFE63D6E}Prefabs/Structures/BuildingParts/Windows/Glass_100x42/Glass_100x42.et")

◆ RefreshPrefab()

bool SCR_GenerateWindowsPrefabsTool.RefreshPrefab ( notnull map< string, ResourceName >  boneResourceNames,
ResourceName  prefabResourceName 
)
protected
Returns
true = success, false = failure

◆ RefreshPrefabs()

void SCR_GenerateWindowsPrefabsTool.RefreshPrefabs ( notnull array< string >  prefabCriteria,
notnull array< ref array< string > >  fillerCriteria 
)
protected

Update prefabs - to use other prefabs deduced from bone names.

◆ SaveEntitySourceAsNewTemplate()

bool SCR_GenerateWindowsPrefabsTool.SaveEntitySourceAsNewTemplate ( notnull IEntitySource  entitySource,
string  absoluteFilePath 
)
protected

As its name says, take the provided entitySource and save it as a new Prefab.

Returns
true on success, false on failure

◆ UpdateSashPrefabs()

void SCR_GenerateWindowsPrefabsTool.UpdateSashPrefabs ( )
protected

◆ UpdateWindowPrefabs()

void SCR_GenerateWindowsPrefabsTool.UpdateWindowPrefabs ( )
protected

Member Data Documentation

◆ BASE_PREFAB_SUFFIX

const string SCR_GenerateWindowsPrefabsTool.BASE_PREFAB_SUFFIX = "_base"
staticprotected

◆ BONE_CRITERIA

const ref array<string> SCR_GenerateWindowsPrefabsTool.BONE_CRITERIA = { "x" }
staticprotected

these criteria must target/filter ALL bones (window or sash), so no "glass_" filter in there

◆ GENERICENTITY_CLASSNAME

const string SCR_GenerateWindowsPrefabsTool.GENERICENTITY_CLASSNAME = "GenericEntity"
staticprotected

◆ GLASS_CRITERIA

const ref array<string> SCR_GenerateWindowsPrefabsTool.GLASS_CRITERIA = { "glass_", "x" }
staticprotected

◆ HIERARCHY_CLASSNAME

const string SCR_GenerateWindowsPrefabsTool.HIERARCHY_CLASSNAME = "Hierarchy"
staticprotected

◆ m_aGlassVariants

ref array<ResourceName> SCR_GenerateWindowsPrefabsTool.m_aGlassVariants
protected

◆ m_bRemoveExistingChildren

bool SCR_GenerateWindowsPrefabsTool.m_bRemoveExistingChildren
protected

◆ m_bUseMultiPhaseDestruction

bool SCR_GenerateWindowsPrefabsTool.m_bUseMultiPhaseDestruction
protected

◆ m_bUsePureIEntitySource

bool SCR_GenerateWindowsPrefabsTool.m_bUsePureIEntitySource

◆ m_iAddonToUse

int SCR_GenerateWindowsPrefabsTool.m_iAddonToUse
protected

◆ m_iGlassDmgCount

int SCR_GenerateWindowsPrefabsTool.m_iGlassDmgCount
protected

◆ m_sGlassBasePrefab

ResourceName SCR_GenerateWindowsPrefabsTool.m_sGlassBasePrefab
protected

◆ m_sGlassName

string SCR_GenerateWindowsPrefabsTool.m_sGlassName
protected

◆ m_sGlassSavePath

ResourceName SCR_GenerateWindowsPrefabsTool.m_sGlassSavePath
protected

◆ m_sSashBasePrefab

ResourceName SCR_GenerateWindowsPrefabsTool.m_sSashBasePrefab
protected

◆ m_sSashSavePath

ResourceName SCR_GenerateWindowsPrefabsTool.m_sSashSavePath
protected

◆ m_sWindowBasePrefab

ResourceName SCR_GenerateWindowsPrefabsTool.m_sWindowBasePrefab
protected

◆ m_sWindowSavePath

ResourceName SCR_GenerateWindowsPrefabsTool.m_sWindowSavePath
protected

◆ MESHOBJECT_CLASSNAME

const string SCR_GenerateWindowsPrefabsTool.MESHOBJECT_CLASSNAME = "MeshObject"
staticprotected

◆ SASH_CRITERIA

const ref array<string> SCR_GenerateWindowsPrefabsTool.SASH_CRITERIA = { "winsash_", "x" }
staticprotected

◆ WINDOW_CRITERIA

const ref array<string> SCR_GenerateWindowsPrefabsTool.WINDOW_CRITERIA = { "win_", "x" }
staticprotected

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