diff --git a/README.md b/README.md index 93389fc..7ab05ae 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ We export the following from Arma 3 maps: All exported files can be found in the `grad_meh` subdirectory of your Arma 3 installation directory. Each map has its own subdirectory, which structure is further explained [here](./docs/output_spec.md). ## Scripting API -Gruppe Adler Map Exporter adds a script command, which is used by the UI. If you want to, you could leverage that scripting command for your own purposes. +Gruppe Adler Map Exporter adds two script commands, which are used by the UI. If you want to, you could leverage that scripting command for your own purposes. ### `gradMehExportMap` |**Syntax**| | @@ -59,6 +59,17 @@ Gruppe Adler Map Exporter adds a script command, which is used by the UI. If you ||| |Examples|`gradMehExportMap ["Stratis", true, true, true, true, true];`| +### `gradMehExportRunning` +|**Syntax**| | +|---|---| +|Description| Check if an export is currently running. | +||| +|Syntax| **gradMehExportRunning** +||| +|Return Value| [Boolean](https://community.bistudio.com/wiki/Boolean) - `true` is export is currently running, `false` if none is running +||| +|Examples|`private _running = gradMehExportRunning;`| + ## FAQ ### How long does an export take? diff --git a/src/main.cpp b/src/main.cpp index 8a44517..945fbe4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -299,6 +299,10 @@ void extractMap(const std::string &worldName, const std::string &worldPath, std: return; } +game_value exportRunningCommand(game_state &gs) { + return gradMehIsRunning; +} + game_value exportMapCommand(game_state &gs, SQFPar rightArg) { @@ -413,6 +417,8 @@ void intercept::pre_start() client::host::register_sqf_command("gradMehExportMap", "Exports the given map", exportMapCommand, game_data_type::SCALAR, game_data_type::STRING); static auto grad_meh_export_map_array = client::host::register_sqf_command("gradMehExportMap", "Exports the given map", exportMapCommand, game_data_type::SCALAR, game_data_type::ARRAY); + static auto grad_meh_export_running = + client::host::register_sqf_command("gradMehExportRunning", "Check if an export is currently running", exportRunningCommand, game_data_type::BOOL); #if WIN32 std::filesystem::path a3_log_path;