From bf3c6964be6af8033e7c5a4b0e16b1c5ebe772dd Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 18 Apr 2023 21:55:50 +0100 Subject: [PATCH] Remove scenery from object type names --- distribution/openrct2.d.ts | 21 ++++++++++--------- src/openrct2/scripting/ScriptEngine.cpp | 6 +++--- .../scripting/bindings/game/ScContext.hpp | 6 +++--- .../scripting/bindings/object/ScObject.hpp | 18 ++++++++-------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index c2d95d2cfc..dad22d66c2 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -226,9 +226,10 @@ declare global { getObject(type: "ride", index: number): RideObject; getObject(type: "small_scenery", index: number): SmallSceneryObject; getObject(type: "large_scenery", index: number): LargeSceneryObject; - getObject(type: "wall", index: number): WallSceneryObject; - getObject(type: "footpath_addition", index: number): FootpathAdditionSceneryObject; - getObject(type: "banner", index: number): BannerSceneryObject; + getObject(type: "wall", index: number): WallObject; + getObject(type: "footpath_addition", index: number): FootpathAdditionObject; + getObject(type: "banner", index: number): BannerObject; + getObject(type: "scenery_group", index: number): SceneryGroupObject; getAllObjects(type: ObjectType): LoadedImageObject[]; getAllObjects(type: "music"): LoadedObject[]; @@ -1773,23 +1774,23 @@ declare global { * The JSON identifier of the object. * Undefined if object only has a legacy identifier. */ - identifier?: string; + readonly identifier?: string; /** * The DAT identifier of the object. * Undefined if object only has a JSON identifier. */ - legacyIdentifier?: string; + readonly legacyIdentifier?: string; /** * The type of object */ - type?: ObjectType; + readonly type?: ObjectType; /** * The object index */ - object: number | null; + readonly object: number | null; } /** @@ -1821,15 +1822,15 @@ declare global { } - interface WallSceneryObject extends SceneryObject { + interface WallObject extends SceneryObject { } - interface FootpathAdditionSceneryObject extends SceneryObject { + interface FootpathAdditionObject extends SceneryObject { } - interface BannerSceneryObject extends SceneryObject { + interface BannerObject extends SceneryObject { } diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index f23a859ecf..d98ec01034 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -407,9 +407,9 @@ void ScriptEngine::Initialise() ScSceneryObject::Register(ctx); ScSmallSceneryObject::Register(ctx); ScLargeSceneryObject::Register(ctx); - ScWallSceneryObject::Register(ctx); - ScFootpathAdditionSceneryObject::Register(ctx); - ScBannerSceneryObject::Register(ctx); + ScWallObject::Register(ctx); + ScFootpathAdditionObject::Register(ctx); + ScBannerObject::Register(ctx); ScSceneryGroupObject::Register(ctx); ScPark::Register(ctx); ScParkMessage::Register(ctx); diff --git a/src/openrct2/scripting/bindings/game/ScContext.hpp b/src/openrct2/scripting/bindings/game/ScContext.hpp index af02bf58e1..d7f32223b7 100644 --- a/src/openrct2/scripting/bindings/game/ScContext.hpp +++ b/src/openrct2/scripting/bindings/game/ScContext.hpp @@ -171,11 +171,11 @@ namespace OpenRCT2::Scripting case ObjectType::LargeScenery: return GetObjectAsDukValue(ctx, std::make_shared(type, index)); case ObjectType::Walls: - return GetObjectAsDukValue(ctx, std::make_shared(type, index)); + return GetObjectAsDukValue(ctx, std::make_shared(type, index)); case ObjectType::PathBits: - return GetObjectAsDukValue(ctx, std::make_shared(type, index)); + return GetObjectAsDukValue(ctx, std::make_shared(type, index)); case ObjectType::Banners: - return GetObjectAsDukValue(ctx, std::make_shared(type, index)); + return GetObjectAsDukValue(ctx, std::make_shared(type, index)); case ObjectType::SceneryGroup: return GetObjectAsDukValue(ctx, std::make_shared(type, index)); default: diff --git a/src/openrct2/scripting/bindings/object/ScObject.hpp b/src/openrct2/scripting/bindings/object/ScObject.hpp index 55f8613349..bef16a38aa 100644 --- a/src/openrct2/scripting/bindings/object/ScObject.hpp +++ b/src/openrct2/scripting/bindings/object/ScObject.hpp @@ -978,45 +978,45 @@ namespace OpenRCT2::Scripting } }; - class ScWallSceneryObject : public ScSceneryObject + class ScWallObject : public ScSceneryObject { public: - ScWallSceneryObject(ObjectType type, int32_t index) + ScWallObject(ObjectType type, int32_t index) : ScSceneryObject(type, index) { } static void Register(duk_context* ctx) { - dukglue_set_base_class(ctx); + dukglue_set_base_class(ctx); } }; - class ScFootpathAdditionSceneryObject : public ScSceneryObject + class ScFootpathAdditionObject : public ScSceneryObject { public: - ScFootpathAdditionSceneryObject(ObjectType type, int32_t index) + ScFootpathAdditionObject(ObjectType type, int32_t index) : ScSceneryObject(type, index) { } static void Register(duk_context* ctx) { - dukglue_set_base_class(ctx); + dukglue_set_base_class(ctx); } }; - class ScBannerSceneryObject : public ScSceneryObject + class ScBannerObject : public ScSceneryObject { public: - ScBannerSceneryObject(ObjectType type, int32_t index) + ScBannerObject(ObjectType type, int32_t index) : ScSceneryObject(type, index) { } static void Register(duk_context* ctx) { - dukglue_set_base_class(ctx); + dukglue_set_base_class(ctx); } };