1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Change ternary to tertiary for plugins (#16833)

This commit is contained in:
Ted John
2022-03-21 21:42:10 +00:00
committed by GitHub
parent 18be90f8b6
commit 91ceecc6fc
3 changed files with 10 additions and 6 deletions

View File

@@ -1099,7 +1099,7 @@ declare global {
interface VehicleColour {
body: number;
trim: number;
ternary: number;
tertiary: number;
}
interface RideStation {
@@ -1535,7 +1535,7 @@ declare global {
/**
* Gets the patrol area for the staff member.
*/
readonly patrolArea: PatrolArea;
readonly patrolArea: PatrolArea;
}
type StaffType = "handyman" | "mechanic" | "security" | "entertainer";
@@ -2514,7 +2514,7 @@ declare global {
interface GraphicsContext {
colour: number | undefined;
secondaryColour: number | undefined;
ternaryColour: number | undefined;
tertiaryColour: number | undefined;
stroke: number;
fill: number;
paletteId: number | undefined;

View File

@@ -42,7 +42,9 @@ namespace OpenRCT2::Scripting
dukglue_register_property(
ctx, &ScGraphicsContext::secondaryColour_get, &ScGraphicsContext::secondaryColour_set, "secondaryColour");
dukglue_register_property(
ctx, &ScGraphicsContext::ternaryColour_get, &ScGraphicsContext::ternaryColour_set, "ternaryColour");
ctx, &ScGraphicsContext::tertiaryColour_get, &ScGraphicsContext::tertiaryColour_set, "ternaryColour");
dukglue_register_property(
ctx, &ScGraphicsContext::tertiaryColour_get, &ScGraphicsContext::tertiaryColour_set, "tertiaryColour");
dukglue_register_property(ctx, &ScGraphicsContext::paletteId_get, &ScGraphicsContext::paletteId_set, "paletteId");
dukglue_register_property(ctx, &ScGraphicsContext::fill_get, &ScGraphicsContext::fill_set, "fill");
dukglue_register_property(ctx, &ScGraphicsContext::stroke_get, &ScGraphicsContext::stroke_set, "stroke");
@@ -89,12 +91,12 @@ namespace OpenRCT2::Scripting
_secondaryColour = {};
}
DukValue ternaryColour_get() const
DukValue tertiaryColour_get() const
{
return ToDuk(_ctx, _tertiaryColour);
}
void ternaryColour_set(DukValue value)
void tertiaryColour_set(DukValue value)
{
if (value.type() == DukValue::NUMBER)
_tertiaryColour = static_cast<colour_t>(value.as_int());

View File

@@ -45,6 +45,7 @@ namespace OpenRCT2::Scripting
obj.Set("body", value.Body);
obj.Set("trim", value.Trim);
obj.Set("ternary", value.Tertiary);
obj.Set("tertiary", value.Tertiary);
return obj.Take();
}
@@ -54,6 +55,7 @@ namespace OpenRCT2::Scripting
result.Body = AsOrDefault(s["body"], 0);
result.Trim = AsOrDefault(s["trim"], 0);
result.Tertiary = AsOrDefault(s["ternary"], 0);
result.Tertiary = AsOrDefault<int32_t>(s["tertiary"], result.Tertiary);
return result;
}