Roblox-File-Format/Plugins/GenerateApiDump/PropertyPatches.lua

921 lines
16 KiB
Lua
Raw Normal View History

2022-05-06 20:19:57 +00:00
--!strict
2021-03-09 22:56:27 +00:00
local HttpService = game:GetService("HttpService")
2022-05-06 20:19:57 +00:00
local function UseColor3(propName: string)
return
{
2019-12-23 03:23:06 +00:00
Get = string.format("BrickColor.FromColor3(%s)", propName);
2020-08-14 17:35:27 +00:00
Set = propName .. " = value?.Color";
}
end
2022-05-06 20:19:57 +00:00
local function TryDefineEnum(enumName: string): string?
2021-02-18 19:15:08 +00:00
local gotEnum, enum = pcall(function ()
2022-05-06 20:19:57 +00:00
return (Enum :: any)[enumName] :: Enum
2021-02-18 19:15:08 +00:00
end)
if gotEnum then
return "Enum:" .. tostring(enum)
end
2022-05-06 20:19:57 +00:00
return nil
2021-02-18 19:15:08 +00:00
end
2022-05-06 20:19:57 +00:00
local function TryGetEnumItem(enumName, itemName): EnumItem?
2021-02-18 19:15:08 +00:00
local gotEnum, enum = pcall(function ()
2022-05-06 20:19:57 +00:00
return (Enum :: any)[enumName] :: Enum
2021-02-18 19:15:08 +00:00
end)
if gotEnum then
local gotEnumItem, item = pcall(function ()
2022-05-06 20:19:57 +00:00
return (enum :: any)[itemName] :: EnumItem
2021-02-18 19:15:08 +00:00
end)
if gotEnumItem then
return item
end
end
2022-05-06 20:19:57 +00:00
return nil
2021-02-18 19:15:08 +00:00
end
local GuiTextMixIn =
{
Add = { Transparency = "float" };
Redirect =
{
FontSize =
{
Get = "FontUtility.GetFontSize(TextSize)";
Set = "TextSize = FontUtility.GetFontSize(value)";
};
TextColor = UseColor3("TextColor3");
TextWrap = "TextWrapped";
Transparency =
{
Get = "base.Transparency";
Set = "base.Transparency = value;\n" ..
"TextTransparency = value;";
Flag = "new";
}
};
}
2022-05-06 20:19:57 +00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local PropertyPatches =
{
AnimationRigData =
{
Add =
{
label = "BinaryString";
name = "BinaryString";
parent = "BinaryString";
postTransform = "BinaryString";
preTransform = "BinaryString";
transform = "BinaryString";
};
Defaults =
{
label = "AQAAAAEAAAAAAAAA";
name = "AQAAAAEAAAAAAAAA";
parent = "AQAAAAEAAAAAAA==";
postTransform = "AQAAAAEAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAA=";
preTransform = "AQAAAAEAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAA=";
transform = "AQAAAAEAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAAAAAAAAAAAAA=";
}
};
BallSocketConstraint =
{
-- Why does this even exist?
2020-07-06 00:04:20 +00:00
Add = { MaxFrictionTorqueXml = "float" };
};
BasePart =
{
Add =
{
MaterialVariantSerialized = "string";
MaterialVariant = "string";
Color3uint8 = "Color3uint8";
size = "Vector3";
};
Redirect =
{
Position =
{
Get = "CFrame.Position";
Set = "CFrame = new CFrame(value) * CFrame.Rotation";
};
MaterialVariant = "MaterialVariantSerialized";
BrickColor = UseColor3("Color");
Color = "Color3uint8";
Size = "size";
};
Defaults =
{
Color3uint8 = Color3.fromRGB(163, 162, 165);
MaterialVariantSerialized = "";
size = Vector3.new(4, 1.2, 2);
};
};
BaseScript =
{
Remove = {"LinkedSource"};
};
BevelMesh =
{
Add =
{
Bevel = "float";
Bevel_Roundness = "float";
Bulge = "float";
}
};
BinaryStringValue =
{
2020-07-06 00:04:20 +00:00
Add = { Value = "BinaryString" };
};
BodyColors =
{
Redirect =
{
HeadColor = UseColor3("HeadColor3");
LeftArmColor = UseColor3("LeftArmColor3");
RightArmColor = UseColor3("RightArmColor3");
LeftLegColor = UseColor3("LeftLegColor3");
RightLegColor = UseColor3("RightLegColor3");
TorsoColor = UseColor3("TorsoColor3");
}
};
BodyAngularVelocity =
{
Redirect = { angularvelocity = "AngularVelocity" };
};
BodyGyro =
{
Redirect = { cframe = "CFrame" };
};
Camera =
{
Redirect = { CoordinateFrame = "CFrame" }
};
CustomEvent =
{
2020-07-06 00:04:20 +00:00
Add = { PersistedCurrentValue = "float" };
};
DataModelMesh =
{
Add =
{
2021-02-18 19:15:08 +00:00
LODX = TryDefineEnum("LevelOfDetailSetting");
LODY = TryDefineEnum("LevelOfDetailSetting");
};
2021-02-18 19:15:08 +00:00
Defaults =
{
2021-02-18 19:15:08 +00:00
LODX = TryGetEnumItem("LevelOfDetailSetting", "High");
LODY = TryGetEnumItem("LevelOfDetailSetting", "High");
};
};
DataStoreService =
{
Defaults =
{
AutomaticRetry = true;
LegacyNamingScheme = false;
}
};
DoubleConstrainedValue =
{
2020-07-06 00:04:20 +00:00
Add = { value = "double" };
Redirect =
{
Value = "value";
ConstrainedValue = "value";
}
};
Fire =
{
Add =
{
heat_xml = "float";
size_xml = "float";
};
Defaults =
{
heat_xml = 9;
size_xml = 5;
};
Redirect =
{
Heat = "heat_xml";
Size = "size_xml";
};
};
FloatCurve =
{
Add = { ValuesAndTimes = "BinaryString" };
Defaults = { ValuesAndTimes = "AAAAAAEAAAAKAAAAAAAAFkUAAAAA" };
};
FormFactorPart =
{
Add =
{
2021-02-22 17:41:55 +00:00
formFactorRaw = TryDefineEnum("FormFactor");
};
Defaults =
{
2021-02-22 17:41:55 +00:00
formFactorRaw = TryGetEnumItem("FormFactor", "Brick");
};
Redirect =
{
FormFactor = "formFactorRaw";
};
};
FunctionalTest =
{
Add = { HasMigratedSettingsToTestService = "bool"; };
Defaults = { HasMigratedSettingsToTestService = false; };
};
GuiBase2d =
{
Redirect = { Localize = "AutoLocalize" }
};
GuiBase3d =
{
Redirect = { Color = UseColor3("Color3") }
};
GuiObject =
{
Redirect =
{
BackgroundColor = UseColor3("BackgroundColor3");
BorderColor = UseColor3("BorderColor3");
Transparency = "BackgroundTransparency";
}
};
HiddenSurfaceRemovalAsset =
{
Add =
{
HSRData = "BinaryString";
HSRMeshIdData = "BinaryString";
}
};
HttpService =
{
Defaults = { HttpEnabled = false }
};
Humanoid =
{
Add =
{
Health_XML = "float";
InternalHeadScale = "float";
InternalBodyScale = "Vector3";
};
Defaults =
{
Health_XML = 100;
InternalHeadScale = 1;
InternalBodyScale = Vector3.new(1, 1, 1);
};
Redirect =
{
Health = "Health_XML";
};
Remove =
{
"Jump";
"Torso";
"LeftLeg";
"RightLeg";
};
};
HumanoidDescription =
{
Add =
{
EmotesDataInternal = "string";
EquippedEmotesDataInternal = "string";
};
Defaults =
{
AccessoryBlob = "[]";
EmotesDataInternal = "[]";
EquippedEmotesDataInternal = "[]";
}
};
InsertService =
{
Add = { AllowClientInsertModels = "bool" };
Defaults = { AllowClientInsertModels = false };
};
IntConstrainedValue =
{
Add = { value = "int64" };
Redirect =
{
Value = "value";
ConstrainedValue = "value";
}
};
Lighting =
{
Add =
{
2021-02-18 19:15:08 +00:00
Technology = TryDefineEnum("Technology");
};
Defaults =
{
2021-02-18 19:15:08 +00:00
Technology = TryGetEnumItem("Technology", "Compatibility");
};
};
LocalizationTable =
{
Add = { Contents = "string" };
Defaults = { Contents = "[]" };
Redirect =
{
DevelopmentLanguage = "SourceLocaleId";
}
};
2019-12-23 03:23:06 +00:00
LocalScript =
{
Remove =
{
"LinkedSource",
"Source"
}
};
2019-07-04 23:26:53 +00:00
LuaSourceContainer =
{
2019-12-23 03:23:06 +00:00
Add =
{
LinkedSource = "Content";
ScriptGuid = "string";
Source = "ProtectedString";
};
2019-07-04 23:26:53 +00:00
};
MarkerCurve =
{
Add = { ValuesAndTimes = "BinaryString" };
Defaults = { ValuesAndTimes = "AAAAAAEAAAAKAAAAAAAAFkUAAAAA" };
};
MaterialService =
{
2022-05-06 20:19:57 +00:00
Add =
{
Use2022Materials = "bool";
Use2022MaterialsXml = "bool"
};
Redirect = { Use2022Materials = "Use2022MaterialsXml" };
Defaults =
{
AsphaltName = "Asphalt";
BasaltName = "Basalt";
BrickName = "Brick";
CobblestoneName = "Cobblestone";
ConcreteName = "Concrete";
CorrodedMetalName = "CorrodedMetal";
CrackedLavaName = "CrackedLava";
DiamondPlateName = "DiamondPlate";
FabricName = "Fabric";
FoilName = "Foil";
GlacierName = "Glacier";
GraniteName = "Granite";
GrassName = "Grass";
GroundName = "Ground";
IceName = "Ice";
LeafyGrassName = "LeafyGrass";
LimestoneName = "Limestone";
MarbleName = "Marble";
MetalName = "Metal";
MudName = "Mud";
PavementName = "Pavement";
PebbleName = "Pebble";
PlasticName = "Plastic";
RockName = "Rock";
SaltName = "Salt";
SandName = "Sand";
SandstoneName = "Sandstone";
SlateName = "Slate";
SmoothPlasticName = "SmoothPlastic";
SnowName = "Snow";
WoodName = "Wood";
WoodPlanksName = "WoodPlanks";
}
};
MaterialVariant =
{
Add =
{
TexturePack0 = "Content";
TexturePack1 = "Content";
}
};
2019-07-04 23:26:53 +00:00
MeshPart =
{
Redirect = { MeshID = "MeshId" }
};
Model =
{
2020-09-13 01:16:19 +00:00
Add =
2020-08-14 17:35:27 +00:00
{
2020-09-13 01:16:19 +00:00
ModelMeshCFrame = "CFrame";
ModelMeshData = "SharedString";
ModelMeshSize = "Vector3";
2021-05-01 22:40:09 +00:00
NeedsPivotMigration = "bool";
WorldPivotData = "Optional<CFrame>";
2020-08-14 17:35:27 +00:00
};
};
2019-12-23 03:23:06 +00:00
ModuleScript =
{
Remove =
{
"LinkedSource",
"Source"
}
};
PackageLink =
{
Add =
{
VersionIdSerialize = "int64";
PackageIdSerialize = "Content";
};
2020-07-06 00:04:20 +00:00
Defaults = { AutoUpdate = false };
};
Part =
{
2021-02-22 17:41:55 +00:00
Add = { shape = TryDefineEnum("PartType") };
Redirect = { Shape = "shape" };
};
ParticleEmitter =
{
Redirect =
{
VelocitySpread =
{
Get = "SpreadAngle.X";
Set = "SpreadAngle = new Vector2(value, value)";
}
}
};
PartOperation =
{
Add =
{
AssetId = "Content";
2021-02-22 17:41:55 +00:00
ChildData = "BinaryString";
2021-02-22 17:41:55 +00:00
ChildData2 = "SharedString";
MeshData = "BinaryString";
2021-02-22 17:41:55 +00:00
MeshData2 = "SharedString";
FormFactor = TryDefineEnum("FormFactor");
};
2020-07-06 00:04:20 +00:00
Defaults = { FormFactor = Enum.FormFactor.Custom };
};
PartOperationAsset =
{
Add =
{
ChildData = "BinaryString";
MeshData = "BinaryString";
};
};
Players =
{
2020-07-06 00:04:20 +00:00
Defaults = { MaxPlayersInternal = 16 }
};
2021-03-09 22:56:27 +00:00
PolicyService =
{
Add =
{
IsLuobuServer = TryDefineEnum("TriStateBoolean");
LuobuWhitelisted = TryDefineEnum("TriStateBoolean");
};
Defaults =
{
IsLuobuServer = TryGetEnumItem("TriStateBoolean", "Unknown");
LuobuWhitelisted = TryGetEnumItem("TriStateBoolean", "Unknown");
};
};
RotationCurve =
{
Add = { ValuesAndTimes = "BinaryString" };
Defaults = { ValuesAndTimes = "AAAAAAEAAAAKAAAAAAAAFkUAAAAA" };
};
SelectionBox =
{
Redirect = { SurfaceColor = UseColor3("SurfaceColor3") }
};
SelectionSphere =
{
Redirect = { SurfaceColor = UseColor3("SurfaceColor3") }
};
ServerScriptService =
{
Defaults = { LoadStringEnabled = false }
};
2019-12-23 03:23:06 +00:00
Script =
{
Remove =
{
"LinkedSource",
"Source"
}
};
2021-08-09 17:22:26 +00:00
ScriptDebugger =
{
Add =
{
CoreScriptIdentifier = "string";
ScriptGuid = "string";
}
};
Smoke =
{
Add =
{
size_xml = "float";
opacity_xml = "float";
riseVelocity_xml = "float";
};
Defaults =
{
size_xml = 1;
opacity_xml = 0.5;
riseVelocity_xml = 1;
};
Redirect =
{
Size = "size_xml";
Opacity = "opacity_xml";
RiseVelocity = "riseVelocity_xml";
};
};
Sound =
{
Add =
{
MaxDistance = "float"; -- ?!
xmlRead_MaxDistance_3 = "float";
xmlRead_MinDistance_3 = "float";
};
Defaults =
{
xmlRead_MinDistance_3 = 10;
xmlRead_MaxDistance_3 = 10000;
};
Redirect =
{
MaxDistance = "xmlRead_MaxDistance_3";
xmlRead_MinDistance_3 = "EmitterSize";
2021-02-18 19:15:08 +00:00
RollOffMinDistance = "EmitterSize";
MinDistance = "EmitterSize";
Pitch = "PlaybackSpeed";
};
};
Sparkles =
{
Redirect = { Color = "SparkleColor" };
};
2020-07-06 00:04:20 +00:00
StarterPlayer =
{
Add =
{
LoadCharacterLayeredClothing = "Enum:LoadCharacterLayeredClothing";
};
2020-07-06 00:04:20 +00:00
Defaults =
{
GameSettingsAvatar = Enum.GameAvatarType.R15;
GameSettingsR15Collision = Enum.R15CollisionType.OuterBox;
LoadCharacterLayeredClothing = Enum.LoadCharacterLayeredClothing.Default;
2020-07-06 00:04:20 +00:00
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 =
{
CommitInflightGuid = "string";
2020-07-06 00:04:20 +00:00
CommitInflightAuthorId = "int64";
CommitInflightPlaceVersion = "int";
};
};
SurfaceAppearance =
{
Defaults = { AlphaMode = Enum.AlphaMode.Overlay }
};
TextBox = GuiTextMixIn;
TextLabel = GuiTextMixIn;
TextButton = GuiTextMixIn;
Terrain =
{
Add =
{
2021-02-22 17:41:55 +00:00
AcquisitionMethod = TryDefineEnum("TerrainAcquisitionMethod");
ClusterGridV3 = "BinaryString";
PhysicsGrid = "BinaryString";
2020-09-13 01:16:19 +00:00
SmoothGrid = "BinaryString";
};
Defaults =
{
2021-02-18 19:22:15 +00:00
Decoration = false;
SmoothGrid = "AQU=";
PhysicsGrid = "AgMAAAAAAAAAAAAAAAA=";
2021-02-22 17:41:55 +00:00
AcquisitionMethod = TryGetEnumItem("TerrainAcquisitionMethod", "None");
MaterialColors = "AAAAAAAAan8/P39rf2Y/ilY+j35fi21PZmxvZbDqw8faiVpHOi4kHh4lZlw76JxKc3trhHtagcLgc4RKxr21zq2UlJSM";
};
};
TerrainDetail =
{
Add = { TexturePack1 = "Content"; }
};
TerrainRegion =
{
Add =
{
ExtentsMax = "Vector3int16";
ExtentsMin = "Vector3int16";
GridV3 = "BinaryString";
SmoothGrid = "BinaryString";
};
Defaults =
{
ExtentsMax = Vector3int16.new();
ExtentsMin = Vector3int16.new();
GridV3 = "";
SmoothGrid = "AQU=";
};
};
TextChatService =
{
Defaults =
{
CreateDefaultCommands = true;
CreateDefaultTextChannels = true;
}
};
TriangleMeshPart =
{
Add =
{
InitialSize = "Vector3";
LODData = "BinaryString";
PhysicsData = "BinaryString";
PhysicalConfigData = "SharedString";
};
2020-07-06 00:04:20 +00:00
Defaults =
{
InitialSize = Vector3.new(1, 1, 1);
PhysicalConfigData = "1B2M2Y8AsgTpgAmY7PhCfg==";
};
};
TrussPart =
{
2021-02-22 17:41:55 +00:00
Add = { style = TryDefineEnum("Style") };
Redirect = { Style = "style" };
};
2021-02-22 17:41:55 +00:00
UnvalidatedAssetService =
{
Add = { CachedData = "string" };
2021-03-09 22:56:27 +00:00
Defaults =
{
CachedData = HttpService:JSONEncode
{
users = {};
lastSaveTime = 0;
lastKnownPublishRequest = 0;
}
}
};
UserInputService =
{
Add = { LegacyInputEventsEnabled = "bool" };
Defaults = { LegacyInputEventsEnabled = true };
2021-02-22 17:41:55 +00:00
};
ViewportFrame =
{
Add =
{
CameraCFrame = "CFrame";
CameraFieldOfView = "float";
};
Defaults =
{
CameraCFrame = CFrame.new();
CameraFieldOfView = 70;
};
};
WeldConstraint =
{
2020-07-06 00:04:20 +00:00
Add =
{
Part0Internal = "Class:BasePart";
Part1Internal = "Class:BasePart";
2020-10-30 20:07:11 +00:00
2020-09-25 00:38:30 +00:00
EnabledInternal = "bool";
2020-10-30 20:07:11 +00:00
State = "int";
CFrame0 = "CFrame";
CFrame1 = "CFrame";
};
Defaults =
{
CFrame0 = CFrame.new();
CFrame1 = CFrame.new();
2020-10-30 20:07:11 +00:00
2020-09-25 00:38:30 +00:00
EnabledInternal = true;
2020-10-30 20:07:11 +00:00
State = 3;
Part0 = Instance.new("Part");
Part1 = Instance.new("Part");
};
Redirect =
{
Part0 = "Part0Internal";
Part1 = "Part1Internal";
2020-09-25 00:38:30 +00:00
Enabled = "EnabledInternal";
};
};
Workspace =
{
Add =
{
CollisionGroups = "string";
2021-02-18 19:22:15 +00:00
ExplicitAutoJoints = "bool";
2021-02-18 19:22:15 +00:00
TerrainWeldsFixed = "bool";
StreamingMinRadius = "int";
StreamingTargetRadius = "int";
2021-02-18 19:22:15 +00:00
MeshPartHeads = TryDefineEnum("MeshPartHeads");
2021-04-15 23:40:16 +00:00
SignalBehavior = TryDefineEnum("SignalBehavior");
2021-02-18 19:15:08 +00:00
StreamingPauseMode = TryDefineEnum("StreamingPauseMode");
2021-02-18 19:22:15 +00:00
PhysicsSteppingMethod = TryDefineEnum("PhysicsSteppingMethod");
MeshPartHeadsAndAccessories = TryDefineEnum("MeshPartHeadsAndAccessories");
};
Defaults =
{
CollisionGroups = "Default^0^1";
2021-02-18 19:22:15 +00:00
TouchesUseCollisionGroups = false;
ExplicitAutoJoints = true;
2021-02-18 19:22:15 +00:00
TerrainWeldsFixed = true;
StreamingMinRadius = 64;
StreamingTargetRadius = 1024;
2021-02-18 19:22:15 +00:00
2021-02-18 19:15:08 +00:00
MeshPartHeads = TryGetEnumItem("MeshPartHeads", "Default");
2021-04-15 23:40:16 +00:00
SignalBehavior = TryGetEnumItem("SignalBehavior", "Default");
2021-02-18 19:22:15 +00:00
StreamingPauseMode = TryGetEnumItem("StreamingPauseMode", "Default");
PhysicsSteppingMethod = TryGetEnumItem("PhysicsSteppingMethod", "Default");
2021-02-18 19:15:08 +00:00
MeshPartHeadsAndAccessories = TryGetEnumItem("MeshPartHeadsAndAccessories", "Default");
}
}
2022-05-06 20:19:57 +00:00
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------