local g="\078\101\120\117\115\069\110\117\109\067\111\108\108\101\099\116\105\111\110"local A=(require(script.Parent.Parent.Parent:WaitForChild("\078\101\120\117\115\080\108\117\103\105\110\070\114\097\109\101\119\111\114\107\080\114\111\106\101\099\116"))):GetContext(script)local I=A:GetResource("\068\097\116\097\046\069\110\117\109\046\078\101\120\117\115\069\110\117\109")local O=I:Extend()O:SetClassName(g)A:SetContextResource(O)local Y function O.GetBuiltInEnums()if not Y then Y=O.new()Y:CreateEnum("\078\101\120\117\115\083\099\114\111\108\108\084\104\101\109\101","\078\097\116\105\118\101")Y:CreateEnum("\078\101\120\117\115\083\099\114\111\108\108\084\104\101\109\101","\081\116\053")Y:CreateEnum("\067\104\101\099\107\066\111\120\083\116\097\116\101","\067\104\101\099\107\101\100")Y:CreateEnum("\067\104\101\099\107\066\111\120\083\116\097\116\101","\085\110\099\104\101\099\107\101\100")Y:CreateEnum("\067\104\101\099\107\066\111\120\083\116\097\116\101","\077\105\120\101\100")end return Y end function O.__new(g)g:InitializeSuper("\078\101\120\117\115\069\110\117\109")end function O.__getindex(I,g,A)if g=="\067\117\115\116\111\109\069\110\117\109\115"then return A end local Y=I.CustomEnums if Y then local A=Y[g]if A then return A,true end end local z,q=pcall(function()return Enum[g]end)if z then return q end return O.super.__getindex(I,g,A)end return O
--[[
TheNexusAvenger

Contains a set of Enums and can reference Roblox enums.
--]]

local CLASS_NAME = "NexusEnumCollection"



local NexusPluginFramework = require(script.Parent.Parent.Parent:WaitForChild("NexusPluginFrameworkProject")):GetContext(script)
local NexusEnum = NexusPluginFramework:GetResource("Data.Enum.NexusEnum")

local NexusEnumCollection = NexusEnum:Extend()
NexusEnumCollection:SetClassName(CLASS_NAME)
NexusPluginFramework:SetContextResource(NexusEnumCollection)

local StaticInstance



--[[
Returns a static instance with a set of built-in
enums used by the framework.
--]]
function NexusEnumCollection.GetBuiltInEnums()
	--Create the static instance.
	if not StaticInstance then
		StaticInstance = NexusEnumCollection.new()
		
		--Add the enums.
		StaticInstance:CreateEnum("NexusScrollTheme","Native")
		StaticInstance:CreateEnum("NexusScrollTheme","Qt5")
		StaticInstance:CreateEnum("CheckBoxState","Checked")
		StaticInstance:CreateEnum("CheckBoxState","Unchecked")
		StaticInstance:CreateEnum("CheckBoxState","Mixed")
	end
	
	--Return the static instance.
	return StaticInstance
end

--[[
Creates an NexusEnumCollection object.
--]]
function NexusEnumCollection:__new()
	self:InitializeSuper("NexusEnum")
end

--[[
Returns the value for a custom index. If the second
value returned is true, it will force return the
returned value, even if it is nil. If not, regular
indexing will be used.
--]]
function NexusEnumCollection:__getindex(IndexName,OriginalReturn)
	--Return the base case for CustomEnums.
	if IndexName == "CustomEnums" then
		return OriginalReturn
	end
	
	--Return an enum item.
	local CustomEnums = self.CustomEnums
	if CustomEnums then
		local CustomEnum = CustomEnums[IndexName]
		if CustomEnum then
			return CustomEnum,true
		end
	end
	
	--Return a Roblox enum.
	local Worked,Return = pcall(function()
		return Enum[IndexName]
	end)
	
	if Worked then
		return Return
	end
	
	--Return the super.
	return NexusEnumCollection.super.__getindex(self,IndexName,OriginalReturn)
end



return NexusEnumCollection