diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 39ccbe0330..8e066e06b6 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -370,8 +370,8 @@ declare global { } interface Window { - id: number; - classification: string; + classification: number; + number: number; x: number; y: number; width: number; diff --git a/src/openrct2-ui/scripting/ScWindow.hpp b/src/openrct2-ui/scripting/ScWindow.hpp index 0c41b3a8a3..490a38fe08 100644 --- a/src/openrct2-ui/scripting/ScWindow.hpp +++ b/src/openrct2-ui/scripting/ScWindow.hpp @@ -40,6 +40,16 @@ namespace OpenRCT2::Scripting { } + int32_t classification_get() + { + return static_cast(_class); + } + + int32_t number_get() + { + return static_cast(_number); + } + int32_t x_get() { return GetWindow()->x; @@ -123,6 +133,8 @@ namespace OpenRCT2::Scripting static void Register(duk_context* ctx) { + dukglue_register_property(ctx, &ScWindow::classification_get, nullptr, "classification"); + dukglue_register_property(ctx, &ScWindow::number_get, nullptr, "number"); dukglue_register_property(ctx, &ScWindow::x_get, &ScWindow::x_set, "x"); dukglue_register_property(ctx, &ScWindow::y_get, &ScWindow::y_set, "y"); dukglue_register_property(ctx, &ScWindow::width_get, nullptr, "width");