mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Allow non-networked plug-ins to set pause state directly
This commit is contained in:
@@ -131,6 +131,13 @@ namespace OpenRCT2::Scripting
|
||||
return GameIsPaused();
|
||||
}
|
||||
|
||||
void paused_set(const bool& value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
if (value != GameIsPaused())
|
||||
PauseToggle();
|
||||
}
|
||||
|
||||
void captureImage(const DukValue& options)
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
@@ -438,7 +445,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_property(ctx, &ScContext::paused_get, &ScContext::paused_set, "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