Compare commits
10 Commits
aaa7795287
...
041d67e331
| Author | SHA1 | Date | |
|---|---|---|---|
| 041d67e331 | |||
| 3547c3a356 | |||
| 894b208fb0 | |||
| 54c7a5e4da | |||
| cda62d1b98 | |||
| 7d55c8ea9a | |||
| 9c5282886f | |||
| f3a58b846d | |||
| 6165bbfe6e | |||
| fd4dbefb01 |
@@ -32,8 +32,35 @@ HideCoAUI.FRAMES = {
|
|||||||
"CoAResourceBar",
|
"CoAResourceBar",
|
||||||
"CoAMultiCastActionBarFrame",
|
"CoAMultiCastActionBarFrame",
|
||||||
-- "CoASpellActivationOverlay", -- found via full frame scan, deliberately left without a checkbox
|
-- "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 function CreateDefaultClassSettings()
|
||||||
|
|
||||||
local classSettings = {}
|
local classSettings = {}
|
||||||
@@ -41,7 +68,7 @@ local function CreateDefaultClassSettings()
|
|||||||
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||||
classSettings[class] = {}
|
classSettings[class] = {}
|
||||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[class][frameName] = true
|
classSettings[class][frameName] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -59,7 +86,7 @@ local function EnsureClassSettingsComplete(classSettings)
|
|||||||
|
|
||||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
if classSettings[class][frameName] == nil then
|
if classSettings[class][frameName] == nil then
|
||||||
classSettings[class][frameName] = true
|
classSettings[class][frameName] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -96,70 +123,17 @@ end
|
|||||||
|
|
||||||
HideCoAUI.SetActiveProfileName = SetActiveProfileName
|
HideCoAUI.SetActiveProfileName = SetActiveProfileName
|
||||||
|
|
||||||
local function GetActiveClassSettings()
|
local function GetClassSettings()
|
||||||
|
|
||||||
local name = GetActiveProfileName()
|
if not HideCoADB.classSettings then
|
||||||
local profile = HideCoADB.profiles[name]
|
HideCoADB.classSettings = CreateDefaultClassSettings()
|
||||||
|
|
||||||
if not profile then
|
|
||||||
profile = { classSettings = CreateDefaultClassSettings() }
|
|
||||||
HideCoADB.profiles[name] = profile
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if not profile.classSettings then
|
return HideCoADB.classSettings
|
||||||
profile.classSettings = CreateDefaultClassSettings()
|
|
||||||
end
|
|
||||||
|
|
||||||
return profile.classSettings
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoAUI.GetActiveClassSettings = GetActiveClassSettings
|
HideCoAUI.GetClassSettings = GetClassSettings
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
local function DeleteProfile(name)
|
local function DeleteProfile(name)
|
||||||
|
|
||||||
@@ -168,7 +142,7 @@ local function DeleteProfile(name)
|
|||||||
for charKey, assigned in pairs(HideCoADB.charProfile) do
|
for charKey, assigned in pairs(HideCoADB.charProfile) do
|
||||||
if assigned == name then
|
if assigned == name then
|
||||||
-- Unassigning falls back to the character's own auto-created
|
-- 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.
|
-- which gets recreated on demand if it doesn't exist.
|
||||||
HideCoADB.charProfile[charKey] = nil
|
HideCoADB.charProfile[charKey] = nil
|
||||||
end
|
end
|
||||||
@@ -183,7 +157,7 @@ local function EnsureProfileOverride(name)
|
|||||||
local profile = HideCoADB.profiles[name]
|
local profile = HideCoADB.profiles[name]
|
||||||
|
|
||||||
if not profile then
|
if not profile then
|
||||||
profile = { classSettings = CreateDefaultClassSettings() }
|
profile = {}
|
||||||
HideCoADB.profiles[name] = profile
|
HideCoADB.profiles[name] = profile
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -193,7 +167,7 @@ local function EnsureProfileOverride(name)
|
|||||||
|
|
||||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
if profile.override.frameSettings[frameName] == nil then
|
if profile.override.frameSettings[frameName] == nil then
|
||||||
profile.override.frameSettings[frameName] = true
|
profile.override.frameSettings[frameName] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -239,7 +213,7 @@ HideCoAUI.GetProfileNames = GetProfileNames
|
|||||||
|
|
||||||
local function SetAllClassesHidden(hide)
|
local function SetAllClassesHidden(hide)
|
||||||
|
|
||||||
local classSettings = GetActiveClassSettings()
|
local classSettings = GetClassSettings()
|
||||||
|
|
||||||
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
@@ -265,10 +239,10 @@ HideCoAUI.ShowAllFrames = ShowAllFrames
|
|||||||
|
|
||||||
local function ShouldHideForClass(playerClass, frameName)
|
local function ShouldHideForClass(playerClass, frameName)
|
||||||
|
|
||||||
local classSettings = GetActiveClassSettings()[playerClass]
|
local classSettings = GetClassSettings()[playerClass]
|
||||||
|
|
||||||
if not classSettings or classSettings[frameName] == nil then
|
if not classSettings or classSettings[frameName] == nil then
|
||||||
return true
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return classSettings[frameName]
|
return classSettings[frameName]
|
||||||
@@ -356,11 +330,24 @@ f:SetScript("OnEvent", function(self, event, arg1)
|
|||||||
HideCoADB.charProfile = {}
|
HideCoADB.charProfile = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Legacy pre-profile saved variables stored a single flat classSettings
|
-- An older saved-variable format duplicated classSettings per profile
|
||||||
-- table shared by every character. Fold it into whichever character
|
-- instead of sharing one account-wide table. Pull whichever profile
|
||||||
-- happens to load next so those hide/show choices don't just vanish.
|
-- still has one as the seed so existing hide/show choices survive
|
||||||
local legacyFlatClassSettings = HideCoADB.classSettings
|
-- the upgrade to a single global classSettings.
|
||||||
HideCoADB.classSettings = nil
|
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()
|
local charKey = GetCharacterKey()
|
||||||
|
|
||||||
@@ -395,14 +382,11 @@ f:SetScript("OnEvent", function(self, event, arg1)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not HideCoADB.profiles[charKey] then
|
if not HideCoADB.profiles[charKey] then
|
||||||
HideCoADB.profiles[charKey] = { classSettings = legacyFlatClassSettings or CreateDefaultClassSettings() }
|
HideCoADB.profiles[charKey] = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
for name, profile in pairs(HideCoADB.profiles) do
|
for name, profile in pairs(HideCoADB.profiles) do
|
||||||
if not profile.classSettings then
|
profile.classSettings = nil
|
||||||
profile.classSettings = CreateDefaultClassSettings()
|
|
||||||
end
|
|
||||||
EnsureClassSettingsComplete(profile.classSettings)
|
|
||||||
EnsureProfileOverride(name)
|
EnsureProfileOverride(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,8 +53,13 @@ local classesTitle = classesPanel:CreateFontString(nil, "ARTWORK", "GameFontNorm
|
|||||||
classesTitle:SetPoint("TOPLEFT", 16, -16)
|
classesTitle:SetPoint("TOPLEFT", 16, -16)
|
||||||
classesTitle:SetText("Classes")
|
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")
|
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:SetSize(100, 22)
|
||||||
hideAllButton:SetText("Hide All")
|
hideAllButton:SetText("Hide All")
|
||||||
|
|
||||||
@@ -172,7 +177,7 @@ for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
|||||||
return
|
return
|
||||||
end
|
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()
|
HideCoAUI.ApplySetting()
|
||||||
|
|
||||||
end)
|
end)
|
||||||
@@ -191,6 +196,27 @@ local TAB_HEIGHT = 18
|
|||||||
|
|
||||||
local hideClassButton, showClassButton
|
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)
|
local function SelectClass(class)
|
||||||
|
|
||||||
selectedClass = class
|
selectedClass = class
|
||||||
@@ -214,20 +240,40 @@ local function SelectClass(class)
|
|||||||
overrideNoticeText:Hide()
|
overrideNoticeText:Hide()
|
||||||
end
|
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
|
if overridden then
|
||||||
checks[frameName]:Disable()
|
check:Disable()
|
||||||
_G[checks[frameName]:GetName() .. "Text"]:SetTextColor(0.5, 0.5, 0.5)
|
_G[check:GetName() .. "Text"]:SetTextColor(0.5, 0.5, 0.5)
|
||||||
else
|
else
|
||||||
checks[frameName]:Enable()
|
check:Enable()
|
||||||
_G[checks[frameName]:GetName() .. "Text"]:SetTextColor(1, 1, 1)
|
_G[check:GetName() .. "Text"]:SetTextColor(1, 1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
previousCheckAnchor = check
|
||||||
|
previousCheckSpacing = -8
|
||||||
|
previousCheckXOffset = 0
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hideClassButton:ClearAllPoints()
|
||||||
|
hideClassButton:SetPoint("TOPLEFT", previousCheckAnchor, "BOTTOMLEFT", 0, -16)
|
||||||
|
|
||||||
if overridden then
|
if overridden then
|
||||||
hideClassButton:Disable()
|
hideClassButton:Disable()
|
||||||
showClassButton:Disable()
|
showClassButton:Disable()
|
||||||
@@ -267,7 +313,7 @@ hideClassButton:SetScript("OnClick", function()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local classSettings = HideCoAUI.GetActiveClassSettings()[selectedClass]
|
local classSettings = HideCoAUI.GetClassSettings()[selectedClass]
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[frameName] = true
|
classSettings[frameName] = true
|
||||||
@@ -286,7 +332,7 @@ showClassButton:SetScript("OnClick", function()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local classSettings = HideCoAUI.GetActiveClassSettings()[selectedClass]
|
local classSettings = HideCoAUI.GetClassSettings()[selectedClass]
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[frameName] = false
|
classSettings[frameName] = false
|
||||||
@@ -374,8 +420,13 @@ local characterOverrideTitle = characterOverridePanel:CreateFontString(nil, "ART
|
|||||||
characterOverrideTitle:SetPoint("TOPLEFT", 16, -16)
|
characterOverrideTitle:SetPoint("TOPLEFT", 16, -16)
|
||||||
characterOverrideTitle:SetText("Character Override")
|
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")
|
local overrideProfileDropdown = CreateFrame("Frame", "HideCoAUIOverrideProfileDropDown", characterOverridePanel, "UIDropDownMenuTemplate")
|
||||||
overrideProfileDropdown:SetPoint("TOPLEFT", characterOverrideTitle, "BOTTOMLEFT", -16, -12)
|
overrideProfileDropdown:SetPoint("TOPLEFT", characterOverrideSubtitle, "BOTTOMLEFT", -16, -12)
|
||||||
|
|
||||||
if ElvSkins then
|
if ElvSkins then
|
||||||
ElvSkins:HandleDropDownBox(overrideProfileDropdown, 180)
|
ElvSkins:HandleDropDownBox(overrideProfileDropdown, 180)
|
||||||
@@ -545,18 +596,6 @@ end)
|
|||||||
|
|
||||||
InterfaceOptions_AddCategory(characterOverridePanel)
|
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()
|
local function OpenOptions()
|
||||||
InterfaceOptionsFrame_OpenToCategory(classesPanel)
|
InterfaceOptionsFrame_OpenToCategory(classesPanel)
|
||||||
end
|
end
|
||||||
@@ -1,24 +1,21 @@
|
|||||||
# HideCoAUI
|
# HideCoAUI
|
||||||
|
|
||||||
A World of Warcraft 3.3.5 addon for Conquest of Azeroth (CoA) that lets you
|
A World of Warcraft 3.3.5 addon for Conquest of Azeroth (CoA) that lets you hide its custom class-resource frames.
|
||||||
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
|
## 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
|
## Usage
|
||||||
|
|
||||||
Open the options panel from `Interface > AddOns > HideCoAUI`. It has two
|
Open the options with /hidecoaui or in the interface options. It has two subcategories:
|
||||||
subcategories:
|
|
||||||
|
|
||||||
- **Classes** — pick a class from the sidebar and toggle which frames are
|
- **Classes** — change global settings for each class.
|
||||||
hidden for it.
|
- **Character Override** — override global settings for your characters.
|
||||||
- **Character Override** — assign a profile to the currently logged
|
|
||||||
character, and optionally override its frame visibility independently of
|
|
||||||
the assigned profile's class settings.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user