1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Implement window classification and number

This commit is contained in:
Ted John
2020-02-24 19:25:31 +00:00
parent dfd45651dc
commit c73bb63f0e
2 changed files with 14 additions and 2 deletions

View File

@@ -370,8 +370,8 @@ declare global {
}
interface Window {
id: number;
classification: string;
classification: number;
number: number;
x: number;
y: number;
width: number;

View File

@@ -40,6 +40,16 @@ namespace OpenRCT2::Scripting
{
}
int32_t classification_get()
{
return static_cast<int32_t>(_class);
}
int32_t number_get()
{
return static_cast<int32_t>(_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");