Skip to content

Commit

Permalink
Essential fixes
Browse files Browse the repository at this point in the history
Fix #532
Fix #519
Fix #511
Fix #476
  • Loading branch information
Aviana committed Oct 2, 2019
1 parent acee795 commit 78c99e2
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 101 deletions.
2 changes: 1 addition & 1 deletion LunaUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local L = LunaUF.L
local ACR = LibStub("AceConfigRegistry-3.0", true)
LunaUF.version = 3036
LunaUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "party", "partytarget", "partypet", "raid", "raidpet", "maintank", "maintanktarget", "mainassist", "mainassisttarget"}
LunaUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true}
LunaUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true}
LunaUF.enabledUnits = {}
LunaUF.modules = {}
LunaUF.moduleOrder = {}
Expand Down
9 changes: 7 additions & 2 deletions locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ local L = {
["Bottom left"] = "Unten links",
["Top"] = "Oben",
["Bottom"] = "Unten",
["Inside"] = "Inside",
["Inside Center"] = "Inside Center",
["Set the tags."] = "Setze die Tags.",
["Font Size"] = "Schriftgr\195\182sse",
["Set the font size."] = "Setze die Schriftgr\195\182sse.",
Expand Down Expand Up @@ -214,7 +216,7 @@ local L = {
["Highlight the frames borders when the unit is targeted"] = "F\195\164rbe die Fensterr\195\164nder wenn die Einheit im Ziel ist",
["Highlight the frames borders when the unit is moused over"] = "F\195\164rbe die Fensterr\195\164nder wenn die Einheit unter der Maus ist",
["Highlight the frames borders when the unit has aggro"] = "F\195\164rbe die Fensterr\195\164nder wenn die Einheit unter Bedrohung steht",
["Highlight the frames borders when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "F\195\164rbe die Fensterr\195\164nder wenn die Einheit einen Schw\195\164chungszauber hat, den du (grauer Haken) oder irgendjemand (goldener Haken entfernen kann.",
["Highlight the frames borders when the unit has a debuff you or someone can remove"] = "F\195\164rbe die Fensterr\195\164nder wenn die Einheit einen Schw\195\164chungszauber hat, den du oder irgendjemand entfernen kann.",
["Highlight"] = "Hervorheben",
["On target"] = "Bei Ziel",
["Highlight the frame when the unit is targeted"] = "Hebe das Fenster hervor wenn die Einheit das Ziel ist",
Expand All @@ -223,7 +225,10 @@ local L = {
["On aggro"] = "Bei Bedrohung",
["Highlight the frame when the unit has aggro"] = "Hebe das Fenster hervor wenn die Einheit bedroht ist",
["On debuff"] = "Bei Schw\195\164chezauber",
["Highlight the frame when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "Hebe das Fenster hervor wenn die Einheit einen Schw\195\164chungszauber hat, den du (grauer Haken) oder irgendjemand (goldener Haken entfernen kann.",
["Highlight the frame when the unit has a debuff you or someone can remove"] = "Hebe das Fenster hervor wenn die Einheit einen Schw\195\164chungszauber hat, den du oder irgendjemand entfernen kann.",
["Off"] = "Aus",
["Your own"] = "Deine eigenen",
["All"] = "Alle",
["Hide"] = "Verstecken",
["Auto hide"] = "Automatisch Verstecken",
["Hide when inactive"] = "Verstecke wenn Inaktiv",
Expand Down
9 changes: 7 additions & 2 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ local L = {
["Bottom left"] = "Bottom left",
["Top"] = "Top",
["Bottom"] = "Bottom",
["Inside"] = "Inside",
["Inside Center"] = "Inside Center",
["Set the tags."] = "Set the tags.",
["Font Size"] = "Font Size",
["Set the font size."] = "Set the font size.",
Expand Down Expand Up @@ -211,7 +213,7 @@ local L = {
["Highlight the frames borders when the unit is targeted"] = "Highlight the frames borders when the unit is targeted",
["Highlight the frames borders when the unit is moused over"] = "Highlight the frames borders when the unit is moused over",
["Highlight the frames borders when the unit has aggro"] = "Highlight the frames borders when the unit has aggro",
["Highlight the frames borders when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "Highlight the frames borders when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove",
["Highlight the frames borders when the unit has a debuff you or someone can remove"] = "Highlight the frames borders when the unit has a debuff you or someone can remove",
["Highlight"] = "Highlight",
["On target"] = "On target",
["Highlight the frame when the unit is targeted"] = "Highlight the frame when the unit is targeted",
Expand All @@ -220,7 +222,10 @@ local L = {
["On aggro"] = "On aggro",
["Highlight the frame when the unit has aggro"] = "Highlight the frame when the unit has aggro",
["On debuff"] = "On debuff",
["Highlight the frame when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "Highlight the frame when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove",
["Highlight the frame when the unit has a debuff you or someone can remove"] = "Highlight the frame when the unit has a debuff you or someone can remove",
["Off"] = "Off",
["Your own"] = "Your own",
["All"] = "All",
["Hide"] = "Hide",
["Auto hide"] = "Auto hide",
["Hide when inactive"] = "Hide when inactive",
Expand Down
9 changes: 7 additions & 2 deletions locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ local L = {
["Bottom left"] = "底部偏左",
["Top"] = "顶部",
["Bottom"] = "底部",
["Inside"] = "Inside",
["Inside Center"] = "Inside Center",
["Set the tags."] = "设置标签(tags)。",
["Font Size"] = "字号",
["Set the font size."] = "设置字号。",
Expand Down Expand Up @@ -211,7 +213,7 @@ local L = {
["Highlight the frames borders when the unit is targeted"] = "选中目标时高亮单位边框",
["Highlight the frames borders when the unit is moused over"] = "鼠标指向时高亮单位边框",
["Highlight the frames borders when the unit has aggro"] = "单位获得仇恨时高亮边框",
["Highlight the frames borders when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "当你可以驱散该单位身上的减益光环时,显示灰色的高亮边框,其他人可以驱散时显示金色边框。",
["Highlight the frames borders when the unit has a debuff you or someone can remove"] = "Highlight the frames borders when the unit has a debuff you or someone can remove",
["Highlight"] = "高亮",
["On target"] = "目标",
["Highlight the frame when the unit is targeted"] = "选中目标时高亮框体",
Expand All @@ -220,7 +222,10 @@ local L = {
["On aggro"] = "获得仇恨",
["Highlight the frame when the unit has aggro"] = "获得仇恨时高亮框体",
["On debuff"] = "有减益debuff",
["Highlight the frame when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "当你可以驱散该单位身上的减益光环时,框架高亮为灰色,其他人可以驱散时框架高亮为金色。",
["Highlight the frame when the unit has a debuff you or someone can remove"] = "Highlight the frame when the unit has a debuff you or someone can remove",
["Off"] = "Off",
["Your own"] = "Your own",
["All"] = "All",
["Hide"] = "隐藏",
["Auto hide"] = "自动隐藏",
["Hide when inactive"] = "没有这项元素时隐藏",
Expand Down
9 changes: 7 additions & 2 deletions locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ local L = {
["Bottom left"] = "底部偏左",
["Top"] = "頂部",
["Bottom"] = "底部",
["Inside"] = "Inside",
["Inside Center"] = "Inside Center",
["Set the tags."] = "設定標籤(tags)。",
["Font Size"] = "字型大小",
["Set the font size."] = "設定字型大小。",
Expand Down Expand Up @@ -211,7 +213,7 @@ local L = {
["Highlight the frames borders when the unit is targeted"] = "選中目標時高亮單位邊框",
["Highlight the frames borders when the unit is moused over"] = "滑鼠指向時高亮單位邊框",
["Highlight the frames borders when the unit has aggro"] = "單位獲得仇恨時高亮邊框",
["Highlight the frames borders when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "當你可以驅散該單位身上的減益光環時,顯示灰色的高亮邊框,其他人可以驅散時顯示金色邊框。",
["Highlight the frames borders when the unit has a debuff you or someone can remove"] = "Highlight the frames borders when the unit has a debuff you or someone can remove",
["Highlight"] = "高亮",
["On target"] = "目標",
["Highlight the frame when the unit is targeted"] = "選中目標時高亮框架",
Expand All @@ -220,7 +222,10 @@ local L = {
["On aggro"] = "獲得仇恨",
["Highlight the frame when the unit has aggro"] = "獲得仇恨時高亮框架",
["On debuff"] = "可被驅散",
["Highlight the frame when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"] = "當你可以驅散該單位身上的減益光環時,將框架高亮為灰色,其他人可以驅散時將框架高亮為金色。",
["Highlight the frame when the unit has a debuff you or someone can remove"] = "Highlight the frame when the unit has a debuff you or someone can remove",
["Off"] = "Off",
["Your own"] = "Your own",
["All"] = "All",
["Hide"] = "隱藏",
["Auto hide"] = "自動隱藏",
["Hide when inactive"] = "沒有這項元素時隱藏",
Expand Down
28 changes: 14 additions & 14 deletions modules/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ function LunaUF:CreateConfig()
desc = L["Set the buffsize."],
type = "range",
order = 8,
min = 10,
min = 4,
max = 50,
step = 1,
},
Expand All @@ -904,6 +904,7 @@ function LunaUF:CreateConfig()
desc = string.format(L["Make your own %s bigger."],L["Buffs"]),
type = "toggle",
order = 9,
hidden = function(info) return (LunaUF.db.profile.units[info[1]].auras.buffpos == "INFRAME" or LunaUF.db.profile.units[info[1]].auras.buffpos == "INFRAMECENTER") end
},
enlargedbuffsize = {
name = L["Bigger buff size"],
Expand All @@ -913,13 +914,14 @@ function LunaUF:CreateConfig()
min = 0,
max = 20,
step = 1,
hidden = function(info) return (LunaUF.db.profile.units[info[1]].auras.buffpos == "INFRAME" or LunaUF.db.profile.units[info[1]].auras.buffpos == "INFRAMECENTER") end
},
buffpos = {
name = L["Position"],
desc = string.format(L["Position of the %s."],L["Buffs"]),
type = "select",
order = 11,
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"]},
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"], ["INFRAME"] = L["Inside"], ["INFRAMECENTER"] = L["Inside Center"]},
},
debuffheader = {
name = L["Debuffs"],
Expand All @@ -937,7 +939,7 @@ function LunaUF:CreateConfig()
desc = L["Set the debuffsize."],
type = "range",
order = 14,
min = 10,
min = 4,
max = 50,
step = 1,
},
Expand All @@ -946,6 +948,7 @@ function LunaUF:CreateConfig()
desc = string.format(L["Make your own %s bigger."],L["Debuffs"]),
type = "toggle",
order = 15,
hidden = function(info) return (LunaUF.db.profile.units[info[1]].auras.debuffpos == "INFRAME" or LunaUF.db.profile.units[info[1]].auras.debuffpos == "INFRAMECENTER") end
},
enlargeddebuffsize = {
name = L["Bigger debuff size"],
Expand All @@ -955,13 +958,14 @@ function LunaUF:CreateConfig()
min = 0,
max = 20,
step = 1,
hidden = function(info) return (LunaUF.db.profile.units[info[1]].auras.debuffpos == "INFRAME" or LunaUF.db.profile.units[info[1]].auras.debuffpos == "INFRAMECENTER") end
},
debuffpos = {
name = L["Position"],
desc = string.format(L["Position of the %s."],L["Debuffs"]),
type = "select",
order = 17,
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"]},
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"], ["INFRAME"] = L["Inside"], ["INFRAMECENTER"] = L["Inside Center"]},
},
},
},
Expand Down Expand Up @@ -992,12 +996,10 @@ function LunaUF:CreateConfig()
},
debuff = {
name = L["On debuff"],
desc = string.format(L["Highlight the frames borders when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"]),
type = "toggle",
tristate = true,
desc = string.format(L["Highlight the frames borders when the unit has a debuff you or someone can remove"]),
type = "select",
order = 4,
get = function(info) local v = get(info) if v == 2 then return false else return v end end,
set = function(info, value) if value == false then set(info, 2) else set(info, value) end end,
values = {[1] = L["Off"], [2] = L["Your own"], [3] = L["All"]},
},
},
},
Expand Down Expand Up @@ -1028,12 +1030,10 @@ function LunaUF:CreateConfig()
},
debuff = {
name = L["On debuff"],
desc = string.format(L["Highlight the frame when the unit has a debuff you (grey checkmark) or someone (golden checkmark) can remove"]),
type = "toggle",
tristate = true,
desc = string.format(L["Highlight the frame when the unit has a debuff you or someone can remove"]),
type = "select",
order = 4,
get = function(info) local v = get(info) if v == 2 then return false else return v end end,
set = function(info, value) if value == false then set(info, 2) else set(info, value) end end,
values = {[1] = L["Off"], [2] = L["Your own"], [3] = L["All"]},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion modules/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ local defaultTags = {
end
end
end;
["healthcolor"] =function(unit)
["healthcolor"] =function(frame, unit)
local percent = UnitHealth(unit) / UnitHealthMax(unit)
if( percent >= 1 ) then return Hex(LunaUF.db.profile.colors.green.r, LunaUF.db.profile.colors.green.g, LunaUF.db.profile.colors.green.b) end
if( percent == 0 ) then return Hex(LunaUF.db.profile.colors.red.r, LunaUF.db.profile.colors.red.g, LunaUF.db.profile.colors.red.b) end
Expand Down
102 changes: 100 additions & 2 deletions modules/auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function Auras:OnEnable(frame)
end
for i=1, (isPlayer and 34 or 32) do
local button = CreateFrame("Button", frame:GetName().."BuffFrame"..i, frame.auras.buffbuttons)
button:SetFrameLevel(6)
button.unit = frame.unit
button:SetScript("OnEnter", showTooltip)
button:SetScript("OnLeave", hideTooltip)
Expand Down Expand Up @@ -145,6 +146,7 @@ function Auras:OnEnable(frame)
end
for i=1, 16 do
local button = CreateFrame("Button", frame:GetName().."DebuffFrame"..i, frame.auras.debuffbuttons)
button:SetFrameLevel(6)
button.unit = frame.unit
button:SetScript("OnEnter", showTooltip)
button:SetScript("OnLeave", hideTooltip)
Expand Down Expand Up @@ -409,7 +411,57 @@ function Auras:UpdateLayout(frame)
local frameheight = 1
local buttonsize, lastButton, firstButton, rowlenght
local rowheight = 0
if config.buffpos == "BOTTOM" then
if config.buffpos == "INFRAME" then
for i,button in ipairs(frame.auras.buffbuttons.buttons) do
if not button:IsVisible() then break end
button:ClearAllPoints()
button:SetHeight(config.buffsize)
button:SetWidth(config.buffsize)
button.stack:SetFont("Interface\\AddOns\\LunaUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", (10*(config.buffsize/18)), "OUTLINE")
button.border:SetHeight(config.buffsize+2)
button.border:SetWidth(config.buffsize+2)
if i == 1 then
button:SetPoint("TOPLEFT", frame, "TOPLEFT", 1, -1)
rowlenght = config.buffsize + config.padding
firstButton = button
elseif (rowlenght + config.buffsize) <= framelength then
rowlenght = rowlenght + config.buffsize + config.padding
button:SetPoint("LEFT", firstButton, "RIGHT", config.padding, 0)
firstButton = button
else
button:Hide()
end
if button.cooldown then
button.cooldown:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
button.cooldown:SetScale((button:GetWidth() + 0.7)/36)
end
end
elseif config.buffpos == "INFRAMECENTER" then
for i,button in ipairs(frame.auras.buffbuttons.buttons) do
if not button:IsVisible() then break end
button:ClearAllPoints()
button:SetHeight(config.buffsize)
button:SetWidth(config.buffsize)
button.stack:SetFont("Interface\\AddOns\\LunaUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", (10*(config.buffsize/18)), "OUTLINE")
button.border:SetHeight(config.buffsize+2)
button.border:SetWidth(config.buffsize+2)
if i == 1 then
button:SetPoint("BOTTOMLEFT", frame, "LEFT", 1, 1)
rowlenght = config.buffsize + config.padding
firstButton = button
elseif (rowlenght + config.buffsize) <= framelength then
rowlenght = rowlenght + config.buffsize + config.padding
button:SetPoint("LEFT", firstButton, "RIGHT", config.padding, 0)
firstButton = button
else
button:Hide()
end
if button.cooldown then
button.cooldown:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
button.cooldown:SetScale((button:GetWidth() + 0.7)/36)
end
end
elseif config.buffpos == "BOTTOM" then
for i,button in ipairs(frame.auras.buffbuttons.buttons) do
if not button:IsVisible() then break end
buttonsize = not button.large and config.buffsize or config.buffsize + config.enlargedbuffsize
Expand Down Expand Up @@ -546,7 +598,53 @@ function Auras:UpdateLayout(frame)
frame.auras.buffbuttons:SetWidth(framelength)
frameheight = 1
rowheight = 0
if config.debuffpos == "BOTTOM" then
if config.debuffpos == "INFRAME" then
for i,button in ipairs(frame.auras.debuffbuttons.buttons) do
if not button:IsVisible() then break end
button:ClearAllPoints()
button:SetHeight(config.debuffsize)
button:SetWidth(config.debuffsize)
button.stack:SetFont("Interface\\AddOns\\LunaUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", (10*(config.debuffsize/18)), "OUTLINE")
button.border:SetHeight(config.debuffsize+2)
button.border:SetWidth(config.debuffsize+2)
if i == 1 then
button:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 1, 1)
rowlenght = config.debuffsize + config.padding
firstButton = button
elseif (rowlenght + config.debuffsize) <= framelength then
rowlenght = rowlenght + config.debuffsize + config.padding
button:SetPoint("LEFT", firstButton, "RIGHT", config.padding, 0)
firstButton = button
end
if button.cooldown then
button.cooldown:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
button.cooldown:SetScale((button:GetWidth() + 0.7)/36)
end
end
elseif config.debuffpos == "INFRAMECENTER" then
for i,button in ipairs(frame.auras.debuffbuttons.buttons) do
if not button:IsVisible() then break end
button:ClearAllPoints()
button:SetHeight(config.debuffsize)
button:SetWidth(config.debuffsize)
button.stack:SetFont("Interface\\AddOns\\LunaUnitFrames\\media\\fonts\\Myriad Condensed Web.ttf", (10*(config.debuffsize/18)), "OUTLINE")
button.border:SetHeight(config.debuffsize+2)
button.border:SetWidth(config.debuffsize+2)
if i == 1 then
button:SetPoint("TOPLEFT", frame, "LEFT", 1, -1)
rowlenght = config.debuffsize + config.padding
firstButton = button
elseif (rowlenght + config.debuffsize) <= framelength then
rowlenght = rowlenght + config.debuffsize + config.padding
button:SetPoint("LEFT", firstButton, "RIGHT", config.padding, 0)
firstButton = button
end
if button.cooldown then
button.cooldown:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
button.cooldown:SetScale((button:GetWidth() + 0.7)/36)
end
end
elseif config.debuffpos == "BOTTOM" then
for i,button in ipairs(frame.auras.debuffbuttons.buttons) do
if not button:IsVisible() then break end
buttonsize = not button.large and config.debuffsize or config.debuffsize + config.enlargeddebuffsize
Expand Down
Loading

0 comments on commit 78c99e2

Please sign in to comment.