Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
FlowmapTool.c
Go to the documentation of this file.
1[WorkbenchPluginAttribute("Regenerate river flow-maps", "")]
2class GenerateFlowMaps: WorkbenchPlugin
3{
4 override void RunCommandline()
5 {
6 string path;
7 WorldEditor we = Workbench.GetModule(WorldEditor);
8 bool exitAfter;
9 if (we.GetApi())
10 {
11 // plugged into WorldEditor module
12 we.GetCmdLine("-world", path);
13 string dummy;
14 exitAfter = we.GetCmdLine("-exitAfter", dummy);
15 }
16 else
17 {
18 // plugged into RM module
19 ResourceManager rm = Workbench.GetModule(ResourceManager);
20 rm.GetCmdLine("-world", path);
21 Workbench.OpenModule(WorldEditor);
22 exitAfter = true;
23 }
24
25 bool hasLoadedWorld = false;
26 if (path.IsEmpty())
27 {
28 if (we.GetApi())
29 {
30 we.GetApi().GetWorldPath(path);
31 hasLoadedWorld = !path.IsEmpty();
32 }
33 }
34 else
35 {
36 hasLoadedWorld = we.SetOpenedResource(path);
37 }
38
39 if (!hasLoadedWorld)
40 {
41 Print("GenerateFlowMapsPlugin: Unable to load a world or no world file specified. Terminating.", LogLevel.ERROR);
42 Workbench.Exit(-1);
43 }
44 else if (exitAfter)
45 {
46 we.GetApi().RegenerateFlowMaps(false, true, false, true);
47 Print("GenerateFlowMapsPlugin: Done. Exiting Workbench.");
48 Workbench.Exit(0);
49 }
50 else
51 {
52 we.GetApi().RegenerateFlowMaps(true, true, false, true);
53 Print("GenerateFlowMapsPlugin: Done.");
54 }
55 }
56}
57
58
59[WorkbenchPluginAttribute("Regenerate river flow-maps", "Generate and save/overwrite river flow-maps", "", "", {"WorldEditor"},"",0xf773)]
60class GenerateFlowMapsWEPlugin: WorkbenchPlugin
61{
62 // WE entry points
63 override void Run()
64 {
65 WorldEditor we = Workbench.GetModule(WorldEditor);
66 WorldEditorAPI api = we.GetApi();
67 api.RegenerateFlowMaps();
68 }
69}
70
string path
override void RunCommandline()
Definition FlowmapTool.c:60
GenerateFlowMaps WorkbenchPlugin WorkbenchPluginAttribute("Regenerate river flow-maps", "Generate and save/overwrite river flow-maps", "", "", {"WorldEditor"}, "", 0xf773)
Definition FlowmapTool.c:59
override void Run()
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