Compare commits
10 Commits
aaa7795287
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 041d67e331 | |||
| 3547c3a356 | |||
| 894b208fb0 | |||
| 54c7a5e4da | |||
| cda62d1b98 | |||
| 7d55c8ea9a | |||
| 9c5282886f | |||
| f3a58b846d | |||
| 6165bbfe6e | |||
| fd4dbefb01 |
@@ -32,8 +32,35 @@ HideCoAUI.FRAMES = {
|
||||
"CoAResourceBar",
|
||||
"CoAMultiCastActionBarFrame",
|
||||
-- "CoASpellActivationOverlay", -- found via full frame scan, deliberately left without a checkbox
|
||||
-- "ExtraActionBar",
|
||||
}
|
||||
|
||||
HideCoAUI.FRAME_DISPLAY_NAMES = {
|
||||
PYROMANCER = {
|
||||
CoAResourceSegmentBar = "Ember Gauge",
|
||||
CoAResourceBar = "Heat Gauge",
|
||||
},
|
||||
CULTIST = {
|
||||
CoAResourceOrb = "Insanity",
|
||||
},
|
||||
PROPHET = {
|
||||
CoAResourceSegmentBar = "Brood Marks",
|
||||
},
|
||||
STARCALLER = {
|
||||
CoAResourceOrb = "Lunar Phase",
|
||||
},
|
||||
SUNCLERIC = {
|
||||
CoAResourceOrb = "Solar Power",
|
||||
},
|
||||
}
|
||||
|
||||
local function GetFrameDisplayName(class, frameName)
|
||||
local classNames = HideCoAUI.FRAME_DISPLAY_NAMES[class]
|
||||
return classNames and classNames[frameName]
|
||||
end
|
||||
|
||||
HideCoAUI.GetFrameDisplayName = GetFrameDisplayName
|
||||
|
||||
local function CreateDefaultClassSettings()
|
||||
|
||||
local classSettings = {}
|
||||
@@ -41,7 +68,7 @@ local function CreateDefaultClassSettings()
|
||||
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||
classSettings[class] = {}
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
classSettings[class][frameName] = true
|
||||
classSettings[class][frameName] = false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -59,7 +86,7 @@ local function EnsureClassSettingsComplete(classSettings)
|
||||
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
if classSettings[class][frameName] == nil then
|
||||
classSettings[class][frameName] = true
|
||||
classSettings[class][frameName] = false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -96,70 +123,17 @@ end
|
||||
|
||||
HideCoAUI.SetActiveProfileName = SetActiveProfileName
|
||||
|
||||
local function GetActiveClassSettings()
|
||||
local function GetClassSettings()
|
||||
|
||||
local name = GetActiveProfileName()
|
||||
local profile = HideCoADB.profiles[name]
|
||||
|
||||
if not profile then
|
||||
profile = { classSettings = CreateDefaultClassSettings() }
|
||||
HideCoADB.profiles[name] = profile
|
||||
if not HideCoADB.classSettings then
|
||||
HideCoADB.classSettings = CreateDefaultClassSettings()
|
||||
end
|
||||
|
||||
if not profile.classSettings then
|
||||
profile.classSettings = CreateDefaultClassSettings()
|
||||
end
|
||||
|
||||
return profile.classSettings
|
||||
return HideCoADB.classSettings
|
||||
|
||||
end
|
||||
|
||||
HideCoAUI.GetActiveClassSettings = GetActiveClassSettings
|
||||
|
||||
local function CopyProfile(sourceName, destName)
|
||||
|
||||
local source = HideCoADB.profiles[sourceName]
|
||||
|
||||
if not source or not source.classSettings then
|
||||
return
|
||||
end
|
||||
|
||||
local copy = {}
|
||||
|
||||
for class, settings in pairs(source.classSettings) do
|
||||
copy[class] = {}
|
||||
for frameName, value in pairs(settings) do
|
||||
copy[class][frameName] = value
|
||||
end
|
||||
end
|
||||
|
||||
if not HideCoADB.profiles[destName] then
|
||||
HideCoADB.profiles[destName] = {}
|
||||
end
|
||||
|
||||
HideCoADB.profiles[destName].classSettings = copy
|
||||
|
||||
HideCoAUI.ApplySetting()
|
||||
|
||||
end
|
||||
|
||||
HideCoAUI.CopyProfile = CopyProfile
|
||||
|
||||
local function ResetProfile()
|
||||
|
||||
local name = GetActiveProfileName()
|
||||
|
||||
if not HideCoADB.profiles[name] then
|
||||
HideCoADB.profiles[name] = {}
|
||||
end
|
||||
|
||||
HideCoADB.profiles[name].classSettings = CreateDefaultClassSettings()
|
||||
|
||||
HideCoAUI.ApplySetting()
|
||||
|
||||
end
|
||||
|
||||
HideCoAUI.ResetProfile = ResetProfile
|
||||
HideCoAUI.GetClassSettings = GetClassSettings
|
||||
|
||||
local function DeleteProfile(name)
|
||||
|
||||
@@ -168,7 +142,7 @@ local function DeleteProfile(name)
|
||||
for charKey, assigned in pairs(HideCoADB.charProfile) do
|
||||
if assigned == name then
|
||||
-- Unassigning falls back to the character's own auto-created
|
||||
-- profile (see GetActiveProfileName/GetActiveClassSettings),
|
||||
-- profile (see GetActiveProfileName/GetProfileOverride),
|
||||
-- which gets recreated on demand if it doesn't exist.
|
||||
HideCoADB.charProfile[charKey] = nil
|
||||
end
|
||||
@@ -183,7 +157,7 @@ local function EnsureProfileOverride(name)
|
||||
local profile = HideCoADB.profiles[name]
|
||||
|
||||
if not profile then
|
||||
profile = { classSettings = CreateDefaultClassSettings() }
|
||||
profile = {}
|
||||
HideCoADB.profiles[name] = profile
|
||||
end
|
||||
|
||||
@@ -193,7 +167,7 @@ local function EnsureProfileOverride(name)
|
||||
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
if profile.override.frameSettings[frameName] == nil then
|
||||
profile.override.frameSettings[frameName] = true
|
||||
profile.override.frameSettings[frameName] = false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -239,7 +213,7 @@ HideCoAUI.GetProfileNames = GetProfileNames
|
||||
|
||||
local function SetAllClassesHidden(hide)
|
||||
|
||||
local classSettings = GetActiveClassSettings()
|
||||
local classSettings = GetClassSettings()
|
||||
|
||||
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
@@ -265,10 +239,10 @@ HideCoAUI.ShowAllFrames = ShowAllFrames
|
||||
|
||||
local function ShouldHideForClass(playerClass, frameName)
|
||||
|
||||
local classSettings = GetActiveClassSettings()[playerClass]
|
||||
local classSettings = GetClassSettings()[playerClass]
|
||||
|
||||
if not classSettings or classSettings[frameName] == nil then
|
||||
return true
|
||||
return false
|
||||
end
|
||||
|
||||
return classSettings[frameName]
|
||||
@@ -356,11 +330,24 @@ f:SetScript("OnEvent", function(self, event, arg1)
|
||||
HideCoADB.charProfile = {}
|
||||
end
|
||||
|
||||
-- Legacy pre-profile saved variables stored a single flat classSettings
|
||||
-- table shared by every character. Fold it into whichever character
|
||||
-- happens to load next so those hide/show choices don't just vanish.
|
||||
local legacyFlatClassSettings = HideCoADB.classSettings
|
||||
HideCoADB.classSettings = nil
|
||||
-- An older saved-variable format duplicated classSettings per profile
|
||||
-- instead of sharing one account-wide table. Pull whichever profile
|
||||
-- still has one as the seed so existing hide/show choices survive
|
||||
-- the upgrade to a single global classSettings.
|
||||
if not HideCoADB.classSettings then
|
||||
for _, profile in pairs(HideCoADB.profiles) do
|
||||
if profile.classSettings then
|
||||
HideCoADB.classSettings = profile.classSettings
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not HideCoADB.classSettings then
|
||||
HideCoADB.classSettings = CreateDefaultClassSettings()
|
||||
end
|
||||
|
||||
EnsureClassSettingsComplete(HideCoADB.classSettings)
|
||||
|
||||
local charKey = GetCharacterKey()
|
||||
|
||||
@@ -395,14 +382,11 @@ f:SetScript("OnEvent", function(self, event, arg1)
|
||||
end
|
||||
|
||||
if not HideCoADB.profiles[charKey] then
|
||||
HideCoADB.profiles[charKey] = { classSettings = legacyFlatClassSettings or CreateDefaultClassSettings() }
|
||||
HideCoADB.profiles[charKey] = {}
|
||||
end
|
||||
|
||||
for name, profile in pairs(HideCoADB.profiles) do
|
||||
if not profile.classSettings then
|
||||
profile.classSettings = CreateDefaultClassSettings()
|
||||
end
|
||||
EnsureClassSettingsComplete(profile.classSettings)
|
||||
profile.classSettings = nil
|
||||
EnsureProfileOverride(name)
|
||||
end
|
||||
|
||||
@@ -53,8 +53,13 @@ local classesTitle = classesPanel:CreateFontString(nil, "ARTWORK", "GameFontNorm
|
||||
classesTitle:SetPoint("TOPLEFT", 16, -16)
|
||||
classesTitle:SetText("Classes")
|
||||
|
||||
local classesSubtitle = classesPanel:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||
classesSubtitle:SetPoint("TOPLEFT", classesTitle, "BOTTOMLEFT", 0, -4)
|
||||
classesSubtitle:SetTextColor(1, 1, 1)
|
||||
classesSubtitle:SetText("Global class based hiding")
|
||||
|
||||
local hideAllButton = CreateFrame("Button", "HideCoAUIHideAllButton", classesPanel, "UIPanelButtonTemplate")
|
||||
hideAllButton:SetPoint("TOPLEFT", classesTitle, "BOTTOMLEFT", 0, -12)
|
||||
hideAllButton:SetPoint("TOPLEFT", classesSubtitle, "BOTTOMLEFT", 0, -12)
|
||||
hideAllButton:SetSize(100, 22)
|
||||
hideAllButton:SetText("Hide All")
|
||||
|
||||
@@ -172,7 +177,7 @@ for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
return
|
||||
end
|
||||
|
||||
HideCoAUI.GetActiveClassSettings()[selectedClass][self.frameName] = self:GetChecked() and true or false
|
||||
HideCoAUI.GetClassSettings()[selectedClass][self.frameName] = self:GetChecked() and true or false
|
||||
HideCoAUI.ApplySetting()
|
||||
|
||||
end)
|
||||
@@ -191,6 +196,27 @@ local TAB_HEIGHT = 18
|
||||
|
||||
local hideClassButton, showClassButton
|
||||
|
||||
local function GetOrderedFrameNames(class)
|
||||
|
||||
local named = {}
|
||||
local generic = {}
|
||||
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
if HideCoAUI.GetFrameDisplayName(class, frameName) then
|
||||
table.insert(named, frameName)
|
||||
else
|
||||
table.insert(generic, frameName)
|
||||
end
|
||||
end
|
||||
|
||||
for _, frameName in ipairs(generic) do
|
||||
table.insert(named, frameName)
|
||||
end
|
||||
|
||||
return named
|
||||
|
||||
end
|
||||
|
||||
local function SelectClass(class)
|
||||
|
||||
selectedClass = class
|
||||
@@ -214,20 +240,40 @@ local function SelectClass(class)
|
||||
overrideNoticeText:Hide()
|
||||
end
|
||||
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
local previousCheckAnchor = classLabelHeader
|
||||
local previousCheckSpacing = -19
|
||||
local previousCheckXOffset = 16
|
||||
|
||||
checks[frameName]:SetChecked(HideCoAUI.GetActiveClassSettings()[class][frameName])
|
||||
for _, frameName in ipairs(GetOrderedFrameNames(class)) do
|
||||
|
||||
local check = checks[frameName]
|
||||
|
||||
check:ClearAllPoints()
|
||||
check:SetPoint("TOPLEFT", previousCheckAnchor, "BOTTOMLEFT", previousCheckXOffset, previousCheckSpacing)
|
||||
|
||||
local customName = HideCoAUI.GetFrameDisplayName(class, frameName)
|
||||
local label = customName and ("Hide " .. customName .. " (" .. frameName .. ")") or ("Hide " .. frameName)
|
||||
_G[check:GetName() .. "Text"]:SetText(label)
|
||||
|
||||
check:SetChecked(HideCoAUI.GetClassSettings()[class][frameName])
|
||||
|
||||
if overridden then
|
||||
checks[frameName]:Disable()
|
||||
_G[checks[frameName]:GetName() .. "Text"]:SetTextColor(0.5, 0.5, 0.5)
|
||||
check:Disable()
|
||||
_G[check:GetName() .. "Text"]:SetTextColor(0.5, 0.5, 0.5)
|
||||
else
|
||||
checks[frameName]:Enable()
|
||||
_G[checks[frameName]:GetName() .. "Text"]:SetTextColor(1, 1, 1)
|
||||
check:Enable()
|
||||
_G[check:GetName() .. "Text"]:SetTextColor(1, 1, 1)
|
||||
end
|
||||
|
||||
previousCheckAnchor = check
|
||||
previousCheckSpacing = -8
|
||||
previousCheckXOffset = 0
|
||||
|
||||
end
|
||||
|
||||
hideClassButton:ClearAllPoints()
|
||||
hideClassButton:SetPoint("TOPLEFT", previousCheckAnchor, "BOTTOMLEFT", 0, -16)
|
||||
|
||||
if overridden then
|
||||
hideClassButton:Disable()
|
||||
showClassButton:Disable()
|
||||
@@ -267,7 +313,7 @@ hideClassButton:SetScript("OnClick", function()
|
||||
return
|
||||
end
|
||||
|
||||
local classSettings = HideCoAUI.GetActiveClassSettings()[selectedClass]
|
||||
local classSettings = HideCoAUI.GetClassSettings()[selectedClass]
|
||||
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
classSettings[frameName] = true
|
||||
@@ -286,7 +332,7 @@ showClassButton:SetScript("OnClick", function()
|
||||
return
|
||||
end
|
||||
|
||||
local classSettings = HideCoAUI.GetActiveClassSettings()[selectedClass]
|
||||
local classSettings = HideCoAUI.GetClassSettings()[selectedClass]
|
||||
|
||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||
classSettings[frameName] = false
|
||||
@@ -374,8 +420,13 @@ local characterOverrideTitle = characterOverridePanel:CreateFontString(nil, "ART
|
||||
characterOverrideTitle:SetPoint("TOPLEFT", 16, -16)
|
||||
characterOverrideTitle:SetText("Character Override")
|
||||
|
||||
local characterOverrideSubtitle = characterOverridePanel:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||
characterOverrideSubtitle:SetPoint("TOPLEFT", characterOverrideTitle, "BOTTOMLEFT", 0, -4)
|
||||
characterOverrideSubtitle:SetTextColor(1, 1, 1)
|
||||
characterOverrideSubtitle:SetText("Override class settings for a character")
|
||||
|
||||
local overrideProfileDropdown = CreateFrame("Frame", "HideCoAUIOverrideProfileDropDown", characterOverridePanel, "UIDropDownMenuTemplate")
|
||||
overrideProfileDropdown:SetPoint("TOPLEFT", characterOverrideTitle, "BOTTOMLEFT", -16, -12)
|
||||
overrideProfileDropdown:SetPoint("TOPLEFT", characterOverrideSubtitle, "BOTTOMLEFT", -16, -12)
|
||||
|
||||
if ElvSkins then
|
||||
ElvSkins:HandleDropDownBox(overrideProfileDropdown, 180)
|
||||
@@ -545,18 +596,6 @@ end)
|
||||
|
||||
InterfaceOptions_AddCategory(characterOverridePanel)
|
||||
|
||||
-- ABOUT SUBCATEGORY --
|
||||
|
||||
local aboutPanel = CreateFrame("Frame")
|
||||
aboutPanel.name = "About"
|
||||
aboutPanel.parent = panel.name
|
||||
|
||||
local aboutTitle = aboutPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
|
||||
aboutTitle:SetPoint("TOPLEFT", 16, -16)
|
||||
aboutTitle:SetText("About")
|
||||
|
||||
InterfaceOptions_AddCategory(aboutPanel)
|
||||
|
||||
local function OpenOptions()
|
||||
InterfaceOptionsFrame_OpenToCategory(classesPanel)
|
||||
end
|
||||
@@ -1,24 +1,21 @@
|
||||
# HideCoAUI
|
||||
|
||||
A World of Warcraft 3.3.5 addon for Conquest of Azeroth (CoA) that lets you
|
||||
hide its custom class-resource frames.
|
||||
A World of Warcraft 3.3.5 addon for Conquest of Azeroth (CoA) that lets you hide its custom class-resource frames.
|
||||
The addon is early in development, and most frames have a generic name or aren't used at all depending on classes.
|
||||
|
||||
## Installation
|
||||
|
||||
[Download here](https://github.com/Narcasung/hide-coa-ui/releases/download/v0.1/HideCoAUI-v0.1.zip).
|
||||
[Download here](https://github.com/Narcasung/hide-coa-ui/archive/refs/heads/master.zip).
|
||||
|
||||
Drop the `HideCoAUI` folder into your `Interface\AddOns` directory.
|
||||
Extract the archive in your `Interface\AddOns` folder and remove the `-master`
|
||||
suffix from the extracted folder name.
|
||||
|
||||
## Usage
|
||||
|
||||
Open the options panel from `Interface > AddOns > HideCoAUI`. It has two
|
||||
subcategories:
|
||||
Open the options with /hidecoaui or in the interface options. It has two subcategories:
|
||||
|
||||
- **Classes** — pick a class from the sidebar and toggle which frames are
|
||||
hidden for it.
|
||||
- **Character Override** — assign a profile to the currently logged
|
||||
character, and optionally override its frame visibility independently of
|
||||
the assigned profile's class settings.
|
||||
- **Classes** — change global settings for each class.
|
||||
- **Character Override** — override global settings for your characters.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user