You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.7 KiB
60 lines
1.7 KiB
MoveIt.GUI.Modules.Strata = {}
|
|
local strataGUI = MoveIt.GUI.Modules.Strata
|
|
|
|
strataGUI.strataLevels =
|
|
{
|
|
BACKGROUND = "Background",
|
|
LOW = "Low",
|
|
MEDIUM = "Medium",
|
|
HIGH = "High",
|
|
DIALOG = "Dialog",
|
|
FULLSCREEN = "Fullscreen",
|
|
FULLSCREEN_DIALOG = "Fullscreen Dialog",
|
|
TOOLTIP = "Tooltip"
|
|
}
|
|
|
|
function strataGUI:Create(container)
|
|
|
|
MoveIt.GUI.Modules:CreateEnabledCheckbox(container, "Strata", 0.4, "Set Strata")
|
|
|
|
self.dropdownStrata = AceGUI:Create("Dropdown")
|
|
self.dropdownStrata:SetList(strataGUI.strataLevels)
|
|
self.dropdownStrata:SetLabel("Strata Level (Z Order):")
|
|
self.dropdownStrata:SetRelativeWidth(0.4)
|
|
self.dropdownStrata:SetDisabled(true)
|
|
self.dropdownStrata:SetCallback("OnValueChanged", function(_, _, value) self:OnStrataChanged(value) end)
|
|
container:AddChild(self.dropdownStrata)
|
|
|
|
end
|
|
|
|
function strataGUI:OnStrataChanged(value)
|
|
|
|
local modSettings = MoveIt:GetFrameSettings(MoveIt.GUI.Options.selectedFrame, "Strata")
|
|
modSettings.Level = self.dropdownStrata:GetValue()
|
|
MoveIt:ApplyFrameSettings(MoveIt.GUI.Options.selectedFrame)
|
|
|
|
end
|
|
|
|
function strataGUI:Update(frameName)
|
|
|
|
if not MoveIt:FrameHasStrata(frameName) then self:Disable() return end
|
|
|
|
local modSettings = MoveIt:GetFrameSettings(frameName, "Strata")
|
|
self.checkboxEnabled:SetValue(modSettings.Enabled, false)
|
|
self.dropdownStrata:SetValue(modSettings.Level, false)
|
|
|
|
self.checkboxEnabled:SetDisabled(false)
|
|
self.dropdownStrata:SetDisabled(not modSettings.Enabled)
|
|
|
|
end
|
|
|
|
function strataGUI:Disable()
|
|
|
|
self.checkboxEnabled:SetValue(false, false)
|
|
self.dropdownStrata:SetValue("", false)
|
|
|
|
self.checkboxEnabled:SetDisabled(true)
|
|
self.dropdownStrata:SetDisabled(true)
|
|
|
|
end
|
|
|
|
|