mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-23 19:02:04 -05:00
Update vehicle powered fields
This commit is contained in:
parent
c5b2b2017a
commit
a3aed8dce1
2 changed files with 26 additions and 17 deletions
11
distribution/openrct2.d.ts
vendored
11
distribution/openrct2.d.ts
vendored
|
@ -931,9 +931,18 @@ declare global {
|
|||
*/
|
||||
colours: VehicleColour;
|
||||
|
||||
speed: number;
|
||||
/**
|
||||
* The acceleration for vehicles with constant power, e.g.
|
||||
* transport rides and boats.
|
||||
*/
|
||||
poweredAcceleration: number;
|
||||
|
||||
/**
|
||||
* The maximum speed for vehicles with constant power, e.g.
|
||||
* transport rides and boats.
|
||||
*/
|
||||
poweredMaxSpeed: number;
|
||||
|
||||
/**
|
||||
* Current status of the car or train.
|
||||
*/
|
||||
|
|
|
@ -238,9 +238,9 @@ namespace OpenRCT2::Scripting
|
|||
dukglue_register_property(ctx, &ScVehicle::bankRotation_get, &ScVehicle::bankRotation_set, "bankRotation");
|
||||
dukglue_register_property(ctx, &ScVehicle::colours_get, &ScVehicle::colours_set, "colours");
|
||||
dukglue_register_property(ctx, &ScVehicle::trackLocation_get, &ScVehicle::trackLocation_set, "trackLocation");
|
||||
dukglue_register_property(ctx, &ScVehicle::speed_get, &ScVehicle::speed_set, "speed");
|
||||
dukglue_register_property(
|
||||
ctx, &ScVehicle::poweredAcceleration_get, &ScVehicle::poweredAcceleration_set, "poweredAcceleration");
|
||||
dukglue_register_property(ctx, &ScVehicle::poweredMaxSpeed_get, &ScVehicle::poweredMaxSpeed_set, "poweredMaxSpeed");
|
||||
dukglue_register_property(ctx, &ScVehicle::status_get, &ScVehicle::status_set, "status");
|
||||
dukglue_register_property(ctx, &ScVehicle::peeps_get, nullptr, "peeps");
|
||||
}
|
||||
|
@ -513,21 +513,6 @@ namespace OpenRCT2::Scripting
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t speed_get() const
|
||||
{
|
||||
auto vehicle = GetVehicle();
|
||||
return vehicle != nullptr ? vehicle->speed : 0;
|
||||
}
|
||||
void speed_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
auto vehicle = GetVehicle();
|
||||
if (vehicle != nullptr)
|
||||
{
|
||||
vehicle->speed = value;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t poweredAcceleration_get() const
|
||||
{
|
||||
auto vehicle = GetVehicle();
|
||||
|
@ -543,6 +528,21 @@ namespace OpenRCT2::Scripting
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t poweredMaxSpeed_get() const
|
||||
{
|
||||
auto vehicle = GetVehicle();
|
||||
return vehicle != nullptr ? vehicle->speed : 0;
|
||||
}
|
||||
void poweredMaxSpeed_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
auto vehicle = GetVehicle();
|
||||
if (vehicle != nullptr)
|
||||
{
|
||||
vehicle->speed = value;
|
||||
}
|
||||
}
|
||||
|
||||
std::string status_get() const
|
||||
{
|
||||
auto vehicle = GetVehicle();
|
||||
|
|
Loading…
Add table
Reference in a new issue