Plugin: allow scripts to specify tab colour maps (#23583)

This commit is contained in:
Aaron van Geffen 2025-01-13 23:47:30 +01:00 committed by GitHub
parent e7eba6b4c5
commit 805c8e2a11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -4874,6 +4874,9 @@ declare global {
frameBase: number; frameBase: number;
frameCount?: number; frameCount?: number;
frameDuration?: number; frameDuration?: number;
primaryColour?: number;
secondaryColour?: number;
tertiaryColour?: number;
offset?: ScreenCoordsXY; offset?: ScreenCoordsXY;
} }

View file

@ -218,6 +218,21 @@ namespace OpenRCT2::Ui::Windows
result.imageFrameCount = AsOrDefault(dukImage["frameCount"], 0); result.imageFrameCount = AsOrDefault(dukImage["frameCount"], 0);
result.imageFrameDuration = AsOrDefault(dukImage["frameDuration"], 0); result.imageFrameDuration = AsOrDefault(dukImage["frameDuration"], 0);
if (dukImage["primaryColour"].type() == DukValue::Type::NUMBER)
{
result.imageFrameBase = result.imageFrameBase.WithPrimary(dukImage["primaryColour"].as_uint());
if (dukImage["secondaryColour"].type() == DukValue::Type::NUMBER)
{
result.imageFrameBase = result.imageFrameBase.WithSecondary(dukImage["secondaryColour"].as_uint());
if (dukImage["tertiaryColour"].type() == DukValue::Type::NUMBER)
{
result.imageFrameBase = result.imageFrameBase.WithTertiary(dukImage["tertiaryColour"].as_uint());
}
}
}
auto dukCoord = dukImage["offset"]; auto dukCoord = dukImage["offset"];
if (dukCoord.type() == DukValue::Type::OBJECT) if (dukCoord.type() == DukValue::Type::OBJECT)
{ {