Add Use2022MaterialsXml

This commit is contained in:
Max 2022-05-06 15:19:57 -05:00
parent b5e471a2bf
commit b0544d11f9
3 changed files with 57 additions and 8 deletions

View File

@ -2387,6 +2387,14 @@ namespace RobloxFiles
public MaterialVariant TerrainSlate; public MaterialVariant TerrainSlate;
public MaterialVariant TerrainSnow; public MaterialVariant TerrainSnow;
public MaterialVariant TerrainWoodPlanks; public MaterialVariant TerrainWoodPlanks;
public bool Use2022Materials
{
get => Use2022MaterialsXml;
set => Use2022MaterialsXml = value;
}
public bool Use2022MaterialsXml;
public MaterialVariant Wood; public MaterialVariant Wood;
public string WoodName = "Wood"; public string WoodName = "Wood";
public MaterialVariant WoodPlanks; public MaterialVariant WoodPlanks;

Binary file not shown.

View File

@ -1,6 +1,7 @@
--!strict
local HttpService = game:GetService("HttpService") local HttpService = game:GetService("HttpService")
local function UseColor3(propName) local function UseColor3(propName: string)
return return
{ {
Get = string.format("BrickColor.FromColor3(%s)", propName); Get = string.format("BrickColor.FromColor3(%s)", propName);
@ -8,30 +9,34 @@ local function UseColor3(propName)
} }
end end
local function TryDefineEnum(enumName) local function TryDefineEnum(enumName: string): string?
local gotEnum, enum = pcall(function () local gotEnum, enum = pcall(function ()
return Enum[enumName] return (Enum :: any)[enumName] :: Enum
end) end)
if gotEnum then if gotEnum then
return "Enum:" .. tostring(enum) return "Enum:" .. tostring(enum)
end end
return nil
end end
local function TryGetEnumItem(enumName, itemName) local function TryGetEnumItem(enumName, itemName): EnumItem?
local gotEnum, enum = pcall(function () local gotEnum, enum = pcall(function ()
return Enum[enumName] return (Enum :: any)[enumName] :: Enum
end) end)
if gotEnum then if gotEnum then
local gotEnumItem, item = pcall(function () local gotEnumItem, item = pcall(function ()
return enum[itemName] return (enum :: any)[itemName] :: EnumItem
end) end)
if gotEnumItem then if gotEnumItem then
return item return item
end end
end end
return nil
end end
local GuiTextMixIn = local GuiTextMixIn =
@ -61,7 +66,9 @@ local GuiTextMixIn =
}; };
} }
return ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local PropertyPatches =
{ {
AnimationRigData = AnimationRigData =
{ {
@ -411,6 +418,14 @@ return
MaterialService = MaterialService =
{ {
Add =
{
Use2022Materials = "bool";
Use2022MaterialsXml = "bool"
};
Redirect = { Use2022Materials = "Use2022MaterialsXml" };
Defaults = Defaults =
{ {
AsphaltName = "Asphalt"; AsphaltName = "Asphalt";
@ -877,4 +892,30 @@ return
MeshPartHeadsAndAccessories = TryGetEnumItem("MeshPartHeadsAndAccessories", "Default"); MeshPartHeadsAndAccessories = TryGetEnumItem("MeshPartHeadsAndAccessories", "Default");
} }
} }
} }
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------