3 name:
"Prefab Structure Creation",
4 description:
"Create Prefab structure according to config",
6 wbModules: {
"WorldEditor" },
7 awesomeFontCode: 0xF6BE)]
8class SCR_PrefabStructureCreationPlugin : WorkbenchPlugin
11 protected int m_iAddon;
14 protected ref SCR_PrefabHelper_Structure m_ConfigType;
16 [
Attribute(defvalue:
"{009E0970F762CC4E}Configs/Workbench/PrefabStructureCreationPlugin/CarPrefabStructure.conf",
params:
"conf class=SCR_PrefabHelper_Structure")]
19 [
Attribute(defvalue:
"",
desc:
"Project Name (e.g S105) - allowed characters: " + ALLOWED_CHARACTERS)]
20 string m_sProjectName;
25 protected override void Run()
27 m_sProjectName.TrimInPlace();
29 if (!DialogConfirmation())
35 if (!m_ConfigType.m_Directory)
38 string addonFileSystem = SCR_AddonTool.GetAddonFileSystem(m_iAddon);
39 string absoluteAddonDirectory;
40 if (!SCR_AddonTool.GetAddonAbsolutePath(m_iAddon,
string.Empty, absoluteAddonDirectory,
true))
42 Print(
"Cannot find path for addon " + addonFileSystem,
LogLevel.ERROR);
46 m_ConfigType.m_sName = m_sProjectName;
47 if (!SCR_PrefabHelper.CreatePrefabStructure(m_ConfigType, addonFileSystem))
56 protected bool DialogConfirmation()
58 if (!Workbench.ScriptDialog(
"Prefab Structure Creation",
"",
this))
61 array<string> errors = {};
63 if (m_sStructureToCreate)
65 m_ConfigType = SCR_ConfigHelperT<SCR_PrefabHelper_Structure>.GetConfigObject(m_sStructureToCreate);
69 Print(
"Cannot get m_ConfigType from " + m_sStructureToCreate,
LogLevel.ERROR);
70 Workbench.Dialog(
"Error",
"Cannot get m_ConfigType from " + m_sStructureToCreate);
76 errors.Insert(
"Structure To Create is null");
81 errors.Insert(
"Project Name is invalid");
83 if (!errors.IsEmpty())
89 return errors.IsEmpty();
101 protected int ButtonClose()
108 protected void SCR_PrefabStructureCreationPlugin();
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
class WorkbenchDialog_AbortRetryIgnore ButtonAttribute("OK", true)
static bool IsValidFileName(string fileName)
static ParamEnumArray FromAddons(int titleFormat=2, int hideCoreModules=0)
static string Filter(string input, string characters, bool useCharactersAsBlacklist=false)
static string Join(string separator, notnull array< string > pieces, bool joinEmptyEntries=true)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute