local d=script.Parent.Parent local D=require(d:WaitForChild("\067\104\097\116\083\101\116\116\105\110\103\115"))local P=require(d:WaitForChild("\067\104\097\116\067\111\110\115\116\097\110\116\115"))local q=require(script.Parent:WaitForChild("\085\116\105\108"))function CreateSetCoreMessageLabel(d,P)local B=d.Message local y=d.ExtraData or{}local b=y.Font or D.DefaultFont local R=y.TextSize or D.ChatWindowTextSize local m=y.Color or D.DefaultMessageColor local l,S=q:CreateBaseMessage(B,b,R,m)local function r(d)return q:GetMessageHeight(S,l,d)end local h={}h[S]={TextTransparency={FadedIn=0;FadedOut=1};TextStrokeTransparency={FadedIn=.75,FadedOut=1}}local E,W,s=q:CreateFadeFunctions(h)return{[q.KEY_BASE_FRAME]=l,[q.KEY_BASE_MESSAGE]=S,[q.KEY_UPDATE_TEXT_FUNC]=nil,[q.KEY_GET_HEIGHT]=r,[q.KEY_FADE_IN]=E,[q.KEY_FADE_OUT]=W;[q.KEY_UPDATE_ANIMATION]=s}end return{[q.KEY_MESSAGE_TYPE]=P.MessageTypeSetCore,[q.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
}
