function module.new()local c=setmetatable({},methods)c.Destroyed=false local E,w,Q=CreateGuiObjects()c.GuiObject=E c.Scroller=w c.Layout=Q c.MessageObjectLog={}c.Name="\077\101\115\115\097\103\101\076\111\103\068\105\115\112\108\097\121"c.GuiObject.Name="\070\114\097\109\101\095"..c.Name c.CurrentChannelName="";(c.GuiObject:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\083\105\122\101")):Connect(function()spawn(function()c:ReorderAllMessages()end)end)local g=true;(c.Layout:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\067\111\110\116\101\110\116\083\105\122\101")):Connect(function()local E=c.Layout.AbsoluteContentSize c.Scroller.CanvasSize=UDim2.new(0,0,0,E.Y)if g then local w=c.Scroller.AbsoluteWindowSize c.Scroller.CanvasPosition=Vector2.new(0,E.Y-w.Y)end end);(c.Scroller:GetPropertyChangedSignal("\067\097\110\118\097\115\080\111\115\105\116\105\111\110")):Connect(function()g=c:IsScrolledDown()end)return c end return module


function module.new()
	local obj = setmetatable({}, methods)
	obj.Destroyed = false

	local BaseFrame, Scroller, Layout = CreateGuiObjects()
	obj.GuiObject = BaseFrame
	obj.Scroller = Scroller
	obj.Layout = Layout

	obj.MessageObjectLog = {}

	obj.Name = "MessageLogDisplay"
	obj.GuiObject.Name = "Frame_" .. obj.Name

	obj.CurrentChannelName = ""

	obj.GuiObject:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
		spawn(function() obj:ReorderAllMessages() end)
	end)

	local wasScrolledDown = true

	obj.Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
		local size = obj.Layout.AbsoluteContentSize
		obj.Scroller.CanvasSize = UDim2.new(0, 0, 0, size.Y)
		if wasScrolledDown then
			local windowSize = obj.Scroller.AbsoluteWindowSize
			obj.Scroller.CanvasPosition = Vector2.new(0, size.Y - windowSize.Y)
		end
	end)

	obj.Scroller:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
		wasScrolledDown = obj:IsScrolledDown()
	end)

	return obj
end

return module
