diff --git a/HeroLib/GUI/Panels.lua b/HeroLib/GUI/Panels.lua index aa866fad..c4ac7f93 100755 --- a/HeroLib/GUI/Panels.lua +++ b/HeroLib/GUI/Panels.lua @@ -66,12 +66,12 @@ local function CreateCheckButton(Parent, Setting, Text, Tooltip, Optionals) CheckButton.SavedVariablesTable, CheckButton.SavedVariablesKey = Parent.SavedVariablesTable, Setting -- Frame init - if not LastOptionAttached[Parent.name] then + if not LastOptionAttached[Parent.usedName] then CheckButton:SetPoint("TOPLEFT", 15, -10) else - CheckButton:SetPoint("TOPLEFT", LastOptionAttached[Parent.name][1], "BOTTOMLEFT", LastOptionAttached[Parent.name][2], LastOptionAttached[Parent.name][3]) + CheckButton:SetPoint("TOPLEFT", LastOptionAttached[Parent.usedName][1], "BOTTOMLEFT", LastOptionAttached[Parent.usedName][2], LastOptionAttached[Parent.usedName][3]) end - LastOptionAttached[Parent.name] = { CheckButton, 0, 0 } + LastOptionAttached[Parent.usedName] = { CheckButton, 0, 0 } CheckButton:SetChecked(CheckButton.SettingTable[CheckButton.SettingKey]) @@ -120,12 +120,12 @@ local function CreateDropdown(Parent, Setting, Values, Text, Tooltip, Optionals) end -- Frame init - if not LastOptionAttached[Parent.name] then + if not LastOptionAttached[Parent.usedName] then Dropdown:SetPoint("TOPLEFT", 0, -30) else - Dropdown:SetPoint("TOPLEFT", LastOptionAttached[Parent.name][1], "BOTTOMLEFT", LastOptionAttached[Parent.name][2] - 15, LastOptionAttached[Parent.name][3] - 20) + Dropdown:SetPoint("TOPLEFT", LastOptionAttached[Parent.usedName][1], "BOTTOMLEFT", LastOptionAttached[Parent.usedName][2] - 15, LastOptionAttached[Parent.usedName][3] - 20) end - LastOptionAttached[Parent.name] = { Dropdown, 15, 0 } + LastOptionAttached[Parent.usedName] = { Dropdown, 15, 0 } local function Initialize(Self, Level) local Info = UIDropDownMenu_CreateInfo() @@ -161,12 +161,12 @@ local function CreateSlider(Parent, Setting, Values, Text, Tooltip, Action, Opti Slider.SavedVariablesTable, Slider.SavedVariablesKey = Parent.SavedVariablesTable, Setting -- Frame init - if not LastOptionAttached[Parent.name] then + if not LastOptionAttached[Parent.usedName] then Slider:SetPoint("TOPLEFT", 20, -25) else - Slider:SetPoint("TOPLEFT", LastOptionAttached[Parent.name][1], "BOTTOMLEFT", LastOptionAttached[Parent.name][2] + 5, LastOptionAttached[Parent.name][3] - 20) + Slider:SetPoint("TOPLEFT", LastOptionAttached[Parent.usedName][1], "BOTTOMLEFT", LastOptionAttached[Parent.usedName][2] + 5, LastOptionAttached[Parent.usedName][3] - 20) end - LastOptionAttached[Parent.name] = { Slider, -5, -20 } + LastOptionAttached[Parent.usedName] = { Slider, -5, -20 } Slider:SetMinMaxValues(Values[1], Values[2]) Slider.minValue, Slider.maxValue = Slider:GetMinMaxValues() @@ -233,12 +233,12 @@ local function CreateButton(Parent, Setting, Text, Tooltip, Action, Width, Heigh end -- Frame init - if not LastOptionAttached[Parent.name] then + if not LastOptionAttached[Parent.usedName] then Button:SetPoint("TOPLEFT", 15, -10) else - Button:SetPoint("TOPLEFT", LastOptionAttached[Parent.name][1], "BOTTOMLEFT", LastOptionAttached[Parent.name][2], LastOptionAttached[Parent.name][3]) + Button:SetPoint("TOPLEFT", LastOptionAttached[Parent.usedName][1], "BOTTOMLEFT", LastOptionAttached[Parent.usedName][2], LastOptionAttached[Parent.usedName][3]) end - LastOptionAttached[Parent.name] = { Button, 0, 0 } + LastOptionAttached[Parent.usedName] = { Button, 0, 0 } _G[Button:GetName() .. "Text"]:SetText("|c00dfb802" .. Text .. "|r") @@ -284,7 +284,7 @@ function GUI.CreateChildPanel(Parent, CName) CP.SavedVariablesTable = Parent.SavedVariablesTable CP.name = CName CP.parent = Parent.name - CP.usedName = CName:gsub(" ", "") + CP.usedName = ParentName .. "_ChildPanel_" .. CName:gsub(" ", "") local category = Settings.RegisterCanvasLayoutSubcategory(Parent.category, CP, CName) Settings.RegisterAddOnCategory(category) CP.category = category diff --git a/HeroLib/Settings.lua b/HeroLib/Settings.lua index 90e2f569..219000cf 100755 --- a/HeroLib/Settings.lua +++ b/HeroLib/Settings.lua @@ -117,10 +117,10 @@ function HL.GUI.CorePanelSettingsInit() -- GUI local HLPanel = CreatePanel(HL.GUI, "HeroLib", "PanelFrame", HL.GUISettings, HeroLibDB.GUISettings) -- Child Panel - local CP_HLGeneral = CreateChildPanel(HLPanel, "HLGeneral") + local CP_General = CreateChildPanel(HLPanel, "General") -- Debug - CreatePanelOption("CheckButton", CP_HLGeneral, "General.DebugMode", "Enable Debug Mode", "Enable if you want HeroLib to output debug messages.") + CreatePanelOption("CheckButton", CP_General, "General.DebugMode", "Enable Debug Mode", "Enable if you want HeroLib to output debug messages.") -- ReduceCPULoad - CreatePanelOption("CheckButton", CP_HLGeneral, "General.ReduceCPULoad", "Reduce CPU Load", "Enable if you would like to increase the cycle time of the addon, causing HeroLib and HeroRotation to use less CPU by running through its cycles on a longer delay.") - CreatePanelOption("Slider", CP_HLGeneral, "General.ReduceCPULoadOffset", {0, 1000, 1}, "Reduce CPU Load Offset (|cffff0000WARNING|r)", "Set this value to tell the addon how many more milliseconds to add to HeroLib and HeroRotation's cycle time when the above 'Reduce CPU Load' option is checked. |cffff0000WARNING|r: High values are NOT recommended, as this will cause HeroRotation's suggestions to appear latent. By default, the addon will cycle 15 times per second (its built-in 66ms delay). When 'Reduce CPU Load' is checked, this value will be added to that 66ms. If this value is set to 434, for example, that will add 434ms. This would make HeroRotation only cycle twice per second.") + CreatePanelOption("CheckButton", CP_General, "General.ReduceCPULoad", "Reduce CPU Load", "Enable if you would like to increase the cycle time of the addon, causing HeroLib and HeroRotation to use less CPU by running through its cycles on a longer delay.") + CreatePanelOption("Slider", CP_General, "General.ReduceCPULoadOffset", {0, 1000, 1}, "Reduce CPU Load Offset (|cffff0000WARNING|r)", "Set this value to tell the addon how many more milliseconds to add to HeroLib and HeroRotation's cycle time when the above 'Reduce CPU Load' option is checked. |cffff0000WARNING|r: High values are NOT recommended, as this will cause HeroRotation's suggestions to appear latent. By default, the addon will cycle 15 times per second (its built-in 66ms delay). When 'Reduce CPU Load' is checked, this value will be added to that 66ms. If this value is set to 434, for example, that will add 434ms. This would make HeroRotation only cycle twice per second.") end