Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gradMedExportRunning scripting command #49

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading