diff --git a/Generated/Classes.cs b/Generated/Classes.cs index c7f0e7f..1c5eb85 100644 --- a/Generated/Classes.cs +++ b/Generated/Classes.cs @@ -2387,6 +2387,14 @@ namespace RobloxFiles public MaterialVariant TerrainSlate; public MaterialVariant TerrainSnow; public MaterialVariant TerrainWoodPlanks; + + public bool Use2022Materials + { + get => Use2022MaterialsXml; + set => Use2022MaterialsXml = value; + } + + public bool Use2022MaterialsXml; public MaterialVariant Wood; public string WoodName = "Wood"; public MaterialVariant WoodPlanks; diff --git a/Plugins/GenerateApiDump.rbxm b/Plugins/GenerateApiDump.rbxm index 6b76b77..45391e2 100644 Binary files a/Plugins/GenerateApiDump.rbxm and b/Plugins/GenerateApiDump.rbxm differ diff --git a/Plugins/GenerateApiDump/PropertyPatches.lua b/Plugins/GenerateApiDump/PropertyPatches.lua index 831cc91..384b0df 100644 --- a/Plugins/GenerateApiDump/PropertyPatches.lua +++ b/Plugins/GenerateApiDump/PropertyPatches.lua @@ -1,6 +1,7 @@ +--!strict local HttpService = game:GetService("HttpService") -local function UseColor3(propName) +local function UseColor3(propName: string) return { Get = string.format("BrickColor.FromColor3(%s)", propName); @@ -8,30 +9,34 @@ local function UseColor3(propName) } end -local function TryDefineEnum(enumName) +local function TryDefineEnum(enumName: string): string? local gotEnum, enum = pcall(function () - return Enum[enumName] + return (Enum :: any)[enumName] :: Enum end) if gotEnum then return "Enum:" .. tostring(enum) end + + return nil end -local function TryGetEnumItem(enumName, itemName) +local function TryGetEnumItem(enumName, itemName): EnumItem? local gotEnum, enum = pcall(function () - return Enum[enumName] + return (Enum :: any)[enumName] :: Enum end) if gotEnum then local gotEnumItem, item = pcall(function () - return enum[itemName] + return (enum :: any)[itemName] :: EnumItem end) if gotEnumItem then return item end end + + return nil end local GuiTextMixIn = @@ -61,7 +66,9 @@ local GuiTextMixIn = }; } -return +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +local PropertyPatches = { AnimationRigData = { @@ -411,6 +418,14 @@ return MaterialService = { + Add = + { + Use2022Materials = "bool"; + Use2022MaterialsXml = "bool" + }; + + Redirect = { Use2022Materials = "Use2022MaterialsXml" }; + Defaults = { AsphaltName = "Asphalt"; @@ -877,4 +892,30 @@ return MeshPartHeadsAndAccessories = TryGetEnumItem("MeshPartHeadsAndAccessories", "Default"); } } -} \ No newline at end of file +} + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +export type GetSetProp = +{ + Get: string; + Set: string; + Flags: string?; +} + +export type Redirect = + GetSetProp | + string; + +export type ClassPatch = +{ + Add: { [string]: string }?; + Redirect: { [string]: Redirect }?; + Defaults: { [string]: any }?; + Remove: {string}?; +} + +export type PropertyPatches = { [string]: ClassPatch } +return (PropertyPatches :: any) :: PropertyPatches + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ \ No newline at end of file