diff --git a/Lync/Plugin.rbxm b/Lync/Plugin.rbxm index 205ff28..055c57e 100644 Binary files a/Lync/Plugin.rbxm and b/Lync/Plugin.rbxm differ diff --git a/Lync/RobloxPluginSource/Plugin.lua b/Lync/RobloxPluginSource/Plugin.lua index 111cdac..4f5cd71 100644 --- a/Lync/RobloxPluginSource/Plugin.lua +++ b/Lync/RobloxPluginSource/Plugin.lua @@ -504,11 +504,14 @@ local function setScriptSourceLive(container: LuaSourceContainer, lua: string) end local function buildJsonModel(target: any, data: any) - if data.Children then - for _, childData in data.Children do - local newInstance = Instance.new(childData.ClassName or "Folder") - if childData.Name then - newInstance.Name = childData.Name + data.Properties = data.properties + data.Attributes = data.attributes + data.Tags = data.tags + if data.children then + for _, childData in data.children do + local newInstance = Instance.new(childData.className or "Folder") + if childData.name then + newInstance.Name = childData.name end buildJsonModel(newInstance, childData) newInstance.Parent = target @@ -654,7 +657,7 @@ local function buildPath(path: string) if success then local json = HttpService:JSONDecode(result) if createInstance then - local newInstance = Instance.new(json.ClassName or "Folder") + local newInstance = Instance.new(json.className or "Folder") newInstance.Name = name newInstance.Parent = target target = newInstance diff --git a/Lync/validator/model.js b/Lync/validator/model.js index cd990a8..5187f82 100644 --- a/Lync/validator/model.js +++ b/Lync/validator/model.js @@ -10,37 +10,37 @@ function scan(json, root, localPath) { let failed = false for (const key in json) { - if (key == 'Name') { - if (typeof json.Name != 'string') { - console.error(jsonError(localPath, root, json, 'Name'), yellow('Must be a string')) + if (key == 'name') { + if (typeof json.name != 'string') { + console.error(jsonError(localPath, root, json, 'name'), yellow('Must be a string')) failed = true } - } else if (key == 'ClassName') { - if (typeof json.ClassName != 'string') { - console.error(jsonError(localPath, root, json, 'ClassName'), yellow('Must be a string')) + } else if (key == 'className') { + if (typeof json.className != 'string') { + console.error(jsonError(localPath, root, json, 'className'), yellow('Must be a string')) failed = true } - } else if (key == 'Properties') { - if (!(typeof json.Properties == 'object' && !Array.isArray(json.Properties))) { - console.error(jsonError(localPath, root, json, 'Properties'), yellow('Must be an object')) + } else if (key == 'properties') { + if (!(typeof json.properties == 'object' && !Array.isArray(json.properties))) { + console.error(jsonError(localPath, root, json, 'properties'), yellow('Must be an object')) failed = true } else { - for (const property in json.Properties) { - if (typeof json.Properties[property] == 'object' && Array.isArray(json.Properties[property]) && json.Properties[property].length > 1) { + for (const property in json.properties) { + if (typeof json.properties[property] == 'object' && Array.isArray(json.properties[property]) && json.properties[property].length > 1) { console.error(jsonError(localPath, root, json, property), yellow('Array with size > 1; check property syntax')) failed = true } } } - } else if (key == 'Children') { - if (!(typeof json.Children == 'object' && Array.isArray(json.Children))) { - console.error(jsonError(localPath, root, json, 'Children') , yellow('Must be an array')) + } else if (key == 'children') { + if (!(typeof json.children == 'object' && Array.isArray(json.children))) { + console.error(jsonError(localPath, root, json, 'children') , yellow('Must be an array')) failed = true } else { - for (const child of json.Children) { + for (const child of json.children) { const scanFailed = scan(child, root, localPath) failed = failed || scanFailed } diff --git a/Sample Project/Assets/Workspace/TestModel.model.json b/Sample Project/Assets/Workspace/TestModel.model.json index ca83b35..a675ad7 100644 --- a/Sample Project/Assets/Workspace/TestModel.model.json +++ b/Sample Project/Assets/Workspace/TestModel.model.json @@ -1,19 +1,17 @@ { - "ClassName": "Model", - "Properties": { - "Scale": 2 - }, - "Children": [ + "name": "Money", + "className": "Model", + "children": [ { - "Name": "RootPart", - "ClassName": "Part", - "Properties": { - "Size": ["Vector3.new(2, 2, 2)"] + "className": "Part", + "properties": { + "BrickColor": [ "BrickColor.new(\"Bright green\")" ], + "Size": [ "Vector3.new(1, 0.4, 2)" ] } }, { - "Name": "SendMoney", - "ClassName": "RemoteEvent" + "name": "CollectMoney", + "className": "RemoteEvent" } ] } \ No newline at end of file