LogoObsidian
Dependency

Dependency Groupboxes

Conditionally display a groupbox with toggles and options based on the dependencies set.

Dependency groupboxes much like dependency boxes are containers that hide and show elements contained within it based on the dependencies set.

The difference is that dependency groupboxes have actually "groupbox" like UI (with no title and no side choice, the side is inherited from the parent groupbox's side).

Audio Settings
Enable Audio

Usage

You can create a Dependency Groupbox by calling the AddDependencyGroupbox method on a Groupbox.

local Toggles = Library.Toggles
local LeftGroupbox = MainTab:AddLeftGroupbox("Settings", "wrench")
 
LeftGroupbox:AddToggle("EnableAudio", {
    Text = "Enable Audio",
    Default = false
})
 
local AudioSettings = LeftGroupbox:AddDependencyGroupbox()
 
AudioSettings:AddSlider("Volume", {
    Text = "Volume",
    Default = 50,
    Min = 0,
    Max = 100,
    Rounding = 0
})
 
AudioSettings:SetupDependencies({
    { Toggles.EnableAudio, true }, -- Only show if EnableAudio is true
})

Methods

SetupDependencies

Setup the dependencies for the dependency box.

DependencyGroupbox:SetupDependencies(dependencies)
Arg IdxArgument DescriptionTypeDefault
1table of dependenciestablenil

On this page