Bringing up to date.
Brought everything up to date with 0.437.0.406875 and made some improvements.
This commit is contained in:
parent
e5f6852e7a
commit
5f4d3e16d2
3
.gitignore
vendored
3
.gitignore
vendored
@ -328,3 +328,6 @@ ASALocalRun/
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Library Test
|
||||
RobloxFileFormat.exe
|
@ -11,6 +11,10 @@ namespace RobloxFiles.DataTypes
|
||||
return string.Join<ColorSequenceKeypoint>(" ", Keypoints);
|
||||
}
|
||||
|
||||
public ColorSequence(float r, float g, float b) : this(new Color3(r, g, b))
|
||||
{
|
||||
}
|
||||
|
||||
public ColorSequence(Color3 c) : this(c, c)
|
||||
{
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Auto-generated list of creatable Roblox classes.
|
||||
// Updated as of 0.415.0.373700
|
||||
// Updated as of 0.437.0.406875
|
||||
|
||||
using System;
|
||||
|
||||
@ -7,6 +7,8 @@ using RobloxFiles.DataTypes;
|
||||
using RobloxFiles.Enums;
|
||||
using RobloxFiles.Utility;
|
||||
|
||||
#pragma warning disable IDE1006 // Suppress warnings about camelCase.
|
||||
|
||||
namespace RobloxFiles
|
||||
{
|
||||
public class ABTestService : Instance
|
||||
@ -65,6 +67,14 @@ namespace RobloxFiles
|
||||
{
|
||||
}
|
||||
|
||||
public class AssetManagerService : Instance
|
||||
{
|
||||
public AssetManagerService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class AssetService : Instance
|
||||
{
|
||||
public AssetService()
|
||||
@ -73,12 +83,26 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class Atmosphere : Instance
|
||||
{
|
||||
public Color3 Color = Color3.FromRGB(199, 170, 107);
|
||||
public Color3 Decay = Color3.FromRGB(92, 60, 13);
|
||||
public float Density = 0.395f;
|
||||
public float Glare = 0;
|
||||
public float Haze = 0;
|
||||
public float Offset = 0;
|
||||
}
|
||||
|
||||
public class Attachment : Instance
|
||||
{
|
||||
public CFrame CFrame = new CFrame();
|
||||
public bool Visible = false;
|
||||
}
|
||||
|
||||
public class Bone : Attachment
|
||||
{
|
||||
}
|
||||
|
||||
public class Backpack : Instance
|
||||
{
|
||||
}
|
||||
@ -149,7 +173,7 @@ namespace RobloxFiles
|
||||
{
|
||||
public Attachment Attachment0 = null;
|
||||
public Attachment Attachment1 = null;
|
||||
public ColorSequence Color = new ColorSequence(new Color3(1, 1, 1));
|
||||
public ColorSequence Color = new ColorSequence(1, 1, 1);
|
||||
public float CurveSize0 = 0;
|
||||
public float CurveSize1 = 0;
|
||||
public bool Enabled = true;
|
||||
@ -320,6 +344,14 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class BulkImportService : Instance
|
||||
{
|
||||
public BulkImportService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class CacheableContentProvider : Instance
|
||||
{
|
||||
public CacheableContentProvider()
|
||||
@ -530,12 +562,21 @@ namespace RobloxFiles
|
||||
{
|
||||
public Vector3 AngularVelocity_ = new Vector3();
|
||||
public float MaxTorque = 0;
|
||||
public bool ReactionTorqueEnabled = false;
|
||||
public ActuatorRelativeTo RelativeTo = ActuatorRelativeTo.World;
|
||||
}
|
||||
|
||||
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;
|
||||
public bool TwistLimitsEnabled = false;
|
||||
@ -712,6 +753,7 @@ namespace RobloxFiles
|
||||
|
||||
public class CustomEvent : Instance
|
||||
{
|
||||
public float PersistedCurrentValue = 0;
|
||||
}
|
||||
|
||||
public class CustomEventReceiver : Instance
|
||||
@ -816,6 +858,14 @@ namespace RobloxFiles
|
||||
{
|
||||
}
|
||||
|
||||
public class EventIngestService : Instance
|
||||
{
|
||||
public EventIngestService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class Explosion : Instance
|
||||
{
|
||||
public float BlastPressure = 500000;
|
||||
@ -944,6 +994,7 @@ namespace RobloxFiles
|
||||
public class FunctionalTest : Instance
|
||||
{
|
||||
public string Description = "?";
|
||||
public bool HasMigratedSettingsToTestService = false;
|
||||
}
|
||||
|
||||
public class GamePassService : Instance
|
||||
@ -1115,6 +1166,17 @@ namespace RobloxFiles
|
||||
public bool TextWrapped = false;
|
||||
public TextXAlignment TextXAlignment = TextXAlignment.Center;
|
||||
public TextYAlignment TextYAlignment = TextYAlignment.Center;
|
||||
|
||||
public new float Transparency
|
||||
{
|
||||
get { return base.Transparency; }
|
||||
|
||||
set
|
||||
{
|
||||
base.Transparency = value;
|
||||
TextTransparency = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class GuiLabel : GuiObject
|
||||
@ -1173,6 +1235,17 @@ namespace RobloxFiles
|
||||
public bool TextWrapped = false;
|
||||
public TextXAlignment TextXAlignment = TextXAlignment.Center;
|
||||
public TextYAlignment TextYAlignment = TextYAlignment.Center;
|
||||
|
||||
public new float Transparency
|
||||
{
|
||||
get { return base.Transparency; }
|
||||
|
||||
set
|
||||
{
|
||||
base.Transparency = value;
|
||||
TextTransparency = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ScrollingFrame : GuiObject
|
||||
@ -1196,7 +1269,6 @@ namespace RobloxFiles
|
||||
public class TextBox : GuiObject
|
||||
{
|
||||
public bool ClearTextOnFocus = true;
|
||||
public bool EnableRealtimeFilteringHints = false; // [Load-only]
|
||||
public Font Font = Font.Legacy;
|
||||
|
||||
[Obsolete]
|
||||
@ -1207,12 +1279,9 @@ namespace RobloxFiles
|
||||
}
|
||||
|
||||
public float LineHeight = 1;
|
||||
public bool ManualFocusRelease = false; // [Load-only]
|
||||
public bool MultiLine = false;
|
||||
public bool OverlayNativeInput = false; // [Load-only]
|
||||
public Color3 PlaceholderColor3 = Color3.FromRGB(178, 178, 178);
|
||||
public string PlaceholderText = "";
|
||||
public ReturnKeyType ReturnKeyType = ReturnKeyType.Default; // [Load-only]
|
||||
public bool ShowNativeInput = true;
|
||||
public string Text = "TextBox";
|
||||
|
||||
@ -1225,7 +1294,6 @@ namespace RobloxFiles
|
||||
|
||||
public Color3 TextColor3 = Color3.FromRGB(27, 42, 53);
|
||||
public bool TextEditable = true;
|
||||
public TextInputType TextInputType = TextInputType.Default; // [Load-only]
|
||||
public bool TextScaled = false;
|
||||
public float TextSize = 8;
|
||||
public Color3 TextStrokeColor3 = new Color3();
|
||||
@ -1243,6 +1311,17 @@ namespace RobloxFiles
|
||||
public bool TextWrapped = false;
|
||||
public TextXAlignment TextXAlignment = TextXAlignment.Center;
|
||||
public TextYAlignment TextYAlignment = TextYAlignment.Center;
|
||||
|
||||
public new float Transparency
|
||||
{
|
||||
get { return base.Transparency; }
|
||||
|
||||
set
|
||||
{
|
||||
base.Transparency = value;
|
||||
TextTransparency = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class VideoFrame : GuiObject
|
||||
@ -1343,6 +1422,26 @@ namespace RobloxFiles
|
||||
public float WireRadius = 0.0625f;
|
||||
}
|
||||
|
||||
public abstract class InstanceAdornment : GuiBase3d
|
||||
{
|
||||
public Instance Adornee = null;
|
||||
}
|
||||
|
||||
public class SelectionBox : InstanceAdornment
|
||||
{
|
||||
public float LineThickness = 0.15f;
|
||||
|
||||
[Obsolete]
|
||||
public BrickColor SurfaceColor
|
||||
{
|
||||
get { return BrickColor.FromColor3(SurfaceColor3); }
|
||||
set { SurfaceColor3 = value.Color; }
|
||||
}
|
||||
|
||||
public Color3 SurfaceColor3 = Color3.FromRGB(13, 105, 172);
|
||||
public float SurfaceTransparency = 1;
|
||||
}
|
||||
|
||||
public abstract class PVAdornment : GuiBase3d
|
||||
{
|
||||
public PVInstance Adornee = null;
|
||||
@ -1394,21 +1493,6 @@ namespace RobloxFiles
|
||||
{
|
||||
}
|
||||
|
||||
public class SelectionBox : PVAdornment
|
||||
{
|
||||
public float LineThickness = 0.15f;
|
||||
|
||||
[Obsolete]
|
||||
public BrickColor SurfaceColor
|
||||
{
|
||||
get { return BrickColor.FromColor3(SurfaceColor3); }
|
||||
set { SurfaceColor3 = value.Color; }
|
||||
}
|
||||
|
||||
public Color3 SurfaceColor3 = Color3.FromRGB(13, 105, 172);
|
||||
public float SurfaceTransparency = 1;
|
||||
}
|
||||
|
||||
public class SelectionSphere : PVAdornment
|
||||
{
|
||||
[Obsolete]
|
||||
@ -1472,7 +1556,6 @@ namespace RobloxFiles
|
||||
public bool AutoSelectGuiEnabled = true;
|
||||
public bool CoreGuiNavigationEnabled = true;
|
||||
public bool GuiNavigationEnabled = true;
|
||||
public GuiObject SelectedCoreObject = null;
|
||||
public GuiObject SelectedObject = null;
|
||||
}
|
||||
|
||||
@ -1510,6 +1593,7 @@ namespace RobloxFiles
|
||||
public bool BreakJointsOnDeath = true;
|
||||
public HumanoidCollisionType CollisionType = HumanoidCollisionType.OuterBox;
|
||||
public HumanoidDisplayDistanceType DisplayDistanceType = HumanoidDisplayDistanceType.Viewer;
|
||||
public string DisplayName = "";
|
||||
|
||||
public float Health
|
||||
{
|
||||
@ -1529,6 +1613,7 @@ namespace RobloxFiles
|
||||
public float MaxSlopeAngle = 89;
|
||||
public float NameDisplayDistance = 100;
|
||||
public NameOcclusion NameOcclusion = NameOcclusion.OccludeAll;
|
||||
public bool RequiresNeck = true;
|
||||
public HumanoidRigType RigType = HumanoidRigType.R6;
|
||||
public bool UseJumpPower = true;
|
||||
public float WalkSpeed = 16;
|
||||
@ -1644,7 +1729,6 @@ namespace RobloxFiles
|
||||
|
||||
public class Motor : JointInstance
|
||||
{
|
||||
public float CurrentAngle = 0; // [Load-only]
|
||||
public float DesiredAngle = 0;
|
||||
public float MaxVelocity = 0;
|
||||
}
|
||||
@ -1714,6 +1798,14 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class LanguageService : Instance
|
||||
{
|
||||
public LanguageService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class Light : Instance
|
||||
{
|
||||
public float Brightness = 1;
|
||||
@ -1760,15 +1852,10 @@ namespace RobloxFiles
|
||||
public float FogStart = 0;
|
||||
public float GeographicLatitude = 41.7333f;
|
||||
public bool GlobalShadows = true;
|
||||
public bool LegacyOutlines = false;
|
||||
public Color3 OutdoorAmbient = Color3.FromRGB(128, 128, 128);
|
||||
|
||||
[Obsolete]
|
||||
public bool Outlines
|
||||
{
|
||||
get { return LegacyOutlines; }
|
||||
set { LegacyOutlines = value; }
|
||||
}
|
||||
public bool Outlines = false;
|
||||
|
||||
[Obsolete]
|
||||
public Color3 ShadowColor = Color3.FromRGB(178, 178, 183);
|
||||
@ -1786,6 +1873,14 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class AppStorageService : LocalStorageService
|
||||
{
|
||||
public AppStorageService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class LocalizationService : Instance
|
||||
{
|
||||
public LocalizationService()
|
||||
@ -1826,7 +1921,6 @@ namespace RobloxFiles
|
||||
public abstract class BaseScript : LuaSourceContainer
|
||||
{
|
||||
public bool Disabled = false;
|
||||
public Content LinkedSource = "";
|
||||
}
|
||||
|
||||
public class Script : BaseScript
|
||||
@ -2082,7 +2176,6 @@ namespace RobloxFiles
|
||||
|
||||
public abstract class TriangleMeshPart : BasePart
|
||||
{
|
||||
public CollisionFidelity CollisionFidelity = CollisionFidelity.Default; // [Load-only]
|
||||
public Vector3 InitialSize = new Vector3(1, 1, 1);
|
||||
public byte[] LODData = new byte[0];
|
||||
public SharedString PhysicalConfigData = SharedString.FromBase64("1B2M2Y8AsgTpgAmY7PhCfg==");
|
||||
@ -2091,6 +2184,8 @@ namespace RobloxFiles
|
||||
|
||||
public class MeshPart : TriangleMeshPart
|
||||
{
|
||||
public bool HasSkinnedMesh = false;
|
||||
|
||||
[Obsolete]
|
||||
public Content MeshID
|
||||
{
|
||||
@ -2110,6 +2205,7 @@ namespace RobloxFiles
|
||||
public FormFactor FormFactor = FormFactor.Custom;
|
||||
public byte[] MeshData = new byte[0];
|
||||
public RenderFidelity RenderFidelity = RenderFidelity.Precise;
|
||||
public float SmoothingAngle = 0;
|
||||
public bool UsePartColor = false;
|
||||
}
|
||||
|
||||
@ -2174,6 +2270,7 @@ namespace RobloxFiles
|
||||
public int StreamingMinRadius = 64;
|
||||
public StreamingPauseMode StreamingPauseMode = StreamingPauseMode.Default;
|
||||
public int StreamingTargetRadius = 1024;
|
||||
public bool TemporaryLegacyPhysicsSolverOverrideStreaming = false;
|
||||
public bool TerrainWeldsFixed = true;
|
||||
}
|
||||
|
||||
@ -2184,16 +2281,8 @@ namespace RobloxFiles
|
||||
public class PackageLink : Instance
|
||||
{
|
||||
public bool AutoUpdate = false;
|
||||
public long OriginalHash = 0;
|
||||
public Content PackageIdSerialize = "";
|
||||
public string SymbolicLink = "";
|
||||
public long VersionIdSerialize = 0;
|
||||
|
||||
public long VersionNumber
|
||||
{
|
||||
get { return VersionIdSerialize; }
|
||||
set { VersionIdSerialize = value; }
|
||||
}
|
||||
}
|
||||
|
||||
public class PackageService : Instance
|
||||
@ -2213,7 +2302,7 @@ namespace RobloxFiles
|
||||
public class ParticleEmitter : Instance
|
||||
{
|
||||
public Vector3 Acceleration = new Vector3();
|
||||
public ColorSequence Color = new ColorSequence(new Color3(1, 1, 1));
|
||||
public ColorSequence Color = new ColorSequence(1, 1, 1);
|
||||
public float Drag = 0;
|
||||
public NormalId EmissionDirection = NormalId.Top;
|
||||
public bool Enabled = true;
|
||||
@ -2252,6 +2341,14 @@ namespace RobloxFiles
|
||||
public float EmptyCutoff = 0;
|
||||
}
|
||||
|
||||
public class PermissionsService : Instance
|
||||
{
|
||||
public PermissionsService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class PhysicsService : Instance
|
||||
{
|
||||
public PhysicsService()
|
||||
@ -2266,9 +2363,6 @@ namespace RobloxFiles
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
|
||||
public bool PlayerEmulationEnabled = false; // [Load-only]
|
||||
public string StudioEmulatedCountryRegionCode = ""; // [Load-only]
|
||||
}
|
||||
|
||||
public class Players : Instance
|
||||
@ -2286,9 +2380,6 @@ namespace RobloxFiles
|
||||
|
||||
public class PluginAction : Instance
|
||||
{
|
||||
public bool Checked = true; // [Load-only]
|
||||
public string DefaultShortcut = ""; // [Load-only]
|
||||
public bool Enabled = true; // [Load-only]
|
||||
}
|
||||
|
||||
public class PluginGuiService : Instance
|
||||
@ -2352,6 +2443,14 @@ namespace RobloxFiles
|
||||
public Color3 TintColor = new Color3(1, 1, 1);
|
||||
}
|
||||
|
||||
public class DepthOfFieldEffect : PostEffect
|
||||
{
|
||||
public float FarIntensity = 0.75f;
|
||||
public float FocusDistance = 0.05f;
|
||||
public float InFocusRadius = 10;
|
||||
public float NearIntensity = 0.75f;
|
||||
}
|
||||
|
||||
public class SunRaysEffect : PostEffect
|
||||
{
|
||||
public float Intensity = 0.25f;
|
||||
@ -2410,7 +2509,7 @@ namespace RobloxFiles
|
||||
public class ReflectionMetadataClass : ReflectionMetadataItem
|
||||
{
|
||||
public int ExplorerImageIndex = 0;
|
||||
public int ExplorerOrder = 2147483647;
|
||||
public int ExplorerOrder = int.MaxValue;
|
||||
public bool Insertable = true;
|
||||
public string PreferredParent = "";
|
||||
}
|
||||
@ -2464,6 +2563,14 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class ReplicatedScriptService : Instance
|
||||
{
|
||||
public ReplicatedScriptService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class ReplicatedStorage : Instance
|
||||
{
|
||||
public ReplicatedStorage()
|
||||
@ -2496,14 +2603,6 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class RuntimeScriptService : Instance
|
||||
{
|
||||
public RuntimeScriptService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class ScriptContext : Instance
|
||||
{
|
||||
public ScriptContext()
|
||||
@ -2546,6 +2645,14 @@ namespace RobloxFiles
|
||||
}
|
||||
}
|
||||
|
||||
public class SessionService : Instance
|
||||
{
|
||||
public SessionService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class Sky : Instance
|
||||
{
|
||||
public bool CelestialBodiesShown = true;
|
||||
@ -2600,12 +2707,7 @@ namespace RobloxFiles
|
||||
|
||||
public class Sound : Instance
|
||||
{
|
||||
public float EmitterSize
|
||||
{
|
||||
get { return xmlRead_MinDistance_3; }
|
||||
set { xmlRead_MinDistance_3 = value; }
|
||||
}
|
||||
|
||||
public float EmitterSize = 10;
|
||||
public bool Looped = false;
|
||||
|
||||
public float MaxDistance
|
||||
@ -2637,7 +2739,12 @@ namespace RobloxFiles
|
||||
public double TimePosition = 0;
|
||||
public float Volume = 0.5f;
|
||||
public float xmlRead_MaxDistance_3 = 10000;
|
||||
public float xmlRead_MinDistance_3 = 10;
|
||||
|
||||
public float xmlRead_MinDistance_3
|
||||
{
|
||||
get { return EmitterSize; }
|
||||
set { EmitterSize = value; }
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class SoundEffect : Instance
|
||||
@ -2827,7 +2934,12 @@ namespace RobloxFiles
|
||||
IsService = true;
|
||||
}
|
||||
|
||||
public long CommitInflightAuthorId = 0;
|
||||
public string CommitInflightGuid = "";
|
||||
public int CommitInflightPlaceVersion = 0;
|
||||
public bool EnableScriptCollabByDefaultOnLoad = false;
|
||||
public bool EnableScriptCollabOnLoad = false;
|
||||
public bool EnableScriptCollabVersionHistoryOnLoad = false;
|
||||
public long SrcPlaceId = 0;
|
||||
public long SrcUniverseId = 0;
|
||||
}
|
||||
@ -2838,8 +2950,16 @@ namespace RobloxFiles
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool UseLocalSpace = true; // [Load-only]
|
||||
public class SurfaceAppearance : Instance
|
||||
{
|
||||
public AlphaMode AlphaMode = AlphaMode.Overlay;
|
||||
public Content ColorMap = "";
|
||||
public Content MetalnessMap = "";
|
||||
public Content NormalMap = "";
|
||||
public Content RoughnessMap = "";
|
||||
public Content TexturePack = "";
|
||||
}
|
||||
|
||||
public class Team : Instance
|
||||
@ -2928,7 +3048,7 @@ namespace RobloxFiles
|
||||
{
|
||||
public Attachment Attachment0 = null;
|
||||
public Attachment Attachment1 = null;
|
||||
public ColorSequence Color = new ColorSequence(new Color3(1, 1, 1));
|
||||
public ColorSequence Color = new ColorSequence(1, 1, 1);
|
||||
public bool Enabled = true;
|
||||
public bool FaceCamera = false;
|
||||
public float Lifetime = 2;
|
||||
@ -2998,9 +3118,15 @@ namespace RobloxFiles
|
||||
public int MinTextSize = 1;
|
||||
}
|
||||
|
||||
public class UICorner : UIComponent
|
||||
{
|
||||
public UDim CornerRadius = new UDim(0, 8);
|
||||
}
|
||||
|
||||
public class UIGradient : UIComponent
|
||||
{
|
||||
public ColorSequence Color = new ColorSequence(new Color3(1, 1, 1));
|
||||
public ColorSequence Color = new ColorSequence(1, 1, 1);
|
||||
public bool Enabled = true;
|
||||
public Vector2 Offset = new Vector2();
|
||||
public float Rotation = 0;
|
||||
public NumberSequence Transparency = new NumberSequence(0);
|
||||
@ -3080,10 +3206,17 @@ namespace RobloxFiles
|
||||
|
||||
public bool LegacyInputEventsEnabled = true;
|
||||
public MouseBehavior MouseBehavior = MouseBehavior.Default;
|
||||
public float MouseDeltaSensitivity = 1; // [Load-only]
|
||||
public bool MouseIconEnabled = true;
|
||||
}
|
||||
|
||||
public class UserService : Instance
|
||||
{
|
||||
public UserService()
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class VRService : Instance
|
||||
{
|
||||
public VRService()
|
||||
@ -3125,26 +3258,40 @@ namespace RobloxFiles
|
||||
{
|
||||
public double ConstrainedValue
|
||||
{
|
||||
get { return Value; }
|
||||
set { Value = value; }
|
||||
get { return value; }
|
||||
set { this.value = value; }
|
||||
}
|
||||
|
||||
public double MaxValue = 1;
|
||||
public double MinValue = 0;
|
||||
public double Value = 0; // [Load-only]
|
||||
|
||||
public double Value
|
||||
{
|
||||
get { return value; }
|
||||
set { this.value = value; }
|
||||
}
|
||||
|
||||
public double value = 0;
|
||||
}
|
||||
|
||||
public class IntConstrainedValue : ValueBase
|
||||
{
|
||||
public long ConstrainedValue
|
||||
{
|
||||
get { return Value; }
|
||||
set { Value = value; }
|
||||
get { return value; }
|
||||
set { this.value = value; }
|
||||
}
|
||||
|
||||
public long MaxValue = 10;
|
||||
public long MinValue = 0;
|
||||
public long Value = 0; // [Load-only]
|
||||
|
||||
public long Value
|
||||
{
|
||||
get { return value; }
|
||||
set { this.value = value; }
|
||||
}
|
||||
|
||||
public long value = 0;
|
||||
}
|
||||
|
||||
public class IntValue : ValueBase
|
||||
@ -3191,8 +3338,6 @@ namespace RobloxFiles
|
||||
{
|
||||
IsService = true;
|
||||
}
|
||||
|
||||
public string AdditionalLuaState = ""; // [Load-only]
|
||||
}
|
||||
|
||||
public class VirtualUser : Instance
|
||||
|
@ -1,8 +1,18 @@
|
||||
// Auto-generated list of Roblox enums.
|
||||
// Updated as of 0.415.0.373700
|
||||
// Updated as of 0.437.0.406875
|
||||
|
||||
namespace RobloxFiles.Enums
|
||||
{
|
||||
public enum ABTestLoadingStatus
|
||||
{
|
||||
None,
|
||||
Pending,
|
||||
Initialized,
|
||||
Error,
|
||||
TimedOut,
|
||||
ShutOff
|
||||
}
|
||||
|
||||
public enum ActionType
|
||||
{
|
||||
Nothing,
|
||||
@ -32,6 +42,12 @@ namespace RobloxFiles.Enums
|
||||
Perpendicular
|
||||
}
|
||||
|
||||
public enum AlphaMode
|
||||
{
|
||||
Overlay,
|
||||
Transparency
|
||||
}
|
||||
|
||||
public enum AnimationPriority
|
||||
{
|
||||
Idle,
|
||||
@ -112,7 +128,15 @@ namespace RobloxFiles.Enums
|
||||
PoseAnimation,
|
||||
EarAccessory,
|
||||
EyeAccessory,
|
||||
EmoteAnimation = 61
|
||||
EmoteAnimation = 61,
|
||||
Video
|
||||
}
|
||||
|
||||
public enum AutoIndentRule
|
||||
{
|
||||
Off,
|
||||
Absolute,
|
||||
Relative
|
||||
}
|
||||
|
||||
public enum AvatarContextMenuOption
|
||||
@ -191,6 +215,12 @@ namespace RobloxFiles.Enums
|
||||
UserBreakpoint
|
||||
}
|
||||
|
||||
public enum BulkMoveMode
|
||||
{
|
||||
FireAllEvents,
|
||||
FireCFrameChanged
|
||||
}
|
||||
|
||||
public enum Button
|
||||
{
|
||||
Dismount = 8,
|
||||
@ -318,7 +348,8 @@ namespace RobloxFiles.Enums
|
||||
{
|
||||
Default,
|
||||
Hull,
|
||||
Box
|
||||
Box,
|
||||
PreciseConvexDecomposition
|
||||
}
|
||||
|
||||
public enum ComputerCameraMovementMode
|
||||
@ -458,12 +489,6 @@ namespace RobloxFiles.Enums
|
||||
OnUpdate
|
||||
}
|
||||
|
||||
public enum DateTimeKind
|
||||
{
|
||||
Utc,
|
||||
Local
|
||||
}
|
||||
|
||||
public enum DevCameraOcclusionMode
|
||||
{
|
||||
Zoom,
|
||||
@ -570,7 +595,8 @@ namespace RobloxFiles.Enums
|
||||
{
|
||||
OK,
|
||||
DraftOutdated,
|
||||
ScriptRemoved
|
||||
ScriptRemoved,
|
||||
DraftCommitted
|
||||
}
|
||||
|
||||
public enum EasingDirection
|
||||
@ -833,6 +859,7 @@ namespace RobloxFiles.Enums
|
||||
NetFail,
|
||||
Aborted,
|
||||
SslConnectFail,
|
||||
SslVerificationFail,
|
||||
Unknown
|
||||
}
|
||||
|
||||
@ -894,6 +921,13 @@ namespace RobloxFiles.Enums
|
||||
None = 18
|
||||
}
|
||||
|
||||
public enum IKCollisionsMode
|
||||
{
|
||||
NoCollisions,
|
||||
OtherMechanismsAnchored,
|
||||
IncludeContactedMechanisms
|
||||
}
|
||||
|
||||
public enum InOut
|
||||
{
|
||||
Edge,
|
||||
@ -1213,7 +1247,8 @@ namespace RobloxFiles.Enums
|
||||
{
|
||||
SystemDefault,
|
||||
English,
|
||||
SimplifiedChinese
|
||||
SimplifiedChinese,
|
||||
Korean
|
||||
}
|
||||
|
||||
public enum LeftRight
|
||||
@ -1430,6 +1465,13 @@ namespace RobloxFiles.Enums
|
||||
Roblox
|
||||
}
|
||||
|
||||
public enum PhysicsSimulationRate
|
||||
{
|
||||
Fixed240Hz,
|
||||
Fixed120Hz,
|
||||
Fixed60Hz
|
||||
}
|
||||
|
||||
public enum Platform
|
||||
{
|
||||
Windows,
|
||||
@ -1543,6 +1585,12 @@ namespace RobloxFiles.Enums
|
||||
InnerBox
|
||||
}
|
||||
|
||||
public enum RaycastFilterType
|
||||
{
|
||||
Blacklist,
|
||||
Whitelist
|
||||
}
|
||||
|
||||
public enum RenderFidelity
|
||||
{
|
||||
Automatic,
|
||||
@ -1830,6 +1878,8 @@ namespace RobloxFiles.Enums
|
||||
ScriptBuiltInFunction,
|
||||
ScriptWarning,
|
||||
ScriptError,
|
||||
ScriptWhitespace,
|
||||
ScriptRuler,
|
||||
DebuggerCurrentLine,
|
||||
DebuggerErrorLine,
|
||||
DiffFilePathText,
|
||||
@ -1862,10 +1912,7 @@ namespace RobloxFiles.Enums
|
||||
DialogButtonText,
|
||||
DialogButtonBorder,
|
||||
DialogMainButton,
|
||||
DialogMainButtonText,
|
||||
Merge3HighlightOriginal,
|
||||
Merge3HighlightMine,
|
||||
Merge3HighlightTheirs
|
||||
DialogMainButtonText
|
||||
}
|
||||
|
||||
public enum StudioStyleGuideModifier
|
||||
@ -1932,7 +1979,8 @@ namespace RobloxFiles.Enums
|
||||
Legacy,
|
||||
Voxel,
|
||||
Compatibility,
|
||||
ShadowMap
|
||||
ShadowMap,
|
||||
Future
|
||||
}
|
||||
|
||||
public enum TeleportResult
|
||||
|
BIN
LibTest/Binary.rbxl
Normal file
BIN
LibTest/Binary.rbxl
Normal file
Binary file not shown.
18
LibTest/Program.cs
Normal file
18
LibTest/Program.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RobloxFiles
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
RobloxFile bin = RobloxFile.Open(@"LibTest\Binary.rbxl");
|
||||
Debugger.Break();
|
||||
|
||||
RobloxFile xml = RobloxFile.Open(@"LibTest\Xml.rbxlx");
|
||||
Debugger.Break();
|
||||
}
|
||||
}
|
||||
}
|
12249
LibTest/Xml.rbxlx
Normal file
12249
LibTest/Xml.rbxlx
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -18,8 +18,14 @@ function Format.String(value)
|
||||
end
|
||||
|
||||
function Format.Int(value)
|
||||
if value == 2147483647 then
|
||||
return "int.MaxValue"
|
||||
elseif value == -2147483648 then
|
||||
return "int.MinValue"
|
||||
else
|
||||
return string.format("%i", value)
|
||||
end
|
||||
end
|
||||
|
||||
function Format.Number(value)
|
||||
local int = math.floor(value)
|
||||
@ -238,7 +244,7 @@ function Format.ColorSequence(cs)
|
||||
local csKey = cs.Keypoints[1]
|
||||
|
||||
local fmt = "new ColorSequence(%s)"
|
||||
local value = Format.Color3(csKey.Value)
|
||||
local value = tostring(csKey.Value)
|
||||
|
||||
return fmt:format(value)
|
||||
end
|
||||
|
@ -8,6 +8,8 @@ end
|
||||
|
||||
local GuiTextMixIn =
|
||||
{
|
||||
Add = { Transparency = "float" };
|
||||
|
||||
Redirect =
|
||||
{
|
||||
FontSize =
|
||||
@ -18,41 +20,44 @@ local GuiTextMixIn =
|
||||
|
||||
TextColor = UseColor3("TextColor3");
|
||||
TextWrap = "TextWrapped";
|
||||
|
||||
Transparency =
|
||||
{
|
||||
Get = "base.Transparency";
|
||||
|
||||
Set = "base.Transparency = value;\n" ..
|
||||
"TextTransparency = value;";
|
||||
|
||||
Flag = "new";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return
|
||||
{
|
||||
Accoutrement =
|
||||
{
|
||||
Remove =
|
||||
{
|
||||
"AttachmentUp";
|
||||
"AttachmentPos";
|
||||
"AttachmentRight";
|
||||
"AttachmentForward";
|
||||
};
|
||||
};
|
||||
|
||||
AnalyticsService =
|
||||
{
|
||||
Defaults = { ApiKey = "" }
|
||||
};
|
||||
|
||||
Attachment =
|
||||
BallSocketConstraint =
|
||||
{
|
||||
Remove =
|
||||
-- Why does this even exist?
|
||||
Add =
|
||||
{
|
||||
"Axis";
|
||||
"Orientation";
|
||||
"Position";
|
||||
"SecondaryAxis";
|
||||
"WorldAxis";
|
||||
"WorldCFrame";
|
||||
"WorldOrientation";
|
||||
"WorldPosition";
|
||||
"WorldSecondaryAxis";
|
||||
MaxFrictionTorque = "float";
|
||||
MaxFrictionTorqueXml = "float";
|
||||
};
|
||||
|
||||
Defaults =
|
||||
{
|
||||
MaxFrictionTorqueXml = 0;
|
||||
};
|
||||
|
||||
Redirect =
|
||||
{
|
||||
MaxFrictionTorque = "MaxFrictionTorqueXml";
|
||||
}
|
||||
};
|
||||
|
||||
BasePart =
|
||||
@ -84,6 +89,11 @@ return
|
||||
}
|
||||
};
|
||||
|
||||
BaseScript =
|
||||
{
|
||||
Remove = {"LinkedSource"};
|
||||
};
|
||||
|
||||
BevelMesh =
|
||||
{
|
||||
Add =
|
||||
@ -137,11 +147,22 @@ return
|
||||
Redirect = { cframe = "CFrame" };
|
||||
};
|
||||
|
||||
Bone =
|
||||
{
|
||||
Remove = {"Transform"}
|
||||
};
|
||||
|
||||
Camera =
|
||||
{
|
||||
Redirect = { CoordinateFrame = "CFrame" }
|
||||
};
|
||||
|
||||
CustomEvent =
|
||||
{
|
||||
Add = { PersistedCurrentValue = "float"; };
|
||||
Defaults = { PersistedCurrentValue = 0; };
|
||||
};
|
||||
|
||||
DataModelMesh =
|
||||
{
|
||||
Add =
|
||||
@ -173,7 +194,14 @@ return
|
||||
|
||||
DoubleConstrainedValue =
|
||||
{
|
||||
Redirect = { ConstrainedValue = "Value" }
|
||||
Add = { value = "double" };
|
||||
Defaults = { value = 0.0 };
|
||||
|
||||
Redirect =
|
||||
{
|
||||
Value = "value";
|
||||
ConstrainedValue = "value";
|
||||
}
|
||||
};
|
||||
|
||||
Fire =
|
||||
@ -215,6 +243,12 @@ return
|
||||
};
|
||||
};
|
||||
|
||||
FunctionalTest =
|
||||
{
|
||||
Add = { HasMigratedSettingsToTestService = "bool"; };
|
||||
Defaults = { HasMigratedSettingsToTestService = false; };
|
||||
};
|
||||
|
||||
GuiBase2d =
|
||||
{
|
||||
Redirect = { Localize = "AutoLocalize" }
|
||||
@ -293,7 +327,14 @@ return
|
||||
|
||||
IntConstrainedValue =
|
||||
{
|
||||
Redirect = { ConstrainedValue = "Value" }
|
||||
Add = { value = "int64" };
|
||||
Defaults = { value = 0; };
|
||||
|
||||
Redirect =
|
||||
{
|
||||
Value = "value";
|
||||
ConstrainedValue = "value";
|
||||
}
|
||||
};
|
||||
|
||||
JointInstance =
|
||||
@ -311,30 +352,8 @@ return
|
||||
|
||||
Defaults =
|
||||
{
|
||||
LegacyOutlines = false;
|
||||
Technology = Enum.Technology.Compatibility;
|
||||
};
|
||||
|
||||
Redirect =
|
||||
{
|
||||
Outlines = "LegacyOutlines";
|
||||
};
|
||||
|
||||
Remove =
|
||||
{
|
||||
"ClockTime";
|
||||
};
|
||||
};
|
||||
|
||||
LocalizationService =
|
||||
{
|
||||
Remove =
|
||||
{
|
||||
"ForcePlayModeGameLocaleId";
|
||||
"ForcePlayModeRobloxLocaleId";
|
||||
"RobloxForcePlayModeGameLocaleId";
|
||||
"RobloxForcePlayModeRobloxLocaleId";
|
||||
}
|
||||
};
|
||||
|
||||
LocalizationTable =
|
||||
@ -409,18 +428,10 @@ return
|
||||
}
|
||||
};
|
||||
|
||||
NotificationService =
|
||||
{
|
||||
Remove = {"SelectedTheme"}
|
||||
};
|
||||
|
||||
PackageLink =
|
||||
{
|
||||
Add =
|
||||
{
|
||||
OriginalHash = "int64";
|
||||
SymbolicLink = "string";
|
||||
|
||||
VersionIdSerialize = "int64";
|
||||
PackageIdSerialize = "Content";
|
||||
};
|
||||
@ -429,17 +440,9 @@ return
|
||||
{
|
||||
AutoUpdate = false;
|
||||
|
||||
OriginalHash = 0;
|
||||
SymbolicLink = "";
|
||||
|
||||
VersionIdSerialize = 0;
|
||||
PackageIdSerialize = "";
|
||||
};
|
||||
|
||||
Redirect =
|
||||
{
|
||||
VersionNumber = "VersionIdSerialize";
|
||||
};
|
||||
};
|
||||
|
||||
Part =
|
||||
@ -503,20 +506,6 @@ return
|
||||
}
|
||||
};
|
||||
|
||||
RenderingTest =
|
||||
{
|
||||
Remove =
|
||||
{
|
||||
"Position";
|
||||
"Orientation";
|
||||
};
|
||||
};
|
||||
|
||||
ScriptContext =
|
||||
{
|
||||
Remove = { "ScriptsDisabled" }
|
||||
};
|
||||
|
||||
SelectionBox =
|
||||
{
|
||||
Redirect = { SurfaceColor = UseColor3("SurfaceColor3") }
|
||||
@ -583,8 +572,8 @@ return
|
||||
|
||||
Redirect =
|
||||
{
|
||||
EmitterSize = "xmlRead_MinDistance_3";
|
||||
MaxDistance = "xmlRead_MaxDistance_3";
|
||||
xmlRead_MinDistance_3 = "EmitterSize";
|
||||
|
||||
MinDistance = "EmitterSize";
|
||||
Pitch = "PlaybackSpeed";
|
||||
@ -598,13 +587,29 @@ return
|
||||
|
||||
StudioData =
|
||||
{
|
||||
Add =
|
||||
{
|
||||
CommitInflightAuthorId = "int64";
|
||||
CommitInflightGuid = "string";
|
||||
CommitInflightPlaceVersion = "int";
|
||||
};
|
||||
|
||||
Defaults =
|
||||
{
|
||||
CommitInflightAuthorId = 0;
|
||||
CommitInflightGuid = "";
|
||||
CommitInflightPlaceVersion = 0;
|
||||
|
||||
SrcPlaceId = 0;
|
||||
SrcUniverseId = 0;
|
||||
};
|
||||
};
|
||||
|
||||
SurfaceAppearance =
|
||||
{
|
||||
Defaults = { AlphaMode = Enum.AlphaMode.Overlay }
|
||||
};
|
||||
|
||||
TextBox = GuiTextMixIn;
|
||||
TextLabel = GuiTextMixIn;
|
||||
TextButton = GuiTextMixIn;
|
||||
@ -656,17 +661,6 @@ return
|
||||
};
|
||||
};
|
||||
|
||||
Tool =
|
||||
{
|
||||
Remove =
|
||||
{
|
||||
"GripForward";
|
||||
"GripPos";
|
||||
"GripRight";
|
||||
"GripUp";
|
||||
};
|
||||
};
|
||||
|
||||
TriangleMeshPart =
|
||||
{
|
||||
Add =
|
||||
@ -705,8 +699,6 @@ return
|
||||
CameraCFrame = CFrame.new();
|
||||
CameraFieldOfView = 70;
|
||||
};
|
||||
|
||||
Remove = {"CurrentCamera"};
|
||||
};
|
||||
|
||||
WeldConstraint =
|
||||
@ -748,6 +740,7 @@ return
|
||||
StreamingPauseMode = "Enum:StreamingPauseMode";
|
||||
|
||||
TerrainWeldsFixed = "bool";
|
||||
TemporaryLegacyPhysicsSolverOverrideStreaming = "bool";
|
||||
};
|
||||
|
||||
Defaults =
|
||||
@ -760,6 +753,7 @@ return
|
||||
StreamingPauseMode = Enum.StreamingPauseMode.Default;
|
||||
|
||||
TerrainWeldsFixed = true;
|
||||
TemporaryLegacyPhysicsSolverOverrideStreaming = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -324,6 +324,9 @@ local function generateClasses()
|
||||
writeLine("using RobloxFiles.Utility;")
|
||||
writeLine()
|
||||
|
||||
writeLine("#pragma warning disable IDE1006 // Suppress warnings about camelCase.")
|
||||
writeLine()
|
||||
|
||||
writeLine("namespace RobloxFiles")
|
||||
openStack()
|
||||
|
||||
@ -401,28 +404,23 @@ local function generateClasses()
|
||||
|
||||
writeLine("IsService = true;")
|
||||
closeStack()
|
||||
|
||||
for i, propName in ipairs(propNames) do
|
||||
local prop = propMap[propName]
|
||||
local serial = prop.Serialization
|
||||
|
||||
if serial.CanLoad then
|
||||
writeLine()
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i, propName in ipairs(propNames) do
|
||||
local prop = propMap[propName]
|
||||
local propTags = getTags(prop)
|
||||
|
||||
local serial = prop.Serialization
|
||||
local valueType = prop.ValueType.Name
|
||||
|
||||
if serial.CanLoad then
|
||||
local propTags = getTags(prop)
|
||||
|
||||
local redirect = redirectProps[propName]
|
||||
local couldSave = (serial.CanSave or propTags.Deprecated or redirect)
|
||||
|
||||
if serial.CanLoad and couldSave then
|
||||
if firstLine and classTags.Service then
|
||||
writeLine()
|
||||
end
|
||||
|
||||
local name = propName
|
||||
local default = ""
|
||||
|
||||
@ -446,14 +444,19 @@ local function generateClasses()
|
||||
end
|
||||
|
||||
if redirect then
|
||||
local get, set
|
||||
local get, set, flag
|
||||
|
||||
if typeof(redirect) == "string" then
|
||||
get = redirect
|
||||
set = redirect .. " = value"
|
||||
|
||||
if redirect == "value" then
|
||||
set = "this." .. set
|
||||
end
|
||||
else
|
||||
get = redirect.Get
|
||||
set = redirect.Set
|
||||
flag = redirect.Flag
|
||||
end
|
||||
|
||||
if not firstLine and set then
|
||||
@ -465,11 +468,30 @@ local function generateClasses()
|
||||
end
|
||||
|
||||
if set then
|
||||
if flag then
|
||||
writeLine("public %s %s %s", flag, valueType, name)
|
||||
else
|
||||
writeLine("public %s %s", valueType, name)
|
||||
end
|
||||
|
||||
openStack()
|
||||
writeLine("get { return %s; }", get)
|
||||
|
||||
if set:find('\n') then
|
||||
writeLine()
|
||||
|
||||
writeLine("set")
|
||||
openStack()
|
||||
|
||||
for line in set:gmatch("[^\r\n]+") do
|
||||
writeLine(line)
|
||||
end
|
||||
|
||||
closeStack()
|
||||
else
|
||||
writeLine("set { %s; }", set)
|
||||
end
|
||||
|
||||
closeStack()
|
||||
else
|
||||
writeLine("public %s %s => %s;", valueType, name, get)
|
||||
@ -512,13 +534,8 @@ local function generateClasses()
|
||||
result = formatFunc(value)
|
||||
end
|
||||
|
||||
if not serial.CanSave and not propTags.Deprecated then
|
||||
comment = " // [Load-only]"
|
||||
else
|
||||
comment = ""
|
||||
end
|
||||
|
||||
default = " = " .. result
|
||||
comment = ""
|
||||
end
|
||||
|
||||
if propTags.Deprecated then
|
||||
|
@ -87,6 +87,7 @@
|
||||
<Compile Include="Interfaces\IBinaryFileChunk.cs" />
|
||||
<Compile Include="Generated\Classes.cs" />
|
||||
<Compile Include="Generated\Enums.cs" />
|
||||
<Compile Include="LibTest\Program.cs" />
|
||||
<Compile Include="Tree\Attributes.cs" />
|
||||
<Compile Include="Tree\Property.cs" />
|
||||
<Compile Include="Tree\Instance.cs" />
|
||||
@ -114,6 +115,7 @@
|
||||
<Compile Include="DataTypes\Vector3.cs" />
|
||||
<Compile Include="Utility\Formatting.cs" />
|
||||
<Compile Include="Utility\FontUtility.cs" />
|
||||
<Compile Include="Utility\ImplicitMember.cs" />
|
||||
<Compile Include="Utility\MaterialInfo.cs" />
|
||||
<Compile Include="DataTypes\Quaternion.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -164,6 +166,12 @@
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="LibTest\Binary.rbxl">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="LibTest\Xml.rbxlx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29920.165
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RobloxFileFormat", "RobloxFileFormat.csproj", "{CF50C0E2-23A7-4DC1-B4B2-E60CDE716253}"
|
||||
EndProject
|
||||
@ -19,4 +19,7 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C024FBF2-2DCC-4AFD-B6D9-68E1AD3CF00A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -1,11 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
using RobloxFiles.BinaryFormat;
|
||||
using RobloxFiles.BinaryFormat.Chunks;
|
||||
|
||||
using RobloxFiles.DataTypes;
|
||||
using RobloxFiles.Utility;
|
||||
|
||||
namespace RobloxFiles
|
||||
{
|
||||
@ -55,8 +58,9 @@ namespace RobloxFiles
|
||||
internal BinaryRobloxFileWriter CurrentWriter;
|
||||
|
||||
internal static BindingFlags BindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase;
|
||||
internal static MemberTypes FieldOrProperty = MemberTypes.Field | MemberTypes.Property;
|
||||
|
||||
public static IReadOnlyDictionary<Type, PropertyType> Types = new Dictionary<Type, PropertyType>()
|
||||
public static readonly IReadOnlyDictionary<Type, PropertyType> Types = new Dictionary<Type, PropertyType>()
|
||||
{
|
||||
{ typeof(Axes), PropertyType.Axes },
|
||||
{ typeof(Faces), PropertyType.Faces },
|
||||
@ -78,17 +82,17 @@ namespace RobloxFiles
|
||||
{ typeof(Vector2), PropertyType.Vector2 },
|
||||
{ typeof(Vector3), PropertyType.Vector3 },
|
||||
|
||||
|
||||
{ typeof(BrickColor), PropertyType.BrickColor },
|
||||
{ typeof(Quaternion), PropertyType.Quaternion },
|
||||
{ typeof(Color3uint8), PropertyType.Color3uint8 },
|
||||
{ typeof(NumberRange), PropertyType.NumberRange },
|
||||
{ typeof(SharedString), PropertyType.SharedString },
|
||||
{ typeof(Vector3int16), PropertyType.Vector3int16 },
|
||||
|
||||
{ typeof(ColorSequence), PropertyType.ColorSequence },
|
||||
{ typeof(NumberSequence), PropertyType.NumberSequence },
|
||||
{ typeof(ProtectedString), PropertyType.String },
|
||||
|
||||
{ typeof(ProtectedString), PropertyType.String },
|
||||
{ typeof(PhysicalProperties), PropertyType.PhysicalProperties },
|
||||
};
|
||||
|
||||
@ -166,24 +170,19 @@ namespace RobloxFiles
|
||||
byte[] data = Instance.SerializedTags;
|
||||
RawValue = data;
|
||||
}
|
||||
else if (Name == "AttributesSerialize")
|
||||
{
|
||||
byte[] data = Instance.AttributesSerialize;
|
||||
RawValue = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
FieldInfo field = Instance.GetType()
|
||||
.GetField(ImplicitName, BindingFlags);
|
||||
var type = Instance.GetType();
|
||||
var member = ImplicitMember.Get(type, ImplicitName);
|
||||
|
||||
if (field != null)
|
||||
if (member != null)
|
||||
{
|
||||
object value = field.GetValue(Instance);
|
||||
object value = member.GetValue(Instance);
|
||||
RawValue = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"RobloxFiles.Property - No defined field for {Instance.ClassName}.{Name}");
|
||||
Console.Error.WriteLine($"RobloxFiles.Property - No defined member for {Instance.ClassName}.{Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -199,49 +198,41 @@ namespace RobloxFiles
|
||||
byte[] data = value as byte[];
|
||||
Instance.SerializedTags = data;
|
||||
}
|
||||
else if (Name == "AttributesSerialize" && value is byte[])
|
||||
{
|
||||
byte[] data = value as byte[];
|
||||
Instance.AttributesSerialize = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
FieldInfo field = Instance.GetType()
|
||||
.GetField(ImplicitName, BindingFlags);
|
||||
var type = Instance.GetType();
|
||||
var member = ImplicitMember.Get(type, ImplicitName);
|
||||
|
||||
if (field != null)
|
||||
if (member != null)
|
||||
{
|
||||
Type fieldType = field.FieldType;
|
||||
Type valueType = value?.GetType();
|
||||
var valueType = value?.GetType();
|
||||
Type memberType = member.MemberType;
|
||||
|
||||
if (fieldType == valueType || value == null)
|
||||
if (memberType == valueType || value == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
field.SetValue(Instance, value);
|
||||
member.SetValue(Instance, value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine($"RobloxFiles.Property - Failed to cast value {value} into property {Instance.ClassName}.{Name}");
|
||||
Console.Error.WriteLine($"RobloxFiles.Property - Failed to cast value {value} into property {Instance.ClassName}.{Name}");
|
||||
}
|
||||
}
|
||||
else if (valueType != null)
|
||||
{
|
||||
var typeWrapper = new Type[] { valueType };
|
||||
MethodInfo implicitCast = fieldType.GetMethod("op_Implicit", typeWrapper);
|
||||
MethodInfo implicitCast = memberType.GetMethod("op_Implicit", new Type[] { valueType });
|
||||
|
||||
if (implicitCast != null)
|
||||
{
|
||||
var valueWrapper = new object[] { value };
|
||||
|
||||
try
|
||||
{
|
||||
object castedValue = implicitCast.Invoke(null, valueWrapper);
|
||||
field.SetValue(Instance, castedValue);
|
||||
object castedValue = implicitCast.Invoke(null, new object[] { value });
|
||||
member.SetValue(Instance, castedValue);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine($"RobloxFiles.Property - Failed to implicitly cast value {value} into property {Instance.ClassName}.{Name}");
|
||||
Console.Error.WriteLine($"RobloxFiles.Property - Failed to implicitly cast value {value} into property {Instance.ClassName}.{Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
79
Utility/ImplicitMember.cs
Normal file
79
Utility/ImplicitMember.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace RobloxFiles.Utility
|
||||
{
|
||||
// This is a lazy helper class to disambiguate between FieldInfo and PropertyInfo
|
||||
internal class ImplicitMember
|
||||
{
|
||||
private static BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase;
|
||||
private object member;
|
||||
|
||||
private ImplicitMember(FieldInfo field) { member = field; }
|
||||
private ImplicitMember(PropertyInfo prop) { member = prop; }
|
||||
|
||||
public static ImplicitMember Get(Type type, string name)
|
||||
{
|
||||
var field = type.GetField(name, flags);
|
||||
var prop = type.GetProperty(name, flags);
|
||||
|
||||
if (field != null)
|
||||
return new ImplicitMember(field);
|
||||
else if (prop != null)
|
||||
return new ImplicitMember(prop);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Type MemberType
|
||||
{
|
||||
get
|
||||
{
|
||||
Type result = null;
|
||||
|
||||
if (member is FieldInfo)
|
||||
{
|
||||
var field = member as FieldInfo;
|
||||
result = field.FieldType;
|
||||
}
|
||||
else if (member is PropertyInfo)
|
||||
{
|
||||
var prop = member as PropertyInfo;
|
||||
result = prop.PropertyType;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public object GetValue(object obj)
|
||||
{
|
||||
if (member is FieldInfo)
|
||||
{
|
||||
var field = member as FieldInfo;
|
||||
return field.GetValue(obj);
|
||||
}
|
||||
else if (member is PropertyInfo)
|
||||
{
|
||||
var prop = member as PropertyInfo;
|
||||
return prop.GetValue(obj);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SetValue(object obj, object value)
|
||||
{
|
||||
if (member is FieldInfo)
|
||||
{
|
||||
var field = member as FieldInfo;
|
||||
field.SetValue(obj, value);
|
||||
}
|
||||
else if (member is PropertyInfo)
|
||||
{
|
||||
var prop = member as PropertyInfo;
|
||||
prop.SetValue(obj, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user