forked from rosebudai/OpenRCT2-Web
Expose whether the game is paused to the plugin API
This commit is contained in:
1 parent
accbd799ee
commit
cd528665e6
4 files changed
+13
-1
No files matched your search
@@ -47,7 +47,7 @@ namespace OpenRCT2
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
{
|
||||
static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 84;
|
||||
static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 85;
|
||||
|
||||
// Versions marking breaking changes.
|
||||
static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33;
|
||||
|
||||
@@ -126,6 +126,11 @@ namespace OpenRCT2::Scripting
|
||||
return "normal";
|
||||
}
|
||||
|
||||
bool paused_get()
|
||||
{
|
||||
return GameIsPaused();
|
||||
}
|
||||
|
||||
void captureImage(const DukValue& options)
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
@@ -433,6 +438,7 @@ namespace OpenRCT2::Scripting
|
||||
dukglue_register_property(ctx, &ScContext::sharedStorage_get, nullptr, "sharedStorage");
|
||||
dukglue_register_method(ctx, &ScContext::getParkStorage, "getParkStorage");
|
||||
dukglue_register_property(ctx, &ScContext::mode_get, nullptr, "mode");
|
||||
dukglue_register_property(ctx, &ScContext::paused_get, nullptr, "paused");
|
||||
dukglue_register_method(ctx, &ScContext::captureImage, "captureImage");
|
||||
dukglue_register_method(ctx, &ScContext::getObject, "getObject");
|
||||
dukglue_register_method(ctx, &ScContext::getAllObjects, "getAllObjects");
|
||||
|
||||
Reference in new issue
Block a user