Full-width class name header, per-class Hide/Show buttons
- Class name in the Classes tab is now a centered full-width heading flanked by thin lines, matching the Character Override tab's profile heading style, instead of a plain left-aligned label. - Add "Hide This Class" / "Show This Class" buttons below the frame checkboxes, scoped to whichever class tab is currently selected (the existing Hide All/Show All at the top still act on every class). Both buttons grey out alongside the checkboxes when the logged-in character's own class has its profile override enabled.
This commit is contained in:
+91
-5
@@ -101,11 +101,32 @@ local classContent = CreateFrame("Frame", nil, contentBox)
|
|||||||
classContent:SetPoint("TOPLEFT", contentBox, "TOPLEFT", 12, -4)
|
classContent:SetPoint("TOPLEFT", contentBox, "TOPLEFT", 12, -4)
|
||||||
classContent:SetPoint("BOTTOMRIGHT", contentBox, "BOTTOMRIGHT", -12, 4)
|
classContent:SetPoint("BOTTOMRIGHT", contentBox, "BOTTOMRIGHT", -12, 4)
|
||||||
|
|
||||||
local classLabel = classContent:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
|
local classLabelHeader = CreateFrame("Frame", nil, classContent)
|
||||||
classLabel:SetPoint("TOPLEFT", classContent, "TOPLEFT", 16, -12)
|
classLabelHeader:SetPoint("TOPLEFT", classContent, "TOPLEFT", 0, -4)
|
||||||
|
classLabelHeader:SetPoint("TOPRIGHT", classContent, "TOPRIGHT", 0, -4)
|
||||||
|
classLabelHeader:SetHeight(18)
|
||||||
|
|
||||||
|
local classLabel = classLabelHeader:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
|
||||||
|
classLabel:SetPoint("TOP")
|
||||||
|
classLabel:SetPoint("BOTTOM")
|
||||||
|
classLabel:SetJustifyH("CENTER")
|
||||||
|
|
||||||
|
local classLabelLeft = classLabelHeader:CreateTexture(nil, "ARTWORK")
|
||||||
|
classLabelLeft:SetHeight(8)
|
||||||
|
classLabelLeft:SetPoint("LEFT", 0, 0)
|
||||||
|
classLabelLeft:SetPoint("RIGHT", classLabel, "LEFT", -5, 0)
|
||||||
|
classLabelLeft:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
|
||||||
|
classLabelLeft:SetTexCoord(0.81, 0.94, 0.5, 1)
|
||||||
|
|
||||||
|
local classLabelRight = classLabelHeader:CreateTexture(nil, "ARTWORK")
|
||||||
|
classLabelRight:SetHeight(8)
|
||||||
|
classLabelRight:SetPoint("RIGHT", 0, 0)
|
||||||
|
classLabelRight:SetPoint("LEFT", classLabel, "RIGHT", 5, 0)
|
||||||
|
classLabelRight:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
|
||||||
|
classLabelRight:SetTexCoord(0.81, 0.94, 0.5, 1)
|
||||||
|
|
||||||
local overrideNoticeText = classContent:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
local overrideNoticeText = classContent:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||||
overrideNoticeText:SetPoint("TOPLEFT", classLabel, "BOTTOMLEFT", 0, -8)
|
overrideNoticeText:SetPoint("TOPLEFT", classLabelHeader, "BOTTOMLEFT", 16, -8)
|
||||||
overrideNoticeText:SetTextColor(1, 0.35, 0.35)
|
overrideNoticeText:SetTextColor(1, 0.35, 0.35)
|
||||||
overrideNoticeText:SetText("These settings are currently overridden")
|
overrideNoticeText:SetText("These settings are currently overridden")
|
||||||
overrideNoticeText:Hide()
|
overrideNoticeText:Hide()
|
||||||
@@ -113,13 +134,14 @@ overrideNoticeText:Hide()
|
|||||||
local checks = {}
|
local checks = {}
|
||||||
local selectedClass = nil
|
local selectedClass = nil
|
||||||
|
|
||||||
local previousAnchor = classLabel
|
local previousAnchor = classLabelHeader
|
||||||
local previousSpacing = -34
|
local previousSpacing = -34
|
||||||
|
local previousXOffset = 16
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoA.FRAMES) do
|
||||||
|
|
||||||
local check = CreateFrame("CheckButton", "HideCoAClassCheck" .. frameName, classContent, "InterfaceOptionsCheckButtonTemplate")
|
local check = CreateFrame("CheckButton", "HideCoAClassCheck" .. frameName, classContent, "InterfaceOptionsCheckButtonTemplate")
|
||||||
check:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", 0, previousSpacing)
|
check:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", previousXOffset, previousSpacing)
|
||||||
|
|
||||||
_G[check:GetName() .. "Text"]:SetText("Hide " .. frameName)
|
_G[check:GetName() .. "Text"]:SetText("Hide " .. frameName)
|
||||||
|
|
||||||
@@ -145,12 +167,15 @@ for _, frameName in ipairs(HideCoA.FRAMES) do
|
|||||||
checks[frameName] = check
|
checks[frameName] = check
|
||||||
previousAnchor = check
|
previousAnchor = check
|
||||||
previousSpacing = -8
|
previousSpacing = -8
|
||||||
|
previousXOffset = 0
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local tabButtons = {}
|
local tabButtons = {}
|
||||||
local TAB_HEIGHT = 18
|
local TAB_HEIGHT = 18
|
||||||
|
|
||||||
|
local hideClassButton, showClassButton
|
||||||
|
|
||||||
local function SelectClass(class)
|
local function SelectClass(class)
|
||||||
|
|
||||||
selectedClass = class
|
selectedClass = class
|
||||||
@@ -188,6 +213,14 @@ local function SelectClass(class)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if overridden then
|
||||||
|
hideClassButton:Disable()
|
||||||
|
showClassButton:Disable()
|
||||||
|
else
|
||||||
|
hideClassButton:Enable()
|
||||||
|
showClassButton:Enable()
|
||||||
|
end
|
||||||
|
|
||||||
for tabClass, button in pairs(tabButtons) do
|
for tabClass, button in pairs(tabButtons) do
|
||||||
if tabClass == class then
|
if tabClass == class then
|
||||||
button.selectedTexture:Show()
|
button.selectedTexture:Show()
|
||||||
@@ -198,6 +231,59 @@ local function SelectClass(class)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hideClassButton = CreateFrame("Button", "HideCoAHideClassButton", classContent, "UIPanelButtonTemplate")
|
||||||
|
hideClassButton:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", 0, -16)
|
||||||
|
hideClassButton:SetSize(140, 22)
|
||||||
|
hideClassButton:SetText("Hide This Class")
|
||||||
|
|
||||||
|
showClassButton = CreateFrame("Button", "HideCoAShowClassButton", classContent, "UIPanelButtonTemplate")
|
||||||
|
showClassButton:SetPoint("LEFT", hideClassButton, "RIGHT", 8, 0)
|
||||||
|
showClassButton:SetSize(140, 22)
|
||||||
|
showClassButton:SetText("Show This Class")
|
||||||
|
|
||||||
|
if ElvSkins then
|
||||||
|
ElvSkins:HandleButton(hideClassButton)
|
||||||
|
ElvSkins:HandleButton(showClassButton)
|
||||||
|
end
|
||||||
|
|
||||||
|
hideClassButton:SetScript("OnClick", function()
|
||||||
|
|
||||||
|
if not selectedClass then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local classSettings = HideCoA.GetActiveClassSettings()[selectedClass]
|
||||||
|
|
||||||
|
for _, frameName in ipairs(HideCoA.FRAMES) do
|
||||||
|
classSettings[frameName] = true
|
||||||
|
end
|
||||||
|
|
||||||
|
HideCoA.ApplySetting()
|
||||||
|
SelectClass(selectedClass)
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
|
AddClickSound(hideClassButton)
|
||||||
|
|
||||||
|
showClassButton:SetScript("OnClick", function()
|
||||||
|
|
||||||
|
if not selectedClass then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local classSettings = HideCoA.GetActiveClassSettings()[selectedClass]
|
||||||
|
|
||||||
|
for _, frameName in ipairs(HideCoA.FRAMES) do
|
||||||
|
classSettings[frameName] = false
|
||||||
|
end
|
||||||
|
|
||||||
|
HideCoA.ApplySetting()
|
||||||
|
SelectClass(selectedClass)
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
|
AddClickSound(showClassButton)
|
||||||
|
|
||||||
for index, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
for index, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
||||||
|
|
||||||
local button = CreateFrame("Button", "HideCoAClassTab" .. class, classSidebar)
|
local button = CreateFrame("Button", "HideCoAClassTab" .. class, classSidebar)
|
||||||
|
|||||||
Reference in New Issue
Block a user