Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VerifySlotEntitiesPlugin.c
Go to the documentation of this file.
1#ifdef WORKBENCH
2[WorkbenchPluginAttribute(name: "Verify Slot Entities", wbModules: { "WorldEditor" }, awesomeFontCode: 0xF560)]
3class SCR_VerifySlotEntitiesPlugin : WorkbenchPlugin
4{
5 override void Run()
6 {
7 WorldEditor worldEditor = Workbench.GetModule(WorldEditor);
8 WorldEditorAPI api = worldEditor.GetApi();
9
10 WBProgressDialog progress = new WBProgressDialog("Processing world entities...", worldEditor);
11
12 BaseContainer container;
13 SCR_SiteSlotEntity entity;
14 int n = 0;
15
16 Print("Verify Slot Entities: Start", LogLevel.DEBUG);
17
18 float prevProgress, currProgress;
19 api.BeginEntityAction(Type().ToString());
20 for (int i = 0, count = worldEditor.GetNumContainers(); i < count; i++)
21 {
22 container = worldEditor.GetContainer(i);
23 if (container.GetClassName().ToType().IsInherited(SCR_SiteSlotEntity))
24 {
25 entity = SCR_SiteSlotEntity.Cast(api.SourceToEntity(container));
26 entity._WB_SnapToTerrain(container);
27 entity._WB_OrientToTerrain(container);
28 n++;
29 }
30
31 currProgress = i / count;
32 if (currProgress - prevProgress >= 0.01) // min 1%
33 {
34 progress.SetProgress(currProgress); // expensive
35 prevProgress = currProgress;
36 }
37 }
38 api.EndEntityAction();
39
40 Print(string.Format("Verify Slot Entities: End, %1 slots processed", n), LogLevel.DEBUG);
41 }
42}
43#endif // WORKBENCH
GenerateFlowMaps WorkbenchPlugin WorkbenchPluginAttribute("Regenerate river flow-maps", "Generate and save/overwrite river flow-maps", "", "", {"WorldEditor"}, "", 0xf773)
Definition FlowmapTool.c:59
override void Run()
int Type
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.