diff --git a/Generated/Classes.cs b/Generated/Classes.cs index b23d79c..72738a6 100644 --- a/Generated/Classes.cs +++ b/Generated/Classes.cs @@ -570,13 +570,6 @@ namespace RobloxFiles public class BallSocketConstraint : Constraint { public bool LimitsEnabled = false; - - public float MaxFrictionTorque - { - get { return MaxFrictionTorqueXml; } - set { MaxFrictionTorqueXml = value; } - } - public float MaxFrictionTorqueXml = 0; public float Radius = 0.15f; public float Restitution = 0; @@ -2180,6 +2173,7 @@ namespace RobloxFiles public abstract class TriangleMeshPart : BasePart { + public CollisionFidelity CollisionFidelity = CollisionFidelity.Default; public Vector3 InitialSize = new Vector3(1, 1, 1); public byte[] LODData = new byte[0]; public SharedString PhysicalConfigData = SharedString.FromBase64("1B2M2Y8AsgTpgAmY7PhCfg=="); diff --git a/Plugins/GenerateApiDump.rbxm b/Plugins/GenerateApiDump.rbxm index 9df9c4c..766b46d 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 04855a1..2b455ac 100644 --- a/Plugins/GenerateApiDump/PropertyPatches.lua +++ b/Plugins/GenerateApiDump/PropertyPatches.lua @@ -35,29 +35,10 @@ local GuiTextMixIn = return { - AnalyticsService = - { - Defaults = { ApiKey = "" } - }; - BallSocketConstraint = { -- Why does this even exist? - Add = - { - MaxFrictionTorque = "float"; - MaxFrictionTorqueXml = "float"; - }; - - Defaults = - { - MaxFrictionTorqueXml = 0; - }; - - Redirect = - { - MaxFrictionTorque = "MaxFrictionTorqueXml"; - } + Add = { MaxFrictionTorqueXml = "float" }; }; BasePart = @@ -81,12 +62,6 @@ return Color3uint8 = Color3.fromRGB(163, 162, 165); size = Vector3.new(4, 1.2, 2); }; - - Remove = - { - "Orientation"; - "Rotation"; - } }; BaseScript = @@ -101,27 +76,12 @@ return Bevel = "float"; Bevel_Roundness = "float"; Bulge = "float"; - }; - - Defaults = - { - Bevel = 0; - Bevel_Roundness = 0; - Bulge = 0; } }; BinaryStringValue = { - Add = - { - Value = "BinaryString"; - }; - - Defaults = - { - Value = ""; - }; + Add = { Value = "BinaryString" }; }; BodyColors = @@ -147,11 +107,6 @@ return Redirect = { cframe = "CFrame" }; }; - Bone = - { - Remove = {"Transform"} - }; - Camera = { Redirect = { CoordinateFrame = "CFrame" } @@ -159,8 +114,7 @@ return CustomEvent = { - Add = { PersistedCurrentValue = "float"; }; - Defaults = { PersistedCurrentValue = 0; }; + Add = { PersistedCurrentValue = "float" }; }; DataModelMesh = @@ -187,15 +141,9 @@ return } }; - DebuggerWatch = - { - Defaults = { Expression = "" }; - }; - DoubleConstrainedValue = { - Add = { value = "double" }; - Defaults = { value = 0.0 }; + Add = { value = "double" }; Redirect = { @@ -311,12 +259,6 @@ return EmotesDataInternal = "string"; EquippedEmotesDataInternal = "string"; }; - - Defaults = - { - EmotesDataInternal = ""; - EquippedEmotesDataInternal = ""; - }; }; InsertService = @@ -328,7 +270,6 @@ return IntConstrainedValue = { Add = { value = "int64" }; - Defaults = { value = 0; }; Redirect = { @@ -384,13 +325,6 @@ return ScriptGuid = "string"; Source = "ProtectedString"; }; - - Defaults = - { - LinkedSource = ""; - ScriptGuid = ""; - Source = ""; - }; }; ManualSurfaceJointInstance = @@ -415,8 +349,7 @@ return Model = { - Add = { ModelInPrimary = "CFrame" }; - Defaults = { ModelInPrimary = CFrame.new() }; + Add = { ModelInPrimary = "CFrame" }; }; ModuleScript = @@ -436,13 +369,7 @@ return PackageIdSerialize = "Content"; }; - Defaults = - { - AutoUpdate = false; - - VersionIdSerialize = 0; - PackageIdSerialize = ""; - }; + Defaults = { AutoUpdate = false }; }; Part = @@ -473,13 +400,7 @@ return FormFactor = "Enum:FormFactor"; }; - Defaults = - { - AssetId = ""; - ChildData = ""; - MeshData = ""; - FormFactor = Enum.FormFactor.Custom; - }; + Defaults = { FormFactor = Enum.FormFactor.Custom }; }; PartOperationAsset = @@ -489,21 +410,11 @@ return ChildData = "BinaryString"; MeshData = "BinaryString"; }; - - Defaults = - { - ChildData = ""; - MeshData = ""; - }; }; Players = { - Defaults = - { - MaxPlayersInternal = 16; - PreferredPlayersInternal = 0; - } + Defaults = { MaxPlayersInternal = 16 } }; SelectionBox = @@ -584,25 +495,30 @@ return { Redirect = { Color = "SparkleColor" }; }; + + StarterPlayer = + { + Defaults = + { + GameSettingsAvatar = Enum.GameAvatarType.R15; + GameSettingsR15Collision = Enum.R15CollisionType.OuterBox; + + GameSettingsScaleRangeHead = NumberRange.new(0.95, 1.00); + GameSettingsScaleRangeWidth = NumberRange.new(0.70, 1.00); + GameSettingsScaleRangeHeight = NumberRange.new(0.90, 1.05); + GameSettingsScaleRangeBodyType = NumberRange.new(0.00, 1.00); + GameSettingsScaleRangeProportion = NumberRange.new(0.00, 1.00); + }; + }; StudioData = { Add = { - CommitInflightAuthorId = "int64"; CommitInflightGuid = "string"; + CommitInflightAuthorId = "int64"; CommitInflightPlaceVersion = "int"; }; - - Defaults = - { - CommitInflightAuthorId = 0; - CommitInflightGuid = ""; - CommitInflightPlaceVersion = 0; - - SrcPlaceId = 0; - SrcUniverseId = 0; - }; }; SurfaceAppearance = @@ -628,10 +544,6 @@ return Defaults = { - ClusterGrid = ""; - ClusterGridV2 = ""; - ClusterGridV3 = ""; - Decoration = false; SmoothGrid = "AQU="; @@ -669,14 +581,14 @@ return LODData = "BinaryString"; PhysicsData = "BinaryString"; PhysicalConfigData = "SharedString"; + CollisionFidelity = "Enum:CollisionFidelity"; }; - Defaults = + Defaults = { - LODData = ""; - PhysicsData = ""; InitialSize = Vector3.new(1, 1, 1); PhysicalConfigData = "1B2M2Y8AsgTpgAmY7PhCfg=="; + CollisionFidelity = Enum.CollisionFidelity.Default; }; }; @@ -703,7 +615,7 @@ return WeldConstraint = { - Add = + Add = { Part0Internal = "Class:BasePart"; Part1Internal = "Class:BasePart"; diff --git a/Plugins/GenerateApiDump/init.server.lua b/Plugins/GenerateApiDump/init.server.lua index f2821d9..5d4ca45 100644 --- a/Plugins/GenerateApiDump/init.server.lua +++ b/Plugins/GenerateApiDump/init.server.lua @@ -18,6 +18,7 @@ local numberTypes = { int = true; long = true; + int64 = true; float = true; double = true; } @@ -26,6 +27,7 @@ local stringTypes = { string = true; Content = true; + BinaryString = true; ProtectedString = true; } @@ -406,11 +408,15 @@ local function generateClasses() end for propName, propType in pairs(classPatches.Add) do - if not propMap[propName] then + local prop = propMap[propName] + + if prop then + local serial = prop.Serialization + serial.CanSave = true + serial.CanLoad = true + else propMap[propName] = createProperty(propName, propType) table.insert(propNames, propName) - else - propMap[propName].Serialization.CanLoad = true end end diff --git a/RobloxFileFormat.csproj b/RobloxFileFormat.csproj index 1bdb031..2003c35 100644 --- a/RobloxFileFormat.csproj +++ b/RobloxFileFormat.csproj @@ -6,11 +6,11 @@ Debug AnyCPU {CF50C0E2-23A7-4DC1-B4B2-E60CDE716253} - Exe + Library Properties RobloxFiles RobloxFileFormat - v4.5.2 + v4.7.2 512 publish\ true @@ -29,6 +29,7 @@ true + true diff --git a/RobloxFileFormat.dll b/RobloxFileFormat.dll index 708628e..16a4ea6 100644 Binary files a/RobloxFileFormat.dll and b/RobloxFileFormat.dll differ diff --git a/Utility/BrickColors.cs b/Utility/BrickColors.cs index e3ff943..b2206ab 100644 --- a/Utility/BrickColors.cs +++ b/Utility/BrickColors.cs @@ -42,7 +42,7 @@ namespace RobloxFiles.Utility /// There are some name duplicates, but that's an issue on Roblox's end. /// - public static IReadOnlyList ColorMap = new List() + public static readonly IReadOnlyList ColorMap = new List() { new BrickColor( 1, 0xF2F3F3, "White"), new BrickColor( 2, 0xA1A5A2, "Grey"), diff --git a/Utility/FontUtility.cs b/Utility/FontUtility.cs index 6fcd18e..c71385a 100644 --- a/Utility/FontUtility.cs +++ b/Utility/FontUtility.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using RobloxFiles.Enums; @@ -10,7 +7,7 @@ namespace RobloxFiles.Utility { public static class FontUtility { - public static IReadOnlyDictionary FontSizes = new Dictionary() + public static readonly IReadOnlyDictionary FontSizes = new Dictionary() { { 8, FontSize.Size8 }, { 9, FontSize.Size9 }, @@ -29,8 +26,6 @@ namespace RobloxFiles.Utility { 96, FontSize.Size96 }, }; - private static Dictionary IntToFontSize = new Dictionary(); - public static FontSize GetFontSize(int fontSize) { if (fontSize > 60) diff --git a/Utility/ImplicitMember.cs b/Utility/ImplicitMember.cs index f3f265b..0c73cf9 100644 --- a/Utility/ImplicitMember.cs +++ b/Utility/ImplicitMember.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Reflection; namespace RobloxFiles.Utility @@ -14,12 +15,20 @@ namespace RobloxFiles.Utility public static ImplicitMember Get(Type type, string name) { - var field = type.GetField(name, flags); - var prop = type.GetProperty(name, flags); + var field = type + .GetFields(flags) + .Where(f => f.Name == name) + .FirstOrDefault(); if (field != null) return new ImplicitMember(field); - else if (prop != null) + + var prop = type + .GetProperties(flags) + .Where(p => p.Name == name) + .FirstOrDefault(); + + if (prop != null) return new ImplicitMember(prop); return null; diff --git a/Utility/MaterialInfo.cs b/Utility/MaterialInfo.cs index d78a57e..6141a30 100644 --- a/Utility/MaterialInfo.cs +++ b/Utility/MaterialInfo.cs @@ -12,7 +12,7 @@ namespace RobloxFiles.Utility /// /// A dictionary mapping materials to their default Density. /// - public static IReadOnlyDictionary DensityMap = new Dictionary() + public static readonly IReadOnlyDictionary DensityMap = new Dictionary() { {Material.Air, 0.01f}, {Material.Asphalt, 2.36f}, @@ -56,7 +56,7 @@ namespace RobloxFiles.Utility /// /// A dictionary mapping materials to their default Elasticity. /// - public static IReadOnlyDictionary ElasticityMap = new Dictionary() + public static readonly IReadOnlyDictionary ElasticityMap = new Dictionary() { {Material.Air, 0.01f}, {Material.Asphalt, 0.20f}, @@ -100,7 +100,7 @@ namespace RobloxFiles.Utility /// /// A dictionary mapping materials to their default Friction. /// - public static IReadOnlyDictionary FrictionMap = new Dictionary() + public static readonly IReadOnlyDictionary FrictionMap = new Dictionary() { {Material.Air, 0.01f}, {Material.Asphalt, 0.80f}, @@ -146,7 +146,7 @@ namespace RobloxFiles.Utility /// NOTE: This only maps materials that have different FrictionWeights. /// If it isn't in here, assume their FrictionWeight is 1. /// - public static IReadOnlyDictionary FrictionWeightMap = new Dictionary() + public static readonly IReadOnlyDictionary FrictionWeightMap = new Dictionary() { {Material.Asphalt, 0.30f}, {Material.Basalt, 0.30f},