local M=script.Parent.Parent local D=require(M:WaitForChild("\067\104\097\116\083\101\116\116\105\110\103\115"))local K=require(M:WaitForChild("\067\104\097\116\067\111\110\115\116\097\110\116\115"))local W=require(script.Parent:WaitForChild("\085\116\105\108"))function CreateSetCoreMessageLabel(M,K)local f=M.Message local P=M.ExtraData or{}local p=P.Font or D.DefaultFont local w=P.TextSize or D.ChatWindowTextSize local j=P.Color or D.DefaultMessageColor local x,A=W:CreateBaseMessage(f,p,w,j)local function e(M)return W:GetMessageHeight(A,x,M)end local l={}l[A]={TextTransparency={FadedIn=0;FadedOut=1},TextStrokeTransparency={FadedIn=.75,FadedOut=1}}local R,g,d=W:CreateFadeFunctions(l)return{[W.KEY_BASE_FRAME]=x,[W.KEY_BASE_MESSAGE]=A;[W.KEY_UPDATE_TEXT_FUNC]=nil;[W.KEY_GET_HEIGHT]=e,[W.KEY_FADE_IN]=R;[W.KEY_FADE_OUT]=g,[W.KEY_UPDATE_ANIMATION]=d}end return{[W.KEY_MESSAGE_TYPE]=K.MessageTypeSetCore;[W.KEY_CREATOR_FUNCTION]=CreateSetCoreMessageLabel}
--!nonstrict
--	// FileName: SetCoreMessage.lua
--	// Written by: TheGamer101
--	// Description: Create a message label for a message created with SetCore(ChatMakeSystemMessage).

local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local util = require(script.Parent:WaitForChild("Util"))

function CreateSetCoreMessageLabel(messageData, channelName)
	local message = messageData.Message
	local extraData = messageData.ExtraData or {}
	local useFont = extraData.Font or ChatSettings.DefaultFont
	local useTextSize = extraData.TextSize or ChatSettings.ChatWindowTextSize
	local useColor = extraData.Color or ChatSettings.DefaultMessageColor

	local BaseFrame, BaseMessage = util:CreateBaseMessage(message, useFont, useTextSize, useColor)

	local function GetHeightFunction(xSize)
		return util:GetMessageHeight(BaseMessage, BaseFrame, xSize)
	end

	local FadeParmaters = {}
	FadeParmaters[BaseMessage] = {
		TextTransparency = {FadedIn = 0, FadedOut = 1},
		TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
	}

	local FadeInFunction, FadeOutFunction, UpdateAnimFunction = util:CreateFadeFunctions(FadeParmaters)

	return {
		[util.KEY_BASE_FRAME] = BaseFrame,
		[util.KEY_BASE_MESSAGE] = BaseMessage,
		[util.KEY_UPDATE_TEXT_FUNC] = nil,
		[util.KEY_GET_HEIGHT] = GetHeightFunction,
		[util.KEY_FADE_IN] = FadeInFunction,
		[util.KEY_FADE_OUT] = FadeOutFunction,
		[util.KEY_UPDATE_ANIMATION] = UpdateAnimFunction
	}
end

return {
	[util.KEY_MESSAGE_TYPE] = ChatConstants.MessageTypeSetCore,
	[util.KEY_CREATOR_FUNCTION] = CreateSetCoreMessageLabel
}
