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

This plugin generates a scripted class with variables for widgets and code to find widgets by their name. More...

Inheritance diagram for SCR_GenerateLayoutClassPlugin:
[legend]

Public Member Functions

override void Run ()
 

Protected Member Functions

bool ButtonOK ()
 
bool ButtonCancel ()
 
void Generate (BaseContainer widgetSource, string scriptClassName, string fileOutName)
 Generates the class name for the generated class.
 
bool IsWidgetExportRequired (BaseContainer ws, notnull array< BaseContainer > path)
 Checks if conditions for widget export are satisfied.
 
string ResolveWidgetVariableName (BaseContainer ws)
 Resolves variable name for widget.
 
bool ValidateWidget (BaseContainer ws)
 Performs various validations related to exporting of this widget.
 
array< BaseContainer > ResolveWidgetComponentsForExport (WidgetSource ws)
 Generates an array of components which will be exported for this widget.
 
string GenerateScriptClassName (string path)
 
string ResolveDestinationPath (string fileOutName)
 Resolves the target directory where the file must be saved.
 

Static Protected Member Functions

static void BuildWidgetArray (notnull BaseContainer ws, notnull array< BaseContainer > pathToThis, notnull out array< BaseContainer > outArray, notnull out array< ref array< BaseContainer > > outArrayPaths)
 Converts a widget tree into a widget array.
 
static string GetStringPathToWidget (notnull array< BaseContainer > path)
 Returns path to widget separated with dots First widget is omitted.
 
static string GetWidgetName (BaseContainer ws)
 
static void _print (string str, LogLevel logLevel=LogLevel.NORMAL)
 Prefixes Print() calls with "[SCR_GenerateLayoutClassPlugin] ".
 

Protected Attributes

string m_sScriptClassName
 
string m_sFileOutName
 
string m_sDestinationPath
 
bool m_bInitSuccess
 
BaseContainer m_RootExportRule
 

Static Protected Attributes

static const string PLUGIN_VERSION = "0.5.0"
 

Detailed Description

This plugin generates a scripted class with variables for widgets and code to find widgets by their name.

It also generates code to find all widget components.

Member Function Documentation

◆ _print()

static void SCR_GenerateLayoutClassPlugin._print ( string  str,
LogLevel  logLevel = LogLevel::NORMAL 
)
staticprotected

Prefixes Print() calls with "[SCR_GenerateLayoutClassPlugin] ".

◆ BuildWidgetArray()

static void SCR_GenerateLayoutClassPlugin.BuildWidgetArray ( notnull BaseContainer  ws,
notnull array< BaseContainer >  pathToThis,
notnull out array< BaseContainer >  outArray,
notnull out array< ref array< BaseContainer > >  outArrayPaths 
)
staticprotected

Converts a widget tree into a widget array.

Parameters
[in]ws
[in]pathToThis
[out]outArray- each element will contain a WidgetSource
[out]outArrayPaths- each element will contain a path to this widget, including this widget

◆ ButtonCancel()

bool SCR_GenerateLayoutClassPlugin.ButtonCancel ( )
protected

◆ ButtonOK()

bool SCR_GenerateLayoutClassPlugin.ButtonOK ( )
protected

◆ Generate()

void SCR_GenerateLayoutClassPlugin.Generate ( BaseContainer  widgetSource,
string  scriptClassName,
string  fileOutName 
)
protected

Generates the class name for the generated class.

◆ GenerateScriptClassName()

string SCR_GenerateLayoutClassPlugin.GenerateScriptClassName ( string  path)
protected
Returns
the script classname based on prefix, path file and suffix (see SCR_WidgetExportRuleRoot.GetClassPrefixAndSuffix)

◆ GetStringPathToWidget()

static string SCR_GenerateLayoutClassPlugin.GetStringPathToWidget ( notnull array< BaseContainer >  path)
staticprotected

Returns path to widget separated with dots First widget is omitted.

Parameters
[in]patharray of base containers
Returns
path compliant with Widget.FindWidget() or "_error_" if path is empty

◆ GetWidgetName()

static string SCR_GenerateLayoutClassPlugin.GetWidgetName ( BaseContainer  ws)
staticprotected
Returns
widget's Name property, or empty string in case of no Name property

◆ IsWidgetExportRequired()

bool SCR_GenerateLayoutClassPlugin.IsWidgetExportRequired ( BaseContainer  ws,
notnull array< BaseContainer >  path 
)
protected

Checks if conditions for widget export are satisfied.

◆ ResolveDestinationPath()

string SCR_GenerateLayoutClassPlugin.ResolveDestinationPath ( string  fileOutName)
protected

Resolves the target directory where the file must be saved.

◆ ResolveWidgetComponentsForExport()

array< BaseContainer > SCR_GenerateLayoutClassPlugin.ResolveWidgetComponentsForExport ( WidgetSource  ws)
protected

Generates an array of components which will be exported for this widget.

◆ ResolveWidgetVariableName()

string SCR_GenerateLayoutClassPlugin.ResolveWidgetVariableName ( BaseContainer  ws)
protected

Resolves variable name for widget.

◆ Run()

override void SCR_GenerateLayoutClassPlugin.Run ( )

◆ ValidateWidget()

bool SCR_GenerateLayoutClassPlugin.ValidateWidget ( BaseContainer  ws)
protected

Performs various validations related to exporting of this widget.

Returns
widget export validity

Member Data Documentation

◆ m_bInitSuccess

bool SCR_GenerateLayoutClassPlugin.m_bInitSuccess
protected

◆ m_RootExportRule

BaseContainer SCR_GenerateLayoutClassPlugin.m_RootExportRule
protected

◆ m_sDestinationPath

string SCR_GenerateLayoutClassPlugin.m_sDestinationPath
protected

◆ m_sFileOutName

string SCR_GenerateLayoutClassPlugin.m_sFileOutName
protected

◆ m_sScriptClassName

string SCR_GenerateLayoutClassPlugin.m_sScriptClassName
protected

◆ PLUGIN_VERSION

const string SCR_GenerateLayoutClassPlugin.PLUGIN_VERSION = "0.5.0"
staticprotected

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