Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ConvertEditableEntitiesPlugin.c
Go to the documentation of this file.
1/*
2#ifdef WORKBENCH
3[WorkbenchPluginAttribute(name: "Convert to/from Editable Entities...", category: SCR_PluginCategory.EDITOR, shortcut: "Ctrl+Shift+E", wbModules: { "WorldEditor" })]
4class SCR_ConvertEditableEntitiesPlugin : PrefabEditingPluginBase
5{
6 [Attribute(defvalue: "{90B4D95CF3610F3D}Configs/Workbench/EditablePrefabs/EditablePrefabsConfig.conf", desc: "", params: "conf")]
7 private ResourceName m_Config;
8
9 //------------------------------------------------------------------------------------------------
10 protected void Convert(bool toEditable)
11 {
12 EditablePrefabsConfig config = EditablePrefabsConfig.GetConfig(m_Config);
13 if (!config) return;
14 config.GetLinks();
15
16 array<ResourceName> selectedPrefabs = new array<ResourceName>;
17 if (!GetPrefabs(selectedPrefabs)) return;
18
19 foreach (ResourceName prefab : selectedPrefabs)
20 {
21 config.UpdateEditableChildPrefabs(prefab, toEditable);
22 }
23 }
24
25 //------------------------------------------------------------------------------------------------
26 override void Run()
27 {
28 if (!Workbench.ScriptDialog("Editable Entities Converter", "Scans all entities within selected prefabs and replaces them by...\n[To Editable] ... prefabs configured for use in in-game editor\n[To Non-editable] ... original prefabs", this)) return;
29 }
30
31 //------------------------------------------------------------------------------------------------
32 [ButtonAttribute("To Editable")]
33 protected void ButtonToEditable()
34 {
35 Convert(true);
36 }
37
38 //------------------------------------------------------------------------------------------------
39 [ButtonAttribute("To Non-editable")]
40 protected void ButtonToNonEditable()
41 {
42 Convert(false);
43 }
44
45 //------------------------------------------------------------------------------------------------
46 [ButtonAttribute("Cancel")]
47 protected bool ButtonCancel()
48 {
49 return false;
50 }
51}
52[WorkbenchPluginAttribute(name: "Convert to/from Editable Entities...", category: SCR_PluginCategory.EDITOR, shortcut: "Ctrl+Shift+E", wbModules: { "ResourceManager" })]
53class SCR_ConvertEditableEntitiesPluginResourceManager : SCR_ConvertEditableEntitiesPlugin
54{
55 //------------------------------------------------------------------------------------------------
56 override void GetSelected(out array<ResourceName> selection)
57 {
58 GetSelectedResourceBrowser(selection);
59 }
60}
61#endif
62*/