Skip to content

Commit

Permalink
add gradMedExportRunning scripting command
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed Oct 5, 2024
1 parent e717a7d commit 43cf2bc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**| |
Expand All @@ -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?
Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 43cf2bc

Please sign in to comment.