local F=game:GetService("\080\108\097\121\101\114\115")local t=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local l=require((script.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 B=require(script.Parent:WaitForChild("\067\108\111\115\101\066\117\116\116\111\110\086\105\101\119"))local A=require(script.Parent:WaitForChild("\084\101\115\116\086\105\101\119"))local U=script.Parent.Parent:WaitForChild("\084\101\115\116\115")local v=U:WaitForChild("\077\097\110\117\097\108")local W=require(U:WaitForChild("\066\097\115\101\084\101\115\116"))local j=l:Extend()j:SetClassName("\084\101\115\116\076\105\115\116\086\105\101\119")function j.__new(l)l:InitializeSuper()l.Visible=false local j=Instance.new("\083\099\114\101\101\110\071\117\105")j.Name="\078\101\120\117\115\086\082\067\111\109\112\097\116\105\098\105\108\105\116\121\084\101\115\116\101\114"j.ResetOnSpawn=false j.DisplayOrder=1000 j.Parent=F.LocalPlayer:WaitForChild("\080\108\097\121\101\114\071\117\105")l.ScreenGui=j local b=Instance.new("\083\099\114\111\108\108\105\110\103\070\114\097\109\101")b.BackgroundTransparency=1 b.BorderSizePixel=0 b.BackgroundColor3=Color3.new(0,0,0)b.Name="\084\101\115\116\115\076\105\115\116"b.Size=UDim2.new(.5,0,1,0)b.Position=UDim2.new(1,0,0,0)b.SizeConstraint=Enum.SizeConstraint.RelativeYY b.HorizontalScrollBarInset=Enum.ScrollBarInset.ScrollBar b.CanvasSize=UDim2.new(0,0,0,0)b.AutomaticCanvasSize=Enum.AutomaticSize.Y b.Parent=j l.Container=b local w=Instance.new("\085\073\076\105\115\116\076\097\121\111\117\116")w.Padding=UDim.new(0,5)w.SortOrder=Enum.SortOrder.Name w.Parent=b local z=Instance.new("\070\114\097\109\101")z.BackgroundTransparency=.5 z.BackgroundColor3=Color3.new(0,0,0)z.AnchorPoint=Vector2.new(.5,0)z.Position=UDim2.new(.5,0,1,0)z.Size=UDim2.new(.6,0,.3,0)z.SizeConstraint=Enum.SizeConstraint.RelativeYY z.Parent=j l.InfoContainer=z local Z=Instance.new("\085\073\067\111\114\110\101\114")Z.CornerRadius=UDim.new(.05,0)Z.Parent=z local q=Instance.new("\084\101\120\116\076\097\098\101\108")q.BackgroundTransparency=1 q.Size=UDim2.new(.94,0,.175,0)q.Position=UDim2.new(.03,0,0,0)q.Name="\073\110\102\111\072\101\097\100\101\114\084\101\120\116"q.Font=Enum.Font.SourceSansBold q.TextColor3=Color3.new(1,1,1)q.TextStrokeColor3=Color3.new(0,0,0)q.TextStrokeTransparency=0 q.TextScaled=true q.TextXAlignment=Enum.TextXAlignment.Left q.TextTruncate=Enum.TextTruncate.AtEnd q.Parent=z l.InfoHeaderText=q local g=Instance.new("\084\101\120\116\076\097\098\101\108")g.BackgroundTransparency=1 g.Size=UDim2.new(.96,0,.825,0)g.Position=UDim2.new(.02,0,.175,0)g.Name="\073\110\102\111\077\097\105\110\084\101\120\116"g.Font=Enum.Font.SourceSansBold g.TextColor3=Color3.new(.9,.9,.9)g.TextStrokeColor3=Color3.new(0,0,0)g.TextStrokeTransparency=0 g.TextSize=z.AbsoluteSize.Y*.1 g.TextWrapped=true g.TextXAlignment=Enum.TextXAlignment.Left g.TextYAlignment=Enum.TextYAlignment.Top g.Parent=z l.InfoMainText=g;(z:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\083\105\122\101")):Connect(function()g.TextSize=z.AbsoluteSize.Y*.1 end)local N=Instance.new("\070\114\097\109\101")N.BackgroundTransparency=1 N.AnchorPoint=Vector2.new(1,0)N.Size=UDim2.new(.175,0,.175,0)N.Position=UDim2.new(1,0,0,0)N.SizeConstraint=Enum.SizeConstraint.RelativeYY N.Parent=z local S=Instance.new("\084\101\120\116\066\117\116\116\111\110")S.BackgroundColor3=Color3.new(0,.66666666666667,1.0)S.Name="\084\111\103\103\108\101\086\105\101\119"S.Size=UDim2.new(.8,0,.8,0)S.Position=UDim2.new(-0.8,0,.1,0)S.SizeConstraint=Enum.SizeConstraint.RelativeYY S.Text="\062"S.Font=Enum.Font.SourceSansBold S.TextColor3=Color3.new(1,1,1)S.TextStrokeColor3=Color3.new(0,0,0)S.TextStrokeTransparency=0 S.TextScaled=true S.Parent=N l.ToggleInfoViewButton=S local L=Instance.new("\085\073\067\111\114\110\101\114")L.CornerRadius=UDim.new(.2,0)L.Parent=S local G=Instance.new("\084\101\120\116\066\117\116\116\111\110")G.BackgroundColor3=Color3.new(.66666666666667,0,0)G.Name="\084\111\103\103\108\101\086\105\101\119"G.Size=UDim2.new(.8,0,.8,0)G.Position=UDim2.new(.1,0,.1,0)G.SizeConstraint=Enum.SizeConstraint.RelativeYY G.Text="\088"G.Font=Enum.Font.SourceSansBold G.TextColor3=Color3.new(1,1,1)G.TextStrokeColor3=Color3.new(0,0,0)G.TextStrokeTransparency=0 G.TextScaled=true G.Parent=N l.CloseInfoViewButton=G local O=Instance.new("\085\073\067\111\114\110\101\114")O.CornerRadius=UDim.new(.2,0)O.Parent=G local Y=true S.MouseButton1Down:Connect(function()if not Y or not l.CurrentInfoTest then return end Y=false if l.CurrentInfoTest.InfoView=="\080\082\079\066\076\069\077"then l.CurrentInfoTest.InfoView="\083\079\076\085\084\073\079\078"l.InfoMainText.Text=l.CurrentInfoTest.SolutionText l.InfoHeaderText.Text="\072\111\119 \100\111 \073 \115\111\108\118\101 \116\104\105\115\063"l.ToggleInfoViewButton.Text="\060"elseif l.CurrentInfoTest.InfoView=="\083\079\076\085\084\073\079\078"then l.CurrentInfoTest.InfoView="\080\082\079\066\076\069\077"l.InfoMainText.Text=l.CurrentInfoTest.ProblemText l.ToggleInfoViewButton.Text="\062"l.InfoHeaderText.Text="\087\104\121 \105\115 \116\104\105\115 \097 \112\114\111\098\108\101\109\063"end Y=true end)G.MouseButton1Down:Connect(function()if not Y or not l.CurrentInfoTest then return end Y=false l:ShowTestInfo(nil)Y=true end)local D={}for F,t in pairs(U:GetChildren())do if t:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")and t.Name~="\066\097\115\101\084\101\115\116"then table.insert(D,(require(t)).new())end end for F,t in pairs(v:GetChildren())do if t:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")then local F=require(t)local l=W.new()l.Name=F.Name l.ProblemText=F.ProblemText l.SolutionText=F.SolutionText if F.OnInfoViewChanged then(l:GetPropertyChangedSignal("\073\110\102\111\086\105\101\119")):Connect(function()F.OnInfoViewChanged(l,l.InfoView)end)end table.insert(D,l)end end table.sort(D,function(F,t)return F.Name<t.Name end)for F,t in pairs(D)do local B=A.new(t,b)B.InfoButton.MouseButton1Down:Connect(function()if not Y then return end Y=false if l.CurrentInfoTest~=t then l:ShowTestInfo(t)else l:ShowTestInfo(nil)end Y=true end)end local V=B.new(b)V.CloseButton.MouseButton1Down:Connect(function()if not Y then return end Y=false l.Visible=false Y=true end);(l:GetPropertyChangedSignal("\086\105\115\105\098\108\101")):Connect(function()if l.Visible then(t:Create(b,TweenInfo.new(.25),{AnchorPoint=Vector2.new(1,0)})):Play()if l.CurrentInfoTest then l.InfoContainer:TweenPosition(UDim2.new(.5,0,.675,0),"\073\110\079\117\116","\081\117\097\100",.25,true)end else(t:Create(b,TweenInfo.new(.25),{AnchorPoint=Vector2.new(0,0)})):Play()l.InfoContainer:TweenPosition(UDim2.new(.5,0,1,0),"\073\110\079\117\116","\081\117\097\100",.25,true)end end)end function j.ShowTestInfo(t,F)if t.CurrentInfoTest then t.CurrentInfoTest.InfoView="\078\079\078\069"end t.CurrentInfoTest=F if not F then t.InfoContainer:TweenPosition(UDim2.new(.5,0,1,0),"\073\110\079\117\116","\081\117\097\100",.25,true)return end t.InfoContainer:TweenPosition(UDim2.new(.5,0,.675,0),"\073\110\079\117\116","\081\117\097\100",.25,true)t.InfoHeaderText.Text="\087\104\121 \105\115 \116\104\105\115 \097 \112\114\111\098\108\101\109\063"t.InfoMainText.Text=F.ProblemText t.ToggleInfoViewButton.Text="\062"t.ToggleInfoViewButton.Visible=F.SolutionText~=""F.InfoView="\080\082\079\066\076\069\077"end return j
--[[
TheNexusAvenger

Displays a list of tests.
--]]

local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")

local NexusInstance = require(script.Parent.Parent:WaitForChild("NexusInstance"):WaitForChild("NexusInstance"))
local CloseButtonView = require(script.Parent:WaitForChild("CloseButtonView"))
local TestView = require(script.Parent:WaitForChild("TestView"))
local Tests = script.Parent.Parent:WaitForChild("Tests")
local ManualTests = Tests:WaitForChild("Manual")
local BaseTest = require(Tests:WaitForChild("BaseTest"))

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



--[[
Creates the list view.
--]]
function TestListView:__new()
    self:InitializeSuper()
    self.Visible = false

    --Create the frames.
    local ScreenGui = Instance.new("ScreenGui")
    ScreenGui.Name = "NexusVRCompatibilityTester"
    ScreenGui.ResetOnSpawn = false
    ScreenGui.DisplayOrder = 1000
    ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
    self.ScreenGui = ScreenGui

    local ScrollingFrame = Instance.new("ScrollingFrame")
    ScrollingFrame.BackgroundTransparency = 1
    ScrollingFrame.BorderSizePixel = 0
    ScrollingFrame.BackgroundColor3 = Color3.new(0,0,0)
    ScrollingFrame.Name = "TestsList"
    ScrollingFrame.Size = UDim2.new(0.5,0,1,0)
    ScrollingFrame.Position = UDim2.new(1,0,0,0)
    ScrollingFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY
    ScrollingFrame.HorizontalScrollBarInset = Enum.ScrollBarInset.ScrollBar
    ScrollingFrame.CanvasSize = UDim2.new(0,0,0,0)
    ScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
    ScrollingFrame.Parent = ScreenGui
    self.Container = ScrollingFrame

    local UIListLayout = Instance.new("UIListLayout")
    UIListLayout.Padding = UDim.new(0,5)
    UIListLayout.SortOrder = Enum.SortOrder.Name
    UIListLayout.Parent = ScrollingFrame

    local InfoContainer = Instance.new("Frame")
    InfoContainer.BackgroundTransparency = 0.5
    InfoContainer.BackgroundColor3 = Color3.new(0,0,0)
    InfoContainer.AnchorPoint = Vector2.new(0.5,0)
    InfoContainer.Position = UDim2.new(0.5,0,1,0)
    InfoContainer.Size = UDim2.new(0.6,0,0.3,0)
    InfoContainer.SizeConstraint = Enum.SizeConstraint.RelativeYY
    InfoContainer.Parent = ScreenGui
    self.InfoContainer = InfoContainer

    local InfoContainerUICorner = Instance.new("UICorner")
    InfoContainerUICorner.CornerRadius = UDim.new(0.05,0)
    InfoContainerUICorner.Parent = InfoContainer

    local InfoHeaderText = Instance.new("TextLabel")
    InfoHeaderText.BackgroundTransparency = 1
    InfoHeaderText.Size = UDim2.new(0.94,0,0.175,0)
    InfoHeaderText.Position = UDim2.new(0.03,0,0,0)
    InfoHeaderText.Name = "InfoHeaderText"
    InfoHeaderText.Font = Enum.Font.SourceSansBold
    InfoHeaderText.TextColor3 = Color3.new(1,1,1)
    InfoHeaderText.TextStrokeColor3 = Color3.new(0,0,0)
    InfoHeaderText.TextStrokeTransparency = 0
    InfoHeaderText.TextScaled = true
    InfoHeaderText.TextXAlignment = Enum.TextXAlignment.Left
    InfoHeaderText.TextTruncate = Enum.TextTruncate.AtEnd
    InfoHeaderText.Parent = InfoContainer
    self.InfoHeaderText = InfoHeaderText

    local InfoMainText = Instance.new("TextLabel")
    InfoMainText.BackgroundTransparency = 1
    InfoMainText.Size = UDim2.new(0.96,0,0.825,0)
    InfoMainText.Position = UDim2.new(0.02,0,0.175,0)
    InfoMainText.Name = "InfoMainText"
    InfoMainText.Font = Enum.Font.SourceSansBold
    InfoMainText.TextColor3 = Color3.new(0.9,0.9,0.9)
    InfoMainText.TextStrokeColor3 = Color3.new(0,0,0)
    InfoMainText.TextStrokeTransparency = 0
    InfoMainText.TextSize = InfoContainer.AbsoluteSize.Y * 0.1
    InfoMainText.TextWrapped = true
    InfoMainText.TextXAlignment = Enum.TextXAlignment.Left
    InfoMainText.TextYAlignment = Enum.TextYAlignment.Top
    InfoMainText.Parent = InfoContainer
    self.InfoMainText = InfoMainText

    InfoContainer:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
        InfoMainText.TextSize = InfoContainer.AbsoluteSize.Y * 0.1
    end)

    local ButtonContainer = Instance.new("Frame")
    ButtonContainer.BackgroundTransparency = 1
    ButtonContainer.AnchorPoint = Vector2.new(1,0)
    ButtonContainer.Size = UDim2.new(0.175,0,0.175,0)
    ButtonContainer.Position = UDim2.new(1,0,0,0)
    ButtonContainer.SizeConstraint = Enum.SizeConstraint.RelativeYY
    ButtonContainer.Parent = InfoContainer

    local ToggleInfoViewButton = Instance.new("TextButton")
    ToggleInfoViewButton.BackgroundColor3 = Color3.new(0,170/255,255/255)
    ToggleInfoViewButton.Name = "ToggleView"
    ToggleInfoViewButton.Size = UDim2.new(0.8,0,0.8,0)
    ToggleInfoViewButton.Position = UDim2.new(-0.8,0,0.1,0)
    ToggleInfoViewButton.SizeConstraint = Enum.SizeConstraint.RelativeYY
    ToggleInfoViewButton.Text = ">"
    ToggleInfoViewButton.Font = Enum.Font.SourceSansBold
    ToggleInfoViewButton.TextColor3 = Color3.new(1,1,1)
    ToggleInfoViewButton.TextStrokeColor3 = Color3.new(0,0,0)
    ToggleInfoViewButton.TextStrokeTransparency = 0
    ToggleInfoViewButton.TextScaled = true
    ToggleInfoViewButton.Parent = ButtonContainer
    self.ToggleInfoViewButton = ToggleInfoViewButton

    local ToggleInfoViewButtonUICorner = Instance.new("UICorner")
    ToggleInfoViewButtonUICorner.CornerRadius = UDim.new(0.2,0)
    ToggleInfoViewButtonUICorner.Parent = ToggleInfoViewButton

    local CloseInfoViewButton = Instance.new("TextButton")
    CloseInfoViewButton.BackgroundColor3 = Color3.new(170/255,0,0)
    CloseInfoViewButton.Name = "ToggleView"
    CloseInfoViewButton.Size = UDim2.new(0.8,0,0.8,0)
    CloseInfoViewButton.Position = UDim2.new(0.1,0,0.1,0)
    CloseInfoViewButton.SizeConstraint = Enum.SizeConstraint.RelativeYY
    CloseInfoViewButton.Text = "X"
    CloseInfoViewButton.Font = Enum.Font.SourceSansBold
    CloseInfoViewButton.TextColor3 = Color3.new(1,1,1)
    CloseInfoViewButton.TextStrokeColor3 = Color3.new(0,0,0)
    CloseInfoViewButton.TextStrokeTransparency = 0
    CloseInfoViewButton.TextScaled = true
    CloseInfoViewButton.Parent = ButtonContainer
    self.CloseInfoViewButton = CloseInfoViewButton

    local CloseInfoViewButtonUICorner = Instance.new("UICorner")
    CloseInfoViewButtonUICorner.CornerRadius = UDim.new(0.2,0)
    CloseInfoViewButtonUICorner.Parent = CloseInfoViewButton

    --Connect the buttons.
    local DB = true
    ToggleInfoViewButton.MouseButton1Down:Connect(function()
        if not DB or not self.CurrentInfoTest then return end
        DB = false
        if self.CurrentInfoTest.InfoView == "PROBLEM" then
            self.CurrentInfoTest.InfoView = "SOLUTION"
            self.InfoMainText.Text = self.CurrentInfoTest.SolutionText
            self.InfoHeaderText.Text = "How do I solve this?"
            self.ToggleInfoViewButton.Text = "<"
        elseif self.CurrentInfoTest.InfoView == "SOLUTION" then
            self.CurrentInfoTest.InfoView = "PROBLEM"
            self.InfoMainText.Text = self.CurrentInfoTest.ProblemText
            self.ToggleInfoViewButton.Text = ">"
            self.InfoHeaderText.Text = "Why is this a problem?"
        end
        DB = true
    end)
    CloseInfoViewButton.MouseButton1Down:Connect(function()
        if not DB or not self.CurrentInfoTest then return end
        DB = false
        self:ShowTestInfo(nil)
        DB = true
    end)

    --Create and sort the tests.
    local TestInstances = {}
    for _,TestModule in pairs(Tests:GetChildren()) do
        if TestModule:IsA("ModuleScript") and TestModule.Name ~= "BaseTest" then
            table.insert(TestInstances,require(TestModule).new())
        end
    end
    for _,TestModule in pairs(ManualTests:GetChildren()) do
        if TestModule:IsA("ModuleScript") then
            local TestData = require(TestModule)
            local Test = BaseTest.new()
            Test.Name = TestData.Name
            Test.ProblemText = TestData.ProblemText
            Test.SolutionText = TestData.SolutionText
            if TestData.OnInfoViewChanged then
                Test:GetPropertyChangedSignal("InfoView"):Connect(function()
                    TestData.OnInfoViewChanged(Test,Test.InfoView)
                end)
            end
            table.insert(TestInstances,Test)
        end
    end
    table.sort(TestInstances,function(a,b)
        return a.Name < b.Name
    end)

    --Create the views.
    for _,Test in pairs(TestInstances) do
        local View = TestView.new(Test,ScrollingFrame)
        View.InfoButton.MouseButton1Down:Connect(function()
            if not DB then return end
            DB = false
            if self.CurrentInfoTest ~= Test then
                self:ShowTestInfo(Test)
            else
                self:ShowTestInfo(nil)
            end
            DB = true
        end)
    end

    --Add the close button.
    local CloseButton = CloseButtonView.new(ScrollingFrame)
    CloseButton.CloseButton.MouseButton1Down:Connect(function()
        if not DB then return end
        DB = false
        self.Visible = false
        DB = true
    end)

    --Connect showing and hidding.
    self:GetPropertyChangedSignal("Visible"):Connect(function()
        if self.Visible then
            TweenService:Create(ScrollingFrame,TweenInfo.new(0.25),{
                AnchorPoint = Vector2.new(1,0),
            }):Play()
            if self.CurrentInfoTest then
                self.InfoContainer:TweenPosition(UDim2.new(0.5,0,0.675,0),"InOut","Quad",0.25,true)
            end
        else
            TweenService:Create(ScrollingFrame,TweenInfo.new(0.25),{
                AnchorPoint = Vector2.new(0,0),
            }):Play()
            self.InfoContainer:TweenPosition(UDim2.new(0.5,0,1,0),"InOut","Quad",0.25,true)
        end
    end)
end

function TestListView:ShowTestInfo(Test)
    --Hide the current test.
    if self.CurrentInfoTest then
        self.CurrentInfoTest.InfoView = "NONE"
    end
    self.CurrentInfoTest = Test
    if not Test then
        self.InfoContainer:TweenPosition(UDim2.new(0.5,0,1,0),"InOut","Quad",0.25,true)
        return
    end

    --Set the initial info of the test.
    self.InfoContainer:TweenPosition(UDim2.new(0.5,0,0.675,0),"InOut","Quad",0.25,true)
    self.InfoHeaderText.Text = "Why is this a problem?"
    self.InfoMainText.Text = Test.ProblemText
    self.ToggleInfoViewButton.Text = ">"
    self.ToggleInfoViewButton.Visible = (Test.SolutionText ~= "")
    Test.InfoView = "PROBLEM"
end



return TestListView