function methods.CreateFadeFunctions(Z,s)local e={}for s,Z in pairs(s)do e[s]={}for Z,W in pairs(Z)do e[s][Z]={Target=W.FadedIn,Current=s[Z];NormalizedExptValue=1}end end local function W(Z,W)for e,X in pairs(e)do for X,P in pairs(X)do P.Target=s[e][X].FadedIn P.NormalizedExptValue=W:NormalizedDefaultExptValueInSeconds(Z)end end end local function X(Z,W)for e,X in pairs(e)do for X,P in pairs(X)do P.Target=s[e][X].FadedOut P.NormalizedExptValue=W:NormalizedDefaultExptValueInSeconds(Z)end end end local function P()for s,Z in pairs(e)do for Z,e in pairs(Z)do s[Z]=e.Current end end end local function c(s,Z)for e,W in pairs(e)do for e,W in pairs(W)do W.Current=Z:Expt(W.Current,W.Target,W.NormalizedExptValue,s)end end P()end return W,X,c end function methods.NewBindableEvent(Z,s)local e=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")e.Name=s return e end function module.new()local s=setmetatable({},methods)s.ObjectPool=nil s.ChatWindow=nil s.DEFAULT_MESSAGE_CREATOR=DEFAULT_MESSAGE_CREATOR s.MESSAGE_CREATOR_MODULES_VERSION=MESSAGE_CREATOR_MODULES_VERSION s.KEY_MESSAGE_TYPE=KEY_MESSAGE_TYPE s.KEY_CREATOR_FUNCTION=KEY_CREATOR_FUNCTION s.KEY_BASE_FRAME=KEY_BASE_FRAME s.KEY_BASE_MESSAGE=KEY_BASE_MESSAGE s.KEY_UPDATE_TEXT_FUNC=KEY_UPDATE_TEXT_FUNC s.KEY_GET_HEIGHT=KEY_GET_HEIGHT s.KEY_FADE_IN=KEY_FADE_IN s.KEY_FADE_OUT=KEY_FADE_OUT s.KEY_UPDATE_ANIMATION=KEY_UPDATE_ANIMATION return s end return module.new()
-- CreateFadeFunctions usage:
-- fadeObjects is a map of text labels and button to start and end values for a given property.
-- e.g {
--   NameButton = {
--     TextTransparency = {
--       FadedIn = 0.5,
--       FadedOut = 1,
--     }
--   },
--  ImageOne = {
--	  ImageTransparency = {
--       FadedIn = 0,
--       FadedOut = 0.5,
--     }
--   }
-- }
function methods:CreateFadeFunctions(fadeObjects)
	local AnimParams = {}
	for object, properties in pairs(fadeObjects) do
		AnimParams[object] = {}
		for property, values in pairs(properties) do
			AnimParams[object][property] = {
				Target = values.FadedIn,
				Current = object[property],
				NormalizedExptValue = 1,
			}
		end
	end

	local function FadeInFunction(duration, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Target = fadeObjects[object][property].FadedIn
				values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
			end
		end
	end

	local function FadeOutFunction(duration, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Target = fadeObjects[object][property].FadedOut
				values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
			end
		end
	end

	local function AnimGuiObjects()
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				object[property] = values.Current
			end
		end
	end

	local function UpdateAnimFunction(dtScale, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Current = CurveUtil:Expt(values.Current, values.Target, values.NormalizedExptValue, dtScale)
			end
		end

		AnimGuiObjects()
	end

	return FadeInFunction, FadeOutFunction, UpdateAnimFunction
end

function methods:NewBindableEvent(name)
	local bindable = Instance.new("BindableEvent")
	bindable.Name = name
	return bindable
end

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

	obj.ObjectPool = nil
	obj.ChatWindow = nil

	obj.DEFAULT_MESSAGE_CREATOR = DEFAULT_MESSAGE_CREATOR
	obj.MESSAGE_CREATOR_MODULES_VERSION = MESSAGE_CREATOR_MODULES_VERSION

	obj.KEY_MESSAGE_TYPE = KEY_MESSAGE_TYPE
	obj.KEY_CREATOR_FUNCTION = KEY_CREATOR_FUNCTION

	obj.KEY_BASE_FRAME = KEY_BASE_FRAME
	obj.KEY_BASE_MESSAGE = KEY_BASE_MESSAGE
	obj.KEY_UPDATE_TEXT_FUNC = KEY_UPDATE_TEXT_FUNC
	obj.KEY_GET_HEIGHT = KEY_GET_HEIGHT
	obj.KEY_FADE_IN = KEY_FADE_IN
	obj.KEY_FADE_OUT = KEY_FADE_OUT
	obj.KEY_UPDATE_ANIMATION = KEY_UPDATE_ANIMATION

	return obj
end

return module.new()
