1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +01:00

Implement scenario select window

This commit is contained in:
Ted John
2021-01-27 22:50:31 +00:00
parent 8cfdbd871d
commit d2a97ab43c
5 changed files with 121 additions and 17 deletions

View File

@@ -80,6 +80,13 @@ namespace OpenRCT2::Scripting
PopObjectIfExists();
}
void Set(const char* name, std::nullptr_t)
{
EnsureObjectPushed();
duk_push_null(_ctx);
duk_put_prop_string(_ctx, _idx, name);
}
void Set(const char* name, bool value)
{
EnsureObjectPushed();
@@ -101,6 +108,13 @@ namespace OpenRCT2::Scripting
duk_put_prop_string(_ctx, _idx, name);
}
void Set(const char* name, uint64_t value)
{
EnsureObjectPushed();
duk_push_number(_ctx, value);
duk_put_prop_string(_ctx, _idx, name);
}
void Set(const char* name, std::string_view value)
{
EnsureObjectPushed();
@@ -108,6 +122,11 @@ namespace OpenRCT2::Scripting
duk_put_prop_string(_ctx, _idx, name);
}
void Set(const char* name, const char* value)
{
Set(name, std::string_view(value));
}
void Set(const char* name, const DukValue& value)
{
EnsureObjectPushed();