Rename addon from HideCoA to HideCoAUI
Moves addon files into a HideCoAUI subfolder (repo root now holds LICENSE/README for packaging), renames HideCoA.toc and the HideCoA.lua global table to HideCoAUI throughout, and fixes the ADDON_LOADED arg1 check accordingly. HideCoADB (SavedVariables) is left untouched to preserve existing user settings.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
HideCoA = {}
|
HideCoAUI = {}
|
||||||
|
|
||||||
local f = CreateFrame("Frame")
|
local f = CreateFrame("Frame")
|
||||||
|
|
||||||
HideCoA.CUSTOM_CLASSES = {
|
HideCoAUI.CUSTOM_CLASSES = {
|
||||||
"NECROMANCER",
|
"NECROMANCER",
|
||||||
"PYROMANCER",
|
"PYROMANCER",
|
||||||
"CULTIST",
|
"CULTIST",
|
||||||
@@ -26,7 +26,7 @@ HideCoA.CUSTOM_CLASSES = {
|
|||||||
"RANGER",
|
"RANGER",
|
||||||
}
|
}
|
||||||
|
|
||||||
HideCoA.FRAMES = {
|
HideCoAUI.FRAMES = {
|
||||||
"CoAResourceSegmentBar",
|
"CoAResourceSegmentBar",
|
||||||
"CoAResourceOrb",
|
"CoAResourceOrb",
|
||||||
"CoAResourceBar",
|
"CoAResourceBar",
|
||||||
@@ -37,9 +37,9 @@ local function CreateDefaultClassSettings()
|
|||||||
|
|
||||||
local classSettings = {}
|
local classSettings = {}
|
||||||
|
|
||||||
for _, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||||
classSettings[class] = {}
|
classSettings[class] = {}
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[class][frameName] = true
|
classSettings[class][frameName] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -50,13 +50,13 @@ end
|
|||||||
|
|
||||||
local function EnsureClassSettingsComplete(classSettings)
|
local function EnsureClassSettingsComplete(classSettings)
|
||||||
|
|
||||||
for _, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||||
|
|
||||||
if type(classSettings[class]) ~= "table" then
|
if type(classSettings[class]) ~= "table" then
|
||||||
classSettings[class] = {}
|
classSettings[class] = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.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] = true
|
||||||
end
|
end
|
||||||
@@ -72,7 +72,7 @@ local function GetCharacterKey()
|
|||||||
return UnitName("player") .. " - " .. className .. " - " .. GetRealmName()
|
return UnitName("player") .. " - " .. className .. " - " .. GetRealmName()
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.GetCharacterKey = GetCharacterKey
|
HideCoAUI.GetCharacterKey = GetCharacterKey
|
||||||
|
|
||||||
local function GetActiveProfileName()
|
local function GetActiveProfileName()
|
||||||
|
|
||||||
@@ -87,13 +87,13 @@ local function GetActiveProfileName()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.GetActiveProfileName = GetActiveProfileName
|
HideCoAUI.GetActiveProfileName = GetActiveProfileName
|
||||||
|
|
||||||
local function SetActiveProfileName(name)
|
local function SetActiveProfileName(name)
|
||||||
HideCoADB.charProfile[GetCharacterKey()] = name
|
HideCoADB.charProfile[GetCharacterKey()] = name
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.SetActiveProfileName = SetActiveProfileName
|
HideCoAUI.SetActiveProfileName = SetActiveProfileName
|
||||||
|
|
||||||
local function GetActiveClassSettings()
|
local function GetActiveClassSettings()
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ local function GetActiveClassSettings()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.GetActiveClassSettings = GetActiveClassSettings
|
HideCoAUI.GetActiveClassSettings = GetActiveClassSettings
|
||||||
|
|
||||||
local function CopyProfile(sourceName, destName)
|
local function CopyProfile(sourceName, destName)
|
||||||
|
|
||||||
@@ -138,11 +138,11 @@ local function CopyProfile(sourceName, destName)
|
|||||||
|
|
||||||
HideCoADB.profiles[destName].classSettings = copy
|
HideCoADB.profiles[destName].classSettings = copy
|
||||||
|
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.CopyProfile = CopyProfile
|
HideCoAUI.CopyProfile = CopyProfile
|
||||||
|
|
||||||
local function ResetProfile()
|
local function ResetProfile()
|
||||||
|
|
||||||
@@ -154,11 +154,11 @@ local function ResetProfile()
|
|||||||
|
|
||||||
HideCoADB.profiles[name].classSettings = CreateDefaultClassSettings()
|
HideCoADB.profiles[name].classSettings = CreateDefaultClassSettings()
|
||||||
|
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.ResetProfile = ResetProfile
|
HideCoAUI.ResetProfile = ResetProfile
|
||||||
|
|
||||||
local function DeleteProfile(name)
|
local function DeleteProfile(name)
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ local function DeleteProfile(name)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.DeleteProfile = DeleteProfile
|
HideCoAUI.DeleteProfile = DeleteProfile
|
||||||
|
|
||||||
local function EnsureProfileOverride(name)
|
local function EnsureProfileOverride(name)
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ local function EnsureProfileOverride(name)
|
|||||||
profile.override = { enabled = false, frameSettings = {} }
|
profile.override = { enabled = false, frameSettings = {} }
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.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] = true
|
||||||
end
|
end
|
||||||
@@ -204,21 +204,21 @@ local function GetProfileOverride(name)
|
|||||||
return EnsureProfileOverride(name)
|
return EnsureProfileOverride(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.GetProfileOverride = GetProfileOverride
|
HideCoAUI.GetProfileOverride = GetProfileOverride
|
||||||
|
|
||||||
local function SetProfileOverrideEnabled(name, enabled)
|
local function SetProfileOverrideEnabled(name, enabled)
|
||||||
GetProfileOverride(name).enabled = enabled
|
GetProfileOverride(name).enabled = enabled
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.SetProfileOverrideEnabled = SetProfileOverrideEnabled
|
HideCoAUI.SetProfileOverrideEnabled = SetProfileOverrideEnabled
|
||||||
|
|
||||||
local function SetProfileOverrideFrameHidden(name, frameName, hide)
|
local function SetProfileOverrideFrameHidden(name, frameName, hide)
|
||||||
GetProfileOverride(name).frameSettings[frameName] = hide
|
GetProfileOverride(name).frameSettings[frameName] = hide
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.SetProfileOverrideFrameHidden = SetProfileOverrideFrameHidden
|
HideCoAUI.SetProfileOverrideFrameHidden = SetProfileOverrideFrameHidden
|
||||||
|
|
||||||
local function GetProfileNames()
|
local function GetProfileNames()
|
||||||
|
|
||||||
@@ -234,14 +234,14 @@ local function GetProfileNames()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.GetProfileNames = GetProfileNames
|
HideCoAUI.GetProfileNames = GetProfileNames
|
||||||
|
|
||||||
local function SetAllClassesHidden(hide)
|
local function SetAllClassesHidden(hide)
|
||||||
|
|
||||||
local classSettings = GetActiveClassSettings()
|
local classSettings = GetActiveClassSettings()
|
||||||
|
|
||||||
for _, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
for _, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[class][frameName] = hide
|
classSettings[class][frameName] = hide
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -250,17 +250,17 @@ end
|
|||||||
|
|
||||||
local function HideAllFrames()
|
local function HideAllFrames()
|
||||||
SetAllClassesHidden(true)
|
SetAllClassesHidden(true)
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.HideAllFrames = HideAllFrames
|
HideCoAUI.HideAllFrames = HideAllFrames
|
||||||
|
|
||||||
local function ShowAllFrames()
|
local function ShowAllFrames()
|
||||||
SetAllClassesHidden(false)
|
SetAllClassesHidden(false)
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.ShowAllFrames = ShowAllFrames
|
HideCoAUI.ShowAllFrames = ShowAllFrames
|
||||||
|
|
||||||
local function ShouldHideForClass(playerClass, frameName)
|
local function ShouldHideForClass(playerClass, frameName)
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ local seenNaturalShow = {}
|
|||||||
|
|
||||||
local function ApplySetting()
|
local function ApplySetting()
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
|
|
||||||
local frame = _G[frameName]
|
local frame = _G[frameName]
|
||||||
|
|
||||||
@@ -334,14 +334,14 @@ local function ApplySetting()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.ApplySetting = ApplySetting
|
HideCoAUI.ApplySetting = ApplySetting
|
||||||
|
|
||||||
f:RegisterEvent("ADDON_LOADED")
|
f:RegisterEvent("ADDON_LOADED")
|
||||||
f:RegisterEvent("PLAYER_LOGIN")
|
f:RegisterEvent("PLAYER_LOGIN")
|
||||||
|
|
||||||
f:SetScript("OnEvent", function(self, event, arg1)
|
f:SetScript("OnEvent", function(self, event, arg1)
|
||||||
|
|
||||||
if event == "ADDON_LOADED" and arg1 == "HideCoA" then
|
if event == "ADDON_LOADED" and arg1 == "HideCoAUI" then
|
||||||
|
|
||||||
if not HideCoADB then
|
if not HideCoADB then
|
||||||
HideCoADB = {}
|
HideCoADB = {}
|
||||||
@@ -6,5 +6,5 @@
|
|||||||
## SavedVariables: HideCoADB
|
## SavedVariables: HideCoADB
|
||||||
## OptionalDeps: ElvUI
|
## OptionalDeps: ElvUI
|
||||||
|
|
||||||
HideCoA.lua
|
HideCoAUI.lua
|
||||||
Options.lua
|
Options.lua
|
||||||
@@ -53,12 +53,12 @@ local classesTitle = classesPanel:CreateFontString(nil, "ARTWORK", "GameFontNorm
|
|||||||
classesTitle:SetPoint("TOPLEFT", 16, -16)
|
classesTitle:SetPoint("TOPLEFT", 16, -16)
|
||||||
classesTitle:SetText("Classes")
|
classesTitle:SetText("Classes")
|
||||||
|
|
||||||
local hideAllButton = CreateFrame("Button", "HideCoAHideAllButton", classesPanel, "UIPanelButtonTemplate")
|
local hideAllButton = CreateFrame("Button", "HideCoAUIHideAllButton", classesPanel, "UIPanelButtonTemplate")
|
||||||
hideAllButton:SetPoint("TOPLEFT", classesTitle, "BOTTOMLEFT", 0, -12)
|
hideAllButton:SetPoint("TOPLEFT", classesTitle, "BOTTOMLEFT", 0, -12)
|
||||||
hideAllButton:SetSize(100, 22)
|
hideAllButton:SetSize(100, 22)
|
||||||
hideAllButton:SetText("Hide All")
|
hideAllButton:SetText("Hide All")
|
||||||
|
|
||||||
local showAllButton = CreateFrame("Button", "HideCoAShowAllButton", classesPanel, "UIPanelButtonTemplate")
|
local showAllButton = CreateFrame("Button", "HideCoAUIShowAllButton", classesPanel, "UIPanelButtonTemplate")
|
||||||
showAllButton:SetPoint("LEFT", hideAllButton, "RIGHT", 8, 0)
|
showAllButton:SetPoint("LEFT", hideAllButton, "RIGHT", 8, 0)
|
||||||
showAllButton:SetSize(100, 22)
|
showAllButton:SetSize(100, 22)
|
||||||
showAllButton:SetText("Show All")
|
showAllButton:SetText("Show All")
|
||||||
@@ -153,9 +153,9 @@ local previousAnchor = classLabelHeader
|
|||||||
local previousSpacing = -19
|
local previousSpacing = -19
|
||||||
local previousXOffset = 16
|
local previousXOffset = 16
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
|
|
||||||
local check = CreateFrame("CheckButton", "HideCoAClassCheck" .. frameName, classContent, "InterfaceOptionsCheckButtonTemplate")
|
local check = CreateFrame("CheckButton", "HideCoAUIClassCheck" .. frameName, classContent, "InterfaceOptionsCheckButtonTemplate")
|
||||||
check:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", previousXOffset, previousSpacing)
|
check:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", previousXOffset, previousSpacing)
|
||||||
|
|
||||||
_G[check:GetName() .. "Text"]:SetText("Hide " .. frameName)
|
_G[check:GetName() .. "Text"]:SetText("Hide " .. frameName)
|
||||||
@@ -172,8 +172,8 @@ for _, frameName in ipairs(HideCoA.FRAMES) do
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.GetActiveClassSettings()[selectedClass][self.frameName] = self:GetChecked() and true or false
|
HideCoAUI.GetActiveClassSettings()[selectedClass][self.frameName] = self:GetChecked() and true or false
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ local function SelectClass(class)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local _, ownClass = UnitClass("player")
|
local _, ownClass = UnitClass("player")
|
||||||
local overridden = (class == ownClass) and HideCoA.GetProfileOverride(HideCoA.GetActiveProfileName()).enabled
|
local overridden = (class == ownClass) and HideCoAUI.GetProfileOverride(HideCoAUI.GetActiveProfileName()).enabled
|
||||||
|
|
||||||
if overridden then
|
if overridden then
|
||||||
overrideNoticeText:Show()
|
overrideNoticeText:Show()
|
||||||
@@ -214,9 +214,9 @@ local function SelectClass(class)
|
|||||||
overrideNoticeText:Hide()
|
overrideNoticeText:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
|
|
||||||
checks[frameName]:SetChecked(HideCoA.GetActiveClassSettings()[class][frameName])
|
checks[frameName]:SetChecked(HideCoAUI.GetActiveClassSettings()[class][frameName])
|
||||||
|
|
||||||
if overridden then
|
if overridden then
|
||||||
checks[frameName]:Disable()
|
checks[frameName]:Disable()
|
||||||
@@ -246,12 +246,12 @@ local function SelectClass(class)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hideClassButton = CreateFrame("Button", "HideCoAHideClassButton", classContent, "UIPanelButtonTemplate")
|
hideClassButton = CreateFrame("Button", "HideCoAUIHideClassButton", classContent, "UIPanelButtonTemplate")
|
||||||
hideClassButton:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", 0, -16)
|
hideClassButton:SetPoint("TOPLEFT", previousAnchor, "BOTTOMLEFT", 0, -16)
|
||||||
hideClassButton:SetSize(140, 22)
|
hideClassButton:SetSize(140, 22)
|
||||||
hideClassButton:SetText("Hide This Class")
|
hideClassButton:SetText("Hide This Class")
|
||||||
|
|
||||||
showClassButton = CreateFrame("Button", "HideCoAShowClassButton", classContent, "UIPanelButtonTemplate")
|
showClassButton = CreateFrame("Button", "HideCoAUIShowClassButton", classContent, "UIPanelButtonTemplate")
|
||||||
showClassButton:SetPoint("LEFT", hideClassButton, "RIGHT", 8, 0)
|
showClassButton:SetPoint("LEFT", hideClassButton, "RIGHT", 8, 0)
|
||||||
showClassButton:SetSize(140, 22)
|
showClassButton:SetSize(140, 22)
|
||||||
showClassButton:SetText("Show This Class")
|
showClassButton:SetText("Show This Class")
|
||||||
@@ -267,13 +267,13 @@ hideClassButton:SetScript("OnClick", function()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local classSettings = HideCoA.GetActiveClassSettings()[selectedClass]
|
local classSettings = HideCoAUI.GetActiveClassSettings()[selectedClass]
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[frameName] = true
|
classSettings[frameName] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
SelectClass(selectedClass)
|
SelectClass(selectedClass)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
@@ -286,22 +286,22 @@ showClassButton:SetScript("OnClick", function()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local classSettings = HideCoA.GetActiveClassSettings()[selectedClass]
|
local classSettings = HideCoAUI.GetActiveClassSettings()[selectedClass]
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
classSettings[frameName] = false
|
classSettings[frameName] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
HideCoA.ApplySetting()
|
HideCoAUI.ApplySetting()
|
||||||
SelectClass(selectedClass)
|
SelectClass(selectedClass)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
AddClickSound(showClassButton)
|
AddClickSound(showClassButton)
|
||||||
|
|
||||||
for index, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
for index, class in ipairs(HideCoAUI.CUSTOM_CLASSES) do
|
||||||
|
|
||||||
local button = CreateFrame("Button", "HideCoAClassTab" .. class, classSidebar)
|
local button = CreateFrame("Button", "HideCoAUIClassTab" .. class, classSidebar)
|
||||||
button:SetHeight(TAB_HEIGHT)
|
button:SetHeight(TAB_HEIGHT)
|
||||||
button:SetPoint("TOPLEFT", classSidebar, "TOPLEFT", 4, -4 - (index - 1) * TAB_HEIGHT)
|
button:SetPoint("TOPLEFT", classSidebar, "TOPLEFT", 4, -4 - (index - 1) * TAB_HEIGHT)
|
||||||
button:SetPoint("RIGHT", classSidebar, "RIGHT", -4, 0)
|
button:SetPoint("RIGHT", classSidebar, "RIGHT", -4, 0)
|
||||||
@@ -335,7 +335,7 @@ for index, class in ipairs(HideCoA.CUSTOM_CLASSES) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
hideAllButton:SetScript("OnClick", function()
|
hideAllButton:SetScript("OnClick", function()
|
||||||
HideCoA.HideAllFrames()
|
HideCoAUI.HideAllFrames()
|
||||||
if selectedClass then
|
if selectedClass then
|
||||||
SelectClass(selectedClass)
|
SelectClass(selectedClass)
|
||||||
end
|
end
|
||||||
@@ -344,7 +344,7 @@ end)
|
|||||||
AddClickSound(hideAllButton)
|
AddClickSound(hideAllButton)
|
||||||
|
|
||||||
showAllButton:SetScript("OnClick", function()
|
showAllButton:SetScript("OnClick", function()
|
||||||
HideCoA.ShowAllFrames()
|
HideCoAUI.ShowAllFrames()
|
||||||
if selectedClass then
|
if selectedClass then
|
||||||
SelectClass(selectedClass)
|
SelectClass(selectedClass)
|
||||||
end
|
end
|
||||||
@@ -359,7 +359,7 @@ classesPanel:SetScript("OnShow", function()
|
|||||||
selectedClass = ownClass
|
selectedClass = ownClass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
SelectClass(selectedClass or HideCoA.CUSTOM_CLASSES[1])
|
SelectClass(selectedClass or HideCoAUI.CUSTOM_CLASSES[1])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
InterfaceOptions_AddCategory(classesPanel)
|
InterfaceOptions_AddCategory(classesPanel)
|
||||||
@@ -374,7 +374,7 @@ 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 overrideProfileDropdown = CreateFrame("Frame", "HideCoAOverrideProfileDropDown", characterOverridePanel, "UIDropDownMenuTemplate")
|
local overrideProfileDropdown = CreateFrame("Frame", "HideCoAUIOverrideProfileDropDown", characterOverridePanel, "UIDropDownMenuTemplate")
|
||||||
overrideProfileDropdown:SetPoint("TOPLEFT", characterOverrideTitle, "BOTTOMLEFT", -16, -12)
|
overrideProfileDropdown:SetPoint("TOPLEFT", characterOverrideTitle, "BOTTOMLEFT", -16, -12)
|
||||||
|
|
||||||
if ElvSkins then
|
if ElvSkins then
|
||||||
@@ -383,7 +383,7 @@ end
|
|||||||
|
|
||||||
UIDropDownMenu_SetWidth(overrideProfileDropdown, 180)
|
UIDropDownMenu_SetWidth(overrideProfileDropdown, 180)
|
||||||
|
|
||||||
local deleteProfileButton = CreateFrame("Button", "HideCoADeleteProfileButton", characterOverridePanel, "UIPanelButtonTemplate")
|
local deleteProfileButton = CreateFrame("Button", "HideCoAUIDeleteProfileButton", characterOverridePanel, "UIPanelButtonTemplate")
|
||||||
local overrideProfileDropdownArrow = _G[overrideProfileDropdown:GetName() .. "Button"]
|
local overrideProfileDropdownArrow = _G[overrideProfileDropdown:GetName() .. "Button"]
|
||||||
deleteProfileButton:SetPoint("LEFT", overrideProfileDropdownArrow or overrideProfileDropdown, "RIGHT", 8, 2)
|
deleteProfileButton:SetPoint("LEFT", overrideProfileDropdownArrow or overrideProfileDropdown, "RIGHT", 8, 2)
|
||||||
deleteProfileButton:SetSize(110, 22)
|
deleteProfileButton:SetSize(110, 22)
|
||||||
@@ -398,7 +398,7 @@ deleteProfileBlockedText:SetPoint("TOPLEFT", overrideProfileDropdown, "BOTTOMLEF
|
|||||||
deleteProfileBlockedText:SetText("Can't delete currently logged character profile")
|
deleteProfileBlockedText:SetText("Can't delete currently logged character profile")
|
||||||
deleteProfileBlockedText:Hide()
|
deleteProfileBlockedText:Hide()
|
||||||
|
|
||||||
local overrideEnabledCheck = CreateFrame("CheckButton", "HideCoAOverrideEnabledCheck", characterOverridePanel, "InterfaceOptionsCheckButtonTemplate")
|
local overrideEnabledCheck = CreateFrame("CheckButton", "HideCoAUIOverrideEnabledCheck", characterOverridePanel, "InterfaceOptionsCheckButtonTemplate")
|
||||||
overrideEnabledCheck:SetPoint("TOPLEFT", deleteProfileBlockedText, "BOTTOMLEFT", 0, -28)
|
overrideEnabledCheck:SetPoint("TOPLEFT", deleteProfileBlockedText, "BOTTOMLEFT", 0, -28)
|
||||||
_G[overrideEnabledCheck:GetName() .. "Text"]:SetText("Override class options for this character")
|
_G[overrideEnabledCheck:GetName() .. "Text"]:SetText("Override class options for this character")
|
||||||
|
|
||||||
@@ -412,9 +412,9 @@ local selectedOverrideProfile = nil
|
|||||||
local overridePreviousAnchor = overrideEnabledCheck
|
local overridePreviousAnchor = overrideEnabledCheck
|
||||||
local overridePreviousSpacing = -16
|
local overridePreviousSpacing = -16
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
|
|
||||||
local check = CreateFrame("CheckButton", "HideCoAOverrideCheck" .. frameName, characterOverridePanel, "InterfaceOptionsCheckButtonTemplate")
|
local check = CreateFrame("CheckButton", "HideCoAUIOverrideCheck" .. frameName, characterOverridePanel, "InterfaceOptionsCheckButtonTemplate")
|
||||||
check:SetPoint("TOPLEFT", overridePreviousAnchor, "BOTTOMLEFT", 0, overridePreviousSpacing)
|
check:SetPoint("TOPLEFT", overridePreviousAnchor, "BOTTOMLEFT", 0, overridePreviousSpacing)
|
||||||
_G[check:GetName() .. "Text"]:SetText("Hide " .. frameName)
|
_G[check:GetName() .. "Text"]:SetText("Hide " .. frameName)
|
||||||
|
|
||||||
@@ -426,7 +426,7 @@ for _, frameName in ipairs(HideCoA.FRAMES) do
|
|||||||
|
|
||||||
check:SetScript("OnClick", function(self)
|
check:SetScript("OnClick", function(self)
|
||||||
if selectedOverrideProfile then
|
if selectedOverrideProfile then
|
||||||
HideCoA.SetProfileOverrideFrameHidden(selectedOverrideProfile, self.frameName, self:GetChecked() and true or false)
|
HideCoAUI.SetProfileOverrideFrameHidden(selectedOverrideProfile, self.frameName, self:GetChecked() and true or false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -456,11 +456,11 @@ local function RefreshCharacterOverrideTab()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local override = HideCoA.GetProfileOverride(selectedOverrideProfile)
|
local override = HideCoAUI.GetProfileOverride(selectedOverrideProfile)
|
||||||
|
|
||||||
overrideEnabledCheck:SetChecked(override.enabled)
|
overrideEnabledCheck:SetChecked(override.enabled)
|
||||||
|
|
||||||
for _, frameName in ipairs(HideCoA.FRAMES) do
|
for _, frameName in ipairs(HideCoAUI.FRAMES) do
|
||||||
overrideChecks[frameName]:SetChecked(override.frameSettings[frameName])
|
overrideChecks[frameName]:SetChecked(override.frameSettings[frameName])
|
||||||
SetOverrideCheckEnabled(overrideChecks[frameName], override.enabled)
|
SetOverrideCheckEnabled(overrideChecks[frameName], override.enabled)
|
||||||
end
|
end
|
||||||
@@ -472,7 +472,7 @@ local function SelectOverrideProfile(name)
|
|||||||
UIDropDownMenu_SetText(overrideProfileDropdown, name)
|
UIDropDownMenu_SetText(overrideProfileDropdown, name)
|
||||||
RefreshCharacterOverrideTab()
|
RefreshCharacterOverrideTab()
|
||||||
|
|
||||||
if name == HideCoA.GetActiveProfileName() then
|
if name == HideCoAUI.GetActiveProfileName() then
|
||||||
deleteProfileButton:Disable()
|
deleteProfileButton:Disable()
|
||||||
deleteProfileBlockedText:Show()
|
deleteProfileBlockedText:Show()
|
||||||
else
|
else
|
||||||
@@ -491,7 +491,7 @@ UIDropDownMenu_Initialize(overrideProfileDropdown, function(self, level)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, name in ipairs(HideCoA.GetProfileNames()) do
|
for _, name in ipairs(HideCoAUI.GetProfileNames()) do
|
||||||
|
|
||||||
local info = UIDropDownMenu_CreateInfo()
|
local info = UIDropDownMenu_CreateInfo()
|
||||||
info.text = name
|
info.text = name
|
||||||
@@ -507,7 +507,7 @@ end)
|
|||||||
|
|
||||||
overrideEnabledCheck:SetScript("OnClick", function(self)
|
overrideEnabledCheck:SetScript("OnClick", function(self)
|
||||||
if selectedOverrideProfile then
|
if selectedOverrideProfile then
|
||||||
HideCoA.SetProfileOverrideEnabled(selectedOverrideProfile, self:GetChecked() and true or false)
|
HideCoAUI.SetProfileOverrideEnabled(selectedOverrideProfile, self:GetChecked() and true or false)
|
||||||
RefreshCharacterOverrideTab()
|
RefreshCharacterOverrideTab()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -519,8 +519,8 @@ StaticPopupDialogs["HIDECOA_DELETE_PROFILE"] = {
|
|||||||
button1 = "Delete",
|
button1 = "Delete",
|
||||||
button2 = "Cancel",
|
button2 = "Cancel",
|
||||||
OnAccept = function(self, profileName)
|
OnAccept = function(self, profileName)
|
||||||
HideCoA.DeleteProfile(profileName)
|
HideCoAUI.DeleteProfile(profileName)
|
||||||
SelectOverrideProfile(HideCoA.GetActiveProfileName())
|
SelectOverrideProfile(HideCoAUI.GetActiveProfileName())
|
||||||
end,
|
end,
|
||||||
timeout = 0,
|
timeout = 0,
|
||||||
whileDead = 1,
|
whileDead = 1,
|
||||||
@@ -529,7 +529,7 @@ StaticPopupDialogs["HIDECOA_DELETE_PROFILE"] = {
|
|||||||
|
|
||||||
deleteProfileButton:SetScript("OnClick", function()
|
deleteProfileButton:SetScript("OnClick", function()
|
||||||
|
|
||||||
if not selectedOverrideProfile or selectedOverrideProfile == HideCoA.GetActiveProfileName() then
|
if not selectedOverrideProfile or selectedOverrideProfile == HideCoAUI.GetActiveProfileName() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ end)
|
|||||||
AddClickSound(deleteProfileButton)
|
AddClickSound(deleteProfileButton)
|
||||||
|
|
||||||
characterOverridePanel:SetScript("OnShow", function()
|
characterOverridePanel:SetScript("OnShow", function()
|
||||||
SelectOverrideProfile(selectedOverrideProfile or HideCoA.GetActiveProfileName())
|
SelectOverrideProfile(selectedOverrideProfile or HideCoAUI.GetActiveProfileName())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
InterfaceOptions_AddCategory(characterOverridePanel)
|
InterfaceOptions_AddCategory(characterOverridePanel)
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
# HideCoA
|
# 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.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Drop the `HideCoA` folder into your `Interface\AddOns` directory.
|
Drop the `HideCoAUI` folder into your `Interface\AddOns` directory.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user