local F=game:GetService("\082\117\110\083\101\114\118\105\099\101")local t=require((script.Parent.Parent.Parent:WaitForChild("\078\101\120\117\115\073\110\115\116\097\110\099\101")):WaitForChild("\078\101\120\117\115\073\110\115\116\097\110\099\101"))local l=t:Extend()l:SetClassName("\080\114\111\098\108\101\109\072\105\103\104\108\105\103\104\116\115")function l.__new(l,t)l:InitializeSuper()l.Objects={}l.Adorns={}l.Active=false;(l:GetPropertyChangedSignal("\079\098\106\101\099\116\115")):Connect(function()for F=#l.Adorns+1,#l.Objects,1 do local t=Instance.new("\066\111\120\072\097\110\100\108\101\065\100\111\114\110\109\101\110\116")t.ZIndex=0 t.AlwaysOnTop=true t.Color3=Color3.new(1,0,0)t.Parent=script table.insert(l.Adorns,t)end for F=#l.Adorns,#l.Objects+1,-1 do l.Adorns[F]:Destroy()l.Adorns[F]=nil end for F,t in pairs(l.Objects)do l.Adorns[F].Adornee=t end end)F.RenderStepped:Connect(function()for F,t in pairs(l.Adorns)do if t.Adornee then t.Size=t.Adornee.Size t.Transparency=l.Active and math.sin((tick()*2)%(math.pi*2))*.5+.5 or 1 end end end)if not t then return end;(t:GetPropertyChangedSignal("\073\110\102\111\086\105\101\119")):Connect(function()l.Active=t.InfoView~="\078\079\078\069"end)end return l
--[[
TheNexusAvenger

Highlights problematic parts.
--]]

local RunService = game:GetService("RunService")

local NexusInstance = require(script.Parent.Parent.Parent:WaitForChild("NexusInstance"):WaitForChild("NexusInstance"))

local ProblemHighlights = NexusInstance:Extend()
ProblemHighlights:SetClassName("ProblemHighlights")



--[[
Creates the highlights.
--]]
function ProblemHighlights:__new(Test)
    self:InitializeSuper()
    self.Objects = {}
    self.Adorns = {}
    self.Active = false

    --Connect updating the adorns.
    self:GetPropertyChangedSignal("Objects"):Connect(function()
        for _ = #self.Adorns + 1,#self.Objects do
            local BoxAdorn = Instance.new("BoxHandleAdornment")
            BoxAdorn.ZIndex = 0
            BoxAdorn.AlwaysOnTop = true
            BoxAdorn.Color3 = Color3.new(1,0,0)
            BoxAdorn.Parent = script
            table.insert(self.Adorns,BoxAdorn)
        end
        for i = #self.Adorns,#self.Objects + 1,-1 do
            self.Adorns[i]:Destroy()
            self.Adorns[i] = nil
        end
        for i,Part in pairs(self.Objects) do
            self.Adorns[i].Adornee = Part
        end
    end)
    RunService.RenderStepped:Connect(function()
        for _,Adorn in pairs(self.Adorns) do
            if Adorn.Adornee then
                Adorn.Size = Adorn.Adornee.Size
                Adorn.Transparency = (self.Active and (math.sin((tick() * 2) % (math.pi * 2)) * 0.5) + 0.5 or 1)
            end
        end
    end)

    --Connect setting the adorns as active.
    if not Test then return end
    Test:GetPropertyChangedSignal("InfoView"):Connect(function()
        self.Active = (Test.InfoView ~= "NONE")
    end)
end



return ProblemHighlights