<commit_before>-----------------------------------------------------
-- <NAME>, Elv
-----------------------------------------------------
local R, L, P = unpack(select(2, ...)) --Import: Engine, Locales, ProfileDB, local
local LSM = LibStub("LibSharedMedia-3.0")

local function Size(frame, width, height)
	frame:SetSize(R:Scale(width), R:Scale(height or width))
end

local function Width(frame, width)
	frame:SetWidth(R:Scale(width))
end

local function Height(frame, height)
	frame:SetHeight(R:Scale(height))
end

local function Point(obj, arg1, arg2, arg3, arg4, arg5)
	-- anyone has a more elegant way for this?
	if type(arg1)=="number" then arg1 = R:Scale(arg1) end
	if type(arg2)=="number" then arg2 = R:Scale(arg2) end
	if type(arg3)=="number" then arg3 = R:Scale(arg3) end
	if type(arg4)=="number" then arg4 = R:Scale(arg4) end
	if type(arg5)=="number" then arg5 = R:Scale(arg5) end

	obj:SetPoint(arg1, arg2, arg3, arg4, arg5)
end

local function CreateShadow(f, t, thickness)
	if f.shadow then return end

	local borderr, borderg, borderb = 0, 0, 0
    local backdropr, backdropg, backdropb, backdropa = unpack(R["media"].backdropcolor)
	local frameLevel = f:GetFrameLevel() > 1 and f:GetFrameLevel() - 1 or 1
	local thickness = thickness or 4
	local offset = thickness - 1

    if t == "Background" then
        backdropr, backdropg, backdropb, backdropa = unpack(R["media"].backdropfadecolor)
    else
        backdropa = 0
    end

	local border = CreateFrame("Frame", nil, f)
	border:SetFrameLevel(frameLevel)
	border:SetOutside(f, 1, 1)
    border:SetTemplate("Border")
	f.border = border

	local shadow = CreateFrame("Frame", nil, border)
	shadow:SetFrameLevel(frameLevel - 1)
	shadow:SetOutside(border, offset, offset)
	shadow:SetBackdrop( { 
		edgeFile = R.global.general.theme == "Shadow" and R["media"].glow or nil,
        bgFile = R["media"].blank, 
		edgeSize = R:Scale(thickness),
        tile = false,
        tileSize = 0,
		insets = {left = R:Scale(thickness), right = R:Scale(thickness), top = R:Scale(thickness), bottom = R:Scale(thickness)},
	})
	shadow:SetBackdropColor( backdropr, backdropg, backdropb, backdropa )
	shadow:SetBackdropBorderColor( borderr, borderg, borderb )
	f.shadow = shadow
end

local function SetTemplate(f, t, glossTex)
	local r, g, b, alpha = unpack(R["media"].backdropcolor)
	if t == "Transparent" then 
		r, g, b, alpha = unpack(R["media"].backdropfadecolor)
	end

    if t == "Border" then
        f:SetBackdrop({
            edgeFile = R["media"].blank, 
            edgeSize = R.mult, 
            tile = false,
            tileSize = 0,
        })
    else
        f:SetBackdrop({
            bgFile = R["media"].blank, 
            edgeFile = R["media"].blank, 
            edgeSize = R.mult, 
            tile = false,
            tileSize = 0,<commit_msg>atlasloot兼容性<commit_after>-----------------------------------------------------
-- Credit Tukz, Elv
-----------------------------------------------------
local R, L, P = unpack(select(2, ...)) --Import: Engine, Locales, ProfileDB, local
local LSM = LibStub("LibSharedMedia-3.0")

local function Size(frame, width, height)
	frame:SetSize(R:Scale(width), R:Scale(height or width))
end

local function Width(frame, width)
	frame:SetWidth(R:Scale(width))
end

local function Height(frame, height)
	frame:SetHeight(R:Scale(height))
end

local function Point(obj, arg1, arg2, arg3, arg4, arg5)
	-- anyone has a more elegant way for this?
	if type(arg1)=="number" then arg1 = R:Scale(arg1) end
	if type(arg2)=="number" then arg2 = R:Scale(arg2) end
	if type(arg3)=="number" then arg3 = R:Scale(arg3) end
	if type(arg4)=="number" then arg4 = R:Scale(arg4) end
	if type(arg5)=="number" then arg5 = R:Scale(arg5) end

	obj:SetPoint(arg1, arg2, arg3, arg4, arg5)
end

local function CreateShadow(f, t, thickness)
	if f.shadow then return end

	local borderr, borderg, borderb = 0, 0, 0
    local backdropr, backdropg, backdropb, backdropa = unpack(R["media"].backdropcolor)
	local frameLevel = f:GetFrameLevel() > 1 and f:GetFrameLevel() - 1 or 1
	local thickness = thickness or 4
	local offset = thickness - 1

    if t == "Background" then
        backdropr, backdropg, backdropb, backdropa = unpack(R["media"].backdropfadecolor)
    else
        backdropa = 0
    end

	local border = CreateFrame("Frame", nil, f)
	border:SetFrameLevel(frameLevel)
	border:SetOutside(f, 1, 1)
    border:SetTemplate("Border")
	f.border = border
	f.border.GetFrameLevel = R.dummy  -- fuck you LibStrataFix

	local shadow = CreateFrame("Frame", nil, border)
	shadow:SetFrameLevel(frameLevel - 1)
	shadow:SetOutside(border, offset, offset)
	shadow:SetBackdrop( { 
		edgeFile = R.global.general.theme == "Shadow" and R["media"].glow or nil,
        bgFile = R["media"].blank, 
		edgeSize = R:Scale(thickness),
        tile = false,
        tileSize = 0,
		insets = {left = R:Scale(thickness), right = R:Scale(thickness), top = R:Scale(thickness), bottom = R:Scale(thickness)},
	})
	shadow:SetBackdropColor( backdropr, backdropg, backdropb, backdropa )
	shadow:SetBackdropBorderColor( borderr, borderg, borderb )
	f.shadow = shadow
	f.shadow.GetFrameLevel = R.dummy  -- fuck you LibStrataFix
end

local function SetTemplate(f, t, glossTex)
	local r, g, b, alpha = unpack(R["media"].backdropcolor)
	if t == "Transparent" then 
		r, g, b, alpha = unpack(R["media"].backdropfadecolor)
	end

    if t == "Border" then
        f:SetBackdrop({
            edgeFile = R["media"].blank, 
            edgeSize = R.mult, 
            tile = false,
            tileSize = 0,
        })
    else
        f:SetBackdrop({
            bgFile = R["media"].blank, 
            edgeFile = R["media"].blank, 
            edgeSize = R.mult, 
            tile = false,
            tileSize = 0,
{'fraction_non_alphanumeric': 0.16556751128080527, 'fraction_numerical': 0.014925373134328358, 'mean_word_length': 3.0357142857142856, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '910736', 'n_tokens_mistral': 2011, 'n_tokens_neox': 1885, 'n_words': 508}