diff --git a/Generated/Classes.cs b/Generated/Classes.cs index 58570a7..b267e77 100644 --- a/Generated/Classes.cs +++ b/Generated/Classes.cs @@ -1,5 +1,5 @@ // Auto-generated list of creatable Roblox classes. -// Updated as of 0.530.0.5300290 +// Updated as of 0.532.0.5320475 using System; @@ -1054,6 +1054,14 @@ namespace RobloxFiles } } + public class DeviceIdService : Instance + { + public DeviceIdService() + { + IsService = true; + } + } + public class Dialog : Instance { public DialogBehaviorType BehaviorType = DialogBehaviorType.SinglePlayer; @@ -1358,7 +1366,7 @@ namespace RobloxFiles public Color3 BorderColor3 = Color3.FromRGB(27, 42, 53); public BorderMode BorderMode = BorderMode.Outline; public int BorderSizePixel = 1; - public bool ClipsDescendants; + public bool ClipsDescendants = true; [Obsolete] public bool Draggable; @@ -2716,6 +2724,7 @@ namespace RobloxFiles public Content MeshId = ""; public RenderFidelity RenderFidelity = RenderFidelity.Precise; public Content TextureID = ""; + public int VertexCount = 0; } public class PartOperation : TriangleMeshPart @@ -3489,7 +3498,7 @@ namespace RobloxFiles public float Threshold = -40; } - public abstract class CustomDspSoundEffect : SoundEffect + public abstract class CustomSoundEffect : SoundEffect { } diff --git a/Generated/Enums.cs b/Generated/Enums.cs index 9b981d7..9efde46 100644 --- a/Generated/Enums.cs +++ b/Generated/Enums.cs @@ -1,5 +1,5 @@ // Auto-generated list of Roblox enums. -// Updated as of 0.530.0.5300290 +// Updated as of 0.532.0.5320475 namespace RobloxFiles.Enums { diff --git a/Plugins/GenerateApiDump.rbxm b/Plugins/GenerateApiDump.rbxm index 45391e2..45138ae 100644 Binary files a/Plugins/GenerateApiDump.rbxm and b/Plugins/GenerateApiDump.rbxm differ diff --git a/Plugins/GenerateApiDump/Formatting.lua b/Plugins/GenerateApiDump/Formatting.lua index a652d8e..da9c357 100644 --- a/Plugins/GenerateApiDump/Formatting.lua +++ b/Plugins/GenerateApiDump/Formatting.lua @@ -1,30 +1,24 @@ --!strict -local Format = {} +local Format: Format = {} -type IFlags = { [string]: boolean } -type IEnum = { GetEnumItems: (IEnum) -> {EnumItem} } +export type FormatFunc = (any) -> string +export type Format = { [string]: FormatFunc } +export type IEnum = { GetEnumItems: (IEnum) -> {EnumItem} } -type IAxes = -{ - X: boolean; - Y: boolean; - Z: boolean; -} - -type IFaces = -{ - Left: boolean; - Right: boolean; +local function flags(flags: T, enum: IEnum): string + local value = 0 - Top: boolean; - Bottom: boolean; + for i, item in enum:GetEnumItems() do + if (flags :: any)[item.Name] then + value += (2 ^ item.Value) + end + end - Front: boolean; - Back: boolean; -} + return tostring(value) +end -function Format.Null(value: any): nil - return nil +function Format.Null(value: any): string + return "" end function Format.Bytes(value: string): string @@ -35,12 +29,8 @@ function Format.Bytes(value: string): string return "Array.Empty()" end -function Format.Bool(value: boolean?): string? - if value then - return "true" - end - - return nil +function Format.Bool(value: boolean?): string + return (if value then "true" else "") end function Format.String(value: string): string @@ -98,24 +88,12 @@ function Format.Float(value: number): string end end -function Format.Flags(flags: IFlags, enum: IEnum): string - local value = 0 - - for _,item in pairs(enum:GetEnumItems()) do - if flags[item.Name] then - value += (2 ^ item.Value) - end - end - - return tostring(value) +function Format.Axes(axes: Axes): string + return "(Axes)" .. flags(axes, Enum.Axis) end -function Format.Axes(axes: IAxes): string - return "(Axes)" .. Format.Flags(axes, Enum.Axis) -end - -function Format.Faces(faces: IFaces): string - return "(Faces)" .. Format.Flags(faces, Enum.NormalId) +function Format.Faces(faces: Faces): string + return "(Faces)" .. flags(faces, Enum.NormalId) end function Format.EnumItem(item: EnumItem): string @@ -179,7 +157,7 @@ function Format.UDim2(udim2: UDim2): string end function Format.Vector2(v2: Vector2): string - if v2.Magnitude < 0.001 then + if v2 == Vector2.zero then return "new Vector2()" end @@ -191,7 +169,7 @@ function Format.Vector2(v2: Vector2): string end function Format.Vector3(v3: Vector3): string - if v3.Magnitude < 0.001 then + if v3 == Vector3.zero then return "new Vector3()" end @@ -228,22 +206,24 @@ function Format.CFrame(cf: CFrame): string end function Format.NumberRange(nr: NumberRange): string - local min = nr.Min - local max = nr.Max + local min = Format.Float(nr.Min) + local max = Format.Float(nr.Max) local fmt = "new NumberRange(%s)" - local value = Format.Float(min) + local value = min if min ~= max then - value = value .. ", " .. Format.Float(max) + value ..= ", " .. max end return fmt:format(value) end function Format.Ray(ray: Ray): string - if ray == Ray.new() then - return "new Ray()" + if ray.Origin == Vector3.zero then + if ray.Direction == Vector3.zero then + return "new Ray()" + end end local origin = Format.Vector3(ray.Origin) @@ -303,32 +283,24 @@ function Format.SharedString(str: string): string end function Format.FontFace(font: Font): string - local success, result = pcall(function () - local family = string.format("%q", font.Family) - local args = { family } - - local style = font.Style - local weight = font.Weight - - if style ~= Enum.FontStyle.Normal then - table.insert(args, "FontStyle." .. style.Name) - end - - if #args > 1 or weight ~= Enum.FontWeight.Regular then - table.insert(args, "FontWeight." .. weight.Name) - end - - local fmt = "new FontFace(%s)" - local argStr = table.concat(args, ", ") - - return fmt:format(argStr) - end) - - if success then - return result + local family = string.format("%q", font.Family) + local args = { family } + + local style = font.Style + local weight = font.Weight + + if style ~= Enum.FontStyle.Normal then + table.insert(args, "FontStyle." .. style.Name) end - return nil + if #args > 1 or weight ~= Enum.FontWeight.Regular then + table.insert(args, "FontWeight." .. weight.Name) + end + + local fmt = "new FontFace(%s)" + local argStr = table.concat(args, ", ") + + return fmt:format(argStr) end return Format \ No newline at end of file diff --git a/Plugins/GenerateApiDump/PropertyPatches.lua b/Plugins/GenerateApiDump/PropertyPatches.lua index 384b0df..b7d4c24 100644 --- a/Plugins/GenerateApiDump/PropertyPatches.lua +++ b/Plugins/GenerateApiDump/PropertyPatches.lua @@ -1,7 +1,29 @@ --!strict local HttpService = game:GetService("HttpService") -local function UseColor3(propName: string) +export type GetSet = string | +{ + Get: string; + Set: string; + Flags: string?; +} + +export type Patch = +{ + Add: { [string]: string }?; + Redirect: { [string]: GetSet }?; + Defaults: { [string]: any }?; + Remove: {string}?; +} + +-- strict type reaffirmation? +-- this is some bug with Luau. + +local function GetSet(getSet: GetSet): GetSet + return getSet +end + +local function UseColor3(propName: string): GetSet return { Get = string.format("BrickColor.FromColor3(%s)", propName); @@ -25,7 +47,7 @@ local function TryGetEnumItem(enumName, itemName): EnumItem? local gotEnum, enum = pcall(function () return (Enum :: any)[enumName] :: Enum end) - + if gotEnum then local gotEnumItem, item = pcall(function () return (enum :: any)[itemName] :: EnumItem @@ -39,25 +61,25 @@ local function TryGetEnumItem(enumName, itemName): EnumItem? return nil end -local GuiTextMixIn = +local GuiTextMixIn: Patch = { Add = { Transparency = "float" }; Redirect = { - FontSize = + FontSize = GetSet { Get = "FontUtility.GetFontSize(TextSize)"; Set = "TextSize = FontUtility.GetFontSize(value)"; }; - TextColor = UseColor3("TextColor3"); - TextWrap = "TextWrapped"; - - Transparency = + TextColor = UseColor3 "TextColor3"; + TextWrap = GetSet "TextWrapped"; + + Transparency = GetSet { Get = "base.Transparency"; - + Set = "base.Transparency = value;\n" .. "TextTransparency = value;"; @@ -68,7 +90,7 @@ local GuiTextMixIn = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -local PropertyPatches = +local PropertyPatches: { [string]: Patch } = { AnimationRigData = { @@ -92,7 +114,7 @@ local PropertyPatches = transform = "AQAAAAEAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAA="; } }; - + BallSocketConstraint = { -- Why does this even exist? @@ -111,16 +133,16 @@ local PropertyPatches = Redirect = { - Position = + Position = GetSet { Get = "CFrame.Position"; Set = "CFrame = new CFrame(value) * CFrame.Rotation"; }; - MaterialVariant = "MaterialVariantSerialized"; - BrickColor = UseColor3("Color"); - Color = "Color3uint8"; - Size = "size"; + MaterialVariant = GetSet "MaterialVariantSerialized"; + BrickColor = UseColor3 "Color"; + Color = GetSet "Color3uint8"; + Size = GetSet "size"; }; Defaults = @@ -130,7 +152,7 @@ local PropertyPatches = size = Vector3.new(4, 1.2, 2); }; }; - + BaseScript = { Remove = {"LinkedSource"}; @@ -155,30 +177,30 @@ local PropertyPatches = { Redirect = { - HeadColor = UseColor3("HeadColor3"); - LeftArmColor = UseColor3("LeftArmColor3"); - RightArmColor = UseColor3("RightArmColor3"); - LeftLegColor = UseColor3("LeftLegColor3"); - RightLegColor = UseColor3("RightLegColor3"); - TorsoColor = UseColor3("TorsoColor3"); + HeadColor = UseColor3 "HeadColor3"; + LeftArmColor = UseColor3 "LeftArmColor3"; + RightArmColor = UseColor3 "RightArmColor3"; + LeftLegColor = UseColor3 "LeftLegColor3"; + RightLegColor = UseColor3 "RightLegColor3"; + TorsoColor = UseColor3 "TorsoColor3"; } }; BodyAngularVelocity = { - Redirect = { angularvelocity = "AngularVelocity" }; + Redirect = { angularvelocity = GetSet "AngularVelocity" }; }; BodyGyro = { - Redirect = { cframe = "CFrame" }; + Redirect = { cframe = GetSet "CFrame" }; }; Camera = { - Redirect = { CoordinateFrame = "CFrame" } + Redirect = { CoordinateFrame = GetSet "CFrame" } }; - + CustomEvent = { Add = { PersistedCurrentValue = "float" }; @@ -214,8 +236,8 @@ local PropertyPatches = Redirect = { - Value = "value"; - ConstrainedValue = "value"; + Value = GetSet "value"; + ConstrainedValue = GetSet "value"; } }; @@ -235,8 +257,8 @@ local PropertyPatches = Redirect = { - Heat = "heat_xml"; - Size = "size_xml"; + Heat = GetSet "heat_xml"; + Size = GetSet "size_xml"; }; }; @@ -260,7 +282,7 @@ local PropertyPatches = Redirect = { - FormFactor = "formFactorRaw"; + FormFactor = GetSet "formFactorRaw"; }; }; @@ -272,21 +294,21 @@ local PropertyPatches = GuiBase2d = { - Redirect = { Localize = "AutoLocalize" } + Redirect = { Localize = GetSet "AutoLocalize" } }; GuiBase3d = { - Redirect = { Color = UseColor3("Color3") } + Redirect = { Color = UseColor3 "Color3" } }; GuiObject = { Redirect = { - BackgroundColor = UseColor3("BackgroundColor3"); - BorderColor = UseColor3("BorderColor3"); - Transparency = "BackgroundTransparency"; + Transparency = GetSet "BackgroundTransparency"; + BackgroundColor = UseColor3 "BackgroundColor3"; + BorderColor = UseColor3 "BorderColor3"; } }; @@ -322,7 +344,7 @@ local PropertyPatches = Redirect = { - Health = "Health_XML"; + Health = GetSet "Health_XML"; }; Remove = @@ -358,12 +380,12 @@ local PropertyPatches = IntConstrainedValue = { - Add = { value = "int64" }; + Add = { value = "int64" }; Redirect = { - Value = "value"; - ConstrainedValue = "value"; + Value = GetSet "value"; + ConstrainedValue = GetSet "value"; } }; @@ -387,7 +409,7 @@ local PropertyPatches = Redirect = { - DevelopmentLanguage = "SourceLocaleId"; + DevelopmentLanguage = GetSet "SourceLocaleId"; } }; @@ -424,7 +446,7 @@ local PropertyPatches = Use2022MaterialsXml = "bool" }; - Redirect = { Use2022Materials = "Use2022MaterialsXml" }; + Redirect = { Use2022Materials = GetSet "Use2022MaterialsXml" }; Defaults = { @@ -474,7 +496,9 @@ local PropertyPatches = MeshPart = { - Redirect = { MeshID = "MeshId" } + Add = { VertexCount = "int" }; + Defaults = { VertexCount = 0 }; + Redirect = { MeshID = GetSet "MeshId" } }; Model = @@ -512,14 +536,14 @@ local PropertyPatches = Part = { Add = { shape = TryDefineEnum("PartType") }; - Redirect = { Shape = "shape" }; + Redirect = { Shape = GetSet "shape" }; }; ParticleEmitter = { Redirect = { - VelocitySpread = + VelocitySpread = GetSet { Get = "SpreadAngle.X"; Set = "SpreadAngle = new Vector2(value, value)"; @@ -582,12 +606,12 @@ local PropertyPatches = SelectionBox = { - Redirect = { SurfaceColor = UseColor3("SurfaceColor3") } + Redirect = { SurfaceColor = UseColor3 "SurfaceColor3" } }; SelectionSphere = { - Redirect = { SurfaceColor = UseColor3("SurfaceColor3") } + Redirect = { SurfaceColor = UseColor3 "SurfaceColor3" } }; ServerScriptService = @@ -631,9 +655,9 @@ local PropertyPatches = Redirect = { - Size = "size_xml"; - Opacity = "opacity_xml"; - RiseVelocity = "riseVelocity_xml"; + Size = GetSet "size_xml"; + Opacity = GetSet "opacity_xml"; + RiseVelocity = GetSet "riseVelocity_xml"; }; }; @@ -654,17 +678,17 @@ local PropertyPatches = Redirect = { - MaxDistance = "xmlRead_MaxDistance_3"; - xmlRead_MinDistance_3 = "EmitterSize"; - RollOffMinDistance = "EmitterSize"; - MinDistance = "EmitterSize"; - Pitch = "PlaybackSpeed"; + MaxDistance = GetSet "xmlRead_MaxDistance_3"; + xmlRead_MinDistance_3 = GetSet "EmitterSize"; + RollOffMinDistance = GetSet "EmitterSize"; + MinDistance = GetSet "EmitterSize"; + Pitch = GetSet "PlaybackSpeed"; }; }; Sparkles = { - Redirect = { Color = "SparkleColor" }; + Redirect = { Color = GetSet "SparkleColor" }; }; StarterPlayer = @@ -782,7 +806,7 @@ local PropertyPatches = TrussPart = { Add = { style = TryDefineEnum("Style") }; - Redirect = { Style = "style" }; + Redirect = { Style = GetSet "style" }; }; UnvalidatedAssetService = @@ -849,9 +873,9 @@ local PropertyPatches = Redirect = { - Part0 = "Part0Internal"; - Part1 = "Part1Internal"; - Enabled = "EnabledInternal"; + Part0 = GetSet "Part0Internal"; + Part1 = GetSet "Part1Internal"; + Enabled = GetSet "EnabledInternal"; }; }; @@ -896,26 +920,6 @@ local PropertyPatches = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -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 +return PropertyPatches ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/Plugins/GenerateApiDump/init.server.lua b/Plugins/GenerateApiDump/init.server.lua index d0e6b45..d2c8b7e 100644 --- a/Plugins/GenerateApiDump/init.server.lua +++ b/Plugins/GenerateApiDump/init.server.lua @@ -210,15 +210,13 @@ end -- Formatting --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -type FormatFunc = (any) -> string; -type Format = { [string]: FormatFunc } - local formatting: Format = require(script.Formatting) +type FormatFunc = formatting.FormatFunc +type Format = formatting.Format local formatLinks = { ["int"] = "Int"; - ["nil"] = "Null"; ["long"] = "Int"; ["float"] = "Float"; @@ -228,19 +226,17 @@ local formatLinks = ["string"] = "String"; ["Content"] = "String"; - ["Instance"] = "Null"; ["Color3uint8"] = "Color3"; - ["OptionalCFrame"] = "Null"; ["ProtectedString"] = "String"; } -local function getFormatFunction(valueType: string): FormatFunc? +local function getFormatFunction(valueType: string): FormatFunc if not formatting[valueType] then valueType = formatLinks[valueType] end - return formatting[valueType] + return formatting[valueType] or formatting.Null end --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -269,7 +265,7 @@ setmetatable(patches, patchIndex) -- Main --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -local baseUrl = "https://raw.githubusercontent.com/CloneTrooper1019/Roblox-Client-Tracker/roblox/" +local baseUrl = "https://raw.githubusercontent.com/MaximumADHD/Roblox-Client-Tracker/roblox/" local toolbar, button if plugin then @@ -635,15 +631,11 @@ local function generateClasses() local formatKey = if category == "Enum" then "Enum" else valueType local formatFunc = getFormatFunction(formatKey) - if not formatFunc then + if formatFunc == formatting.Null then local literal = typeof(value) formatFunc = getFormatFunction(literal) end - if not formatFunc then - formatFunc = tostring - end - local result if formatFunc then @@ -653,6 +645,10 @@ local function generateClasses() result = formatFunc(value) end end + + if result == "" then + result = nil + end if result ~= nil then default = " = " .. result diff --git a/RobloxFileFormat.dll b/RobloxFileFormat.dll index 6f277d6..55f5ef8 100644 Binary files a/RobloxFileFormat.dll and b/RobloxFileFormat.dll differ