-- << MORPHS >>

function module:CreateMorphs()
	main:GetModule("cf"):ClearPage(pages.morphs)
	
	--Organise morphs
	local morphsList = {}
	local searchText = frame.SearchBar.Frame.TextBox.Text
	for morphName,_ in pairs(main.morphNames) do
		local cName = string.lower(morphName)
		if string.match(cName, searchText) then
			table.insert(morphsList, morphName)
		end
	end
	table.sort(morphsList)
	table.insert(morphsList, 1, main.pdata.Prefix.. "morph <player> <morphName>")
				
	--Create morph labels
	for i,morphName in pairs(morphsList) do
		local label = templateM:Clone()
		if i == 1 then
			label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
			label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
		else
			label.BackgroundColor3 = main:GetModule("cf"):GetLabelBackgroundColor(i)
			label.TextLabel.TextColor3 = Color3.fromRGB(235, 235, 235)
		end
		label.TextLabel.Text = morphName
		label.Name = morphName
		label.Visible = true
		label.Parent = pages.morphs
	end
	
	--Canvas size
	pages.morphs.CanvasSize = UDim2.new(0,0,0,#morphsList*templateM.AbsoluteSize.Y)
end



