Skip to content

Commit

Permalink
Fix #922
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviana committed Jul 22, 2022
1 parent 76cdb8e commit c4efa67
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 7 deletions.
46 changes: 41 additions & 5 deletions LunaUnitFrames.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Luna Unit Frames 4.0 by Aviana

LUF = select(2, ...)
LUF.version = 4280
LUF.version = 4290

local L = LUF.L
local ACR = LibStub("AceConfigRegistry-3.0", true)
Expand Down Expand Up @@ -33,6 +33,35 @@ LUF.stateMonitor:WrapScript(LUF.stateMonitor, "OnAttributeChanged", [[
local setting = self:GetAttribute("hideraid")
local showParty = setting == "never" or status ~= "full" and setting == "5man" or setting == "always" and status == "none"
local frame
if self:GetAttribute("hideParty") and status ~= "full" and self:GetAttribute("showWhen") == "RAID" then
frame =self:GetFrameRef("raidpet")
if frame then
frame:SetAttribute("raidHidden",true)
frame:Hide()
end
for i=1, 9 do
frame = self:GetFrameRef("raid"..i)
if frame then
frame:SetAttribute("raidHidden",true)
frame:Hide()
end
end
else
frame = self:GetFrameRef("raidpet")
if frame and frame:GetAttribute("isEnabled") then
frame:SetAttribute("raidHidden",nil)
frame:Show()
end
for i=1, 9 do
frame = self:GetFrameRef("raid"..i)
if frame and frame:GetAttribute("isEnabled") then
frame:SetAttribute("raidHidden",nil)
frame:Show()
end
end
end
if partyFrame and self:GetAttribute("partyEnabled") then
partyFrame:SetAttribute("raidHidden", not showParty)
if showParty then
Expand Down Expand Up @@ -1356,20 +1385,25 @@ function LUF:SpawnUnits()
for unit,frame in pairs(self.frameIndex) do
frame:SetFrameStrata(self.db.profile.strata)
end
local config = self.db.profile.units
self.stateMonitor:SetFrameRef("partyFrame", self.frameIndex["party"])
self.stateMonitor:SetFrameRef("partytargetFrame", self.frameIndex["partytarget"])
self.stateMonitor:SetFrameRef("partypetFrame", self.frameIndex["partypet"])
self.stateMonitor:SetAttribute("partyEnabled", self.db.profile.units.party.enabled)
self.stateMonitor:SetAttribute("partytargetEnabled", self.db.profile.units.partytarget.enabled)
self.stateMonitor:SetAttribute("partypetEnabled", self.db.profile.units.partypet.enabled)
self.stateMonitor:SetAttribute("hideraid", self.db.profile.units.party.hideraid)
self.stateMonitor:SetAttribute("partyEnabled", config.party.enabled)
self.stateMonitor:SetAttribute("partytargetEnabled", config.partytarget.enabled)
self.stateMonitor:SetAttribute("partypetEnabled", config.partypet.enabled)
self.stateMonitor:SetAttribute("hideraid", config.party.hideraid)
self.stateMonitor:SetAttribute("hideParty", config.raid.hideParty)
self.stateMonitor:SetAttribute("showWhen", (not config.raid.showSolo and not config.raid.showPlayer and not config.raid.showParty) and "RAID" or nil)
RegisterStateDriver(self.stateMonitor, "raidstatus", "[target=raid6, exists] full; [target=raid1, exists] semi; none")
for i=1, 9 do
local frame
if i == 9 then
frame = self.frameIndex["raidpet"]
self.stateMonitor:SetFrameRef("raidpet", frame)
else
frame = self.frameIndex["raid"..i]
self.stateMonitor:SetFrameRef("raid"..i, frame)
end
local child = frame:GetChildren()
frame.grpNumber = child:CreateFontString(nil, "ARTWORK")
Expand All @@ -1387,11 +1421,13 @@ end
local function SetHeaderAttributes(header, config)
if not config.enabled or config.filters and not config.filters[tonumber(strmatch(header:GetName(),".+(%d)"))] then
header:Hide()
header:SetAttribute("isEnabled", nil)
return
end
local xMod = config.attribPoint == "LEFT" and 1 or config.attribPoint == "RIGHT" and -1 or 0
local yMod = config.attribPoint == "TOP" and -1 or config.attribPoint == "BOTTOM" and 1 or 0
header:SetAttribute("_ignore", "attributeChanges")
header:SetAttribute("isEnabled", true)
header:SetAttribute("showParty", config.showParty)
header:SetAttribute("showRaid", config.showRaid)
header:SetAttribute("showSolo", config.showSolo)
Expand Down
2 changes: 1 addition & 1 deletion LunaUnitFrames.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Luna Unit Frames
## Notes:
## Author: Aviana
## Version: 4280
## Version: 4290
## SavedVariables: LunaUFDB
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, Clique
## X-License: WTFPL (http://www.wtfpl.net/about/)
Expand Down
2 changes: 2 additions & 0 deletions locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ local L = {
["Set the space between units."] = "Setze den Abstand zwischen Einheiten.",
["Show when"] = "Zeige wenn",
["Show even smaller groups than a raid in the raidframe"] = "Zeige auch kleinere Gruppen als Schlachtz\195\188ge im Schlachtzug",
["Hide < 6 Raid"] = "Verstecke < 6 Schlachtzug",
["Hide when 5 or less people in raid"] = "Verstecke den Schlachtzug bei unter 6 Spielern",
["Squares"] = "Vierecke",
["What the indicator should display."] = "Was der Indikator anzeigen soll.",
["Name (exact) or ID"] = "Name (exakt) oder ID",
Expand Down
2 changes: 2 additions & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ local L = {
["Set the space between units."] = "Set the space between units.",
["Show when"] = "Show when",
["Show even smaller groups than a raid in the raidframe"] = "Show even smaller groups than a raid in the raidframe",
["Hide < 6 Raid"] = "Hide < 6 Raid",
["Hide when 5 or less people in raid"] = "Hide when 5 or less people in raid",
["Squares"] = "Squares",
["What the indicator should display."] = "What the indicator should display.",
["Name (exact) or ID"] = "Name (exact) or ID",
Expand Down
2 changes: 2 additions & 0 deletions locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ local L = {
["Set the space between units."] = "유닛 사이의 간격을 설정합니다.",
["Show when"] = "표시 상황",
["Show even smaller groups than a raid in the raidframe"] = "공격대 프레임에서 공격대보다 작은 그룹에도 표시합니다.",
["Hide < 6 Raid"] = "Hide < 6 Raid",
["Hide when 5 or less people in raid"] = "Hide when 5 or less people in raid",
["Squares"] = "지시기",
["What the indicator should display."] = "지시기가 표시할 항목을 설정합니다.",
["Name (exact) or ID"] = "(정확한) 이름 또는 ID",
Expand Down
2 changes: 2 additions & 0 deletions locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ local L = {
["Set the space between units."] = "设置单位间隔。",
["Show when"] = "何时显示",
["Show even smaller groups than a raid in the raidframe"] = "使用团队框架显示队伍",
["Hide < 6 Raid"] = "Hide < 6 Raid",
["Hide when 5 or less people in raid"] = "Hide when 5 or less people in raid",
["Squares"] = "自定义指示器",
["What the indicator should display."] = "指示器要显示什么。",
["Name (exact) or ID"] = "正确法术全名 或者 ID",
Expand Down
2 changes: 2 additions & 0 deletions locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ local L = {
["Set the space between units."] = "設定單位間隔。",
["Show when"] = "何時顯示",
["Show even smaller groups than a raid in the raidframe"] = "使用團隊框架顯示隊伍",
["Hide < 6 Raid"] = "Hide < 6 Raid",
["Hide when 5 or less people in raid"] = "Hide when 5 or less people in raid",
["Squares"] = "自訂邊角指示器",
["What the indicator should display."] = "指示器要顯示什麼。",
["Name (exact) or ID"] = "正確全名 或者 ID",
Expand Down
19 changes: 18 additions & 1 deletion modules/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ function LUF:CreateConfig()
end
LUF:SetupHeader("raid")
LUF:SetupHeader("raidpet")
LUF.stateMonitor:SetAttribute("showWhen", value)
end

local function Lockdown() return LUF.InCombatLockdown end
Expand Down Expand Up @@ -6534,6 +6535,14 @@ function LUF:CreateConfig()
set = setShowWhen,
disabled = Lockdown,
},
hideParty = {
name = L["Hide < 6 Raid"],
desc = L["Hide when 5 or less people in raid"],
type = "toggle",
order = 2.35,
disabled = function() return LUF.db.profile.units.raid.showParty or (LUF.db.profile.units.raid.showSolo and LUF.db.profile.units.raid.showPlayer) or Lockdown() end,
set = function(info, value) set(info, value) LUF.stateMonitor:SetAttribute("hideParty", LUF.db.profile.units.raid.hideParty) end,
},
groupnumbers = {
name = L["Groupnumbers"],
desc = L["Show Groupnumbers next to the group"],
Expand Down Expand Up @@ -7148,12 +7157,20 @@ function LUF:CreateConfig()
name = L["Show when"],
desc = string.format(L["This is set through %s options."],RAID),
type = "select",
order = 2.92,
order = 2.921,
values = {["ALWAYS"] = ALWAYS,["PARTY"] = PARTY, ["RAID"] = RAID},
get = getShowWhen,
set = function(info,value) end,
disabled = true,
},
hideParty = {
name = L["Hide < 6 Raid"],
desc = string.format(L["This is set through %s options."],RAID),
type = "toggle",
order = 2.922,
get = function(info) return LUF.db.profile.units.raid.hideParty end,
disabled = true,
},
unitsPerColumn = {
name = L["Units per column"],
desc = L["The amount of units until a new column is started"],
Expand Down

0 comments on commit c4efa67

Please sign in to comment.