Skip to content

Commit

Permalink
Add #222
Browse files Browse the repository at this point in the history
- Add [range] tag to documentation
  • Loading branch information
Aviana committed May 18, 2020
1 parent e289c90 commit f0b836c
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 32 deletions.
2 changes: 1 addition & 1 deletion LunaUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LunaUF = select(2, ...)

local L = LunaUF.L
local ACR = LibStub("AceConfigRegistry-3.0", true)
LunaUF.version = 3047
LunaUF.version = 3048
LunaUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "party", "partytarget", "partypet", "raid", "raidpet", "maintank", "maintanktarget", "maintanktargettarget", "mainassist", "mainassisttarget", "mainassisttargettarget"}
LunaUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["partytarget"] = true, ["maintanktarget"] = true, ["maintanktargettarget"] = true, ["mainassisttarget"] = true, ["mainassisttargettarget"] = true}
LunaUF.enabledUnits = {}
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: 3042
## Version: 3048
## SavedVariables: LunaUFDB
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSpellRange-1.0, Clique, RealMobHealth
## X-License: WTFPL (http://www.wtfpl.net/about/)
Expand Down
5 changes: 5 additions & 0 deletions locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ local L = {
["Bigger buff size"] = "Gr\195\182ssere St\195\164rkungszauber Gr\195\182sse",
["Bigger debuffs"] = "Gr\195\182ssere Schw\195\164chungszauber",
["Bigger debuff size"] = "Gr\195\182ssere Schw\195\164chungszauber Gr\195\182sse",
["Horizontal Limit Side"] = "Horizontal Limit Seite",
["Side on which to cut shorter than the frame"] = "Seite auf der begrenzt wird",
["Horizontal Limit"] = "Horizontal Limit",
["Limit to a percentage of the frame."] = "Begrenze zu einem Bruchteil des Frames",
["All"] = "Alle",
["Own"] = "Eigene",
["None"] = "Keine",
Expand Down Expand Up @@ -404,6 +408,7 @@ local L = {
["combat"] = "(k) wenn im Kampf",
["loyalty"] = "Loyalit\195\164t eures Begleiters",
["buffcount"] = "Anzahl positiver Effekte auf der Einheit",
["range"] = "Entfernung zu dieser Einheit",
["namehealerhealth"] = "Genau wie \"healerhealth\" aber zeigt Namen bei voller Gesundheit",
["healerhealth"] = "Zeigt das selbe wie \"smart:healmishp\" bei freundlichen Einheiten und gp/maxgp bei Gegnern",
["smart:healmishp"] = "Gibt fehlende gp mit kommender Heilung aus. Zeigt Status wenn es zutrifft (\"Tot\", \"Offline\", \"Geist\")",
Expand Down
5 changes: 5 additions & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ local L = {
["Bigger buff size"] = "Bigger buff size",
["Bigger debuffs"] = "Bigger debuffs",
["Bigger debuff size"] = "Bigger debuff size",
["Horizontal Limit Side"] = "Horizontal Limit Side",
["Side on which to cut shorter than the frame"] = "Side on which to cut buffs shorter than the frame",
["Horizontal Limit"] = "Horizontal Limit",
["Limit to a percentage of the frame"] = "Limit to a percentage of the frame",
["All"] = "All",
["Own"] = "Own",
["None"] = "None",
Expand Down Expand Up @@ -401,6 +405,7 @@ local L = {
["combat"] = "(c) when in combat",
["loyalty"] = "Loyalty level of your pet",
["buffcount"] = "Number of positive effects on a unit",
["range"] = "Range to this unit",
["namehealerhealth"] = "The same as \"healerhealth\" but displays name on full health",
["healerhealth"] = "Returns the same as \"smart:healmishp\" on friendly units and hp/maxhp on enemies",
["smart:healmishp"] = "Returns missing hp with healing factored in. Shows status when needed (\"Dead\", \"Offline\", \"Ghost\")",
Expand Down
5 changes: 5 additions & 0 deletions locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ local L = {
["Bigger buff size"] = "더 큰 버프 크기",
["Bigger debuffs"] = "더 큰 디버프",
["Bigger debuff size"] = "더 큰 디버프 크기",
["Horizontal Limit Side"] = "Horizontal Limit Side",
["Side on which to cut shorter than the frame"] = "Side on which to cut shorter than the frame",
["Horizontal Limit"] = "Horizontal Limit",
["Limit to a percentage of the frame"] = "Limit to a percentage of the frame",
["All"] = "모두",
["Own"] = "자신",
["None"] = "없음",
Expand Down Expand Up @@ -403,6 +407,7 @@ local L = {
["combat"] = "전투중이면 (전투) 표시",
["loyalty"] = "소환수의 충성도 표시",
["buffcount"] = "유닛에 대한 강화 효과의 수",
["range"] = "Range to this unit",
["namehealerhealth"] = "\"healerhealth\" 태그와 같지만 풀(Full) 생명력 상태에서는 이름을 표시",
["healerhealth"] = "우호적 유닛은 \"smart:healmishp\" 태그와 같고 적군은 '현재 생명력/최대 생명력'을 표시",
["smart:healmishp"] = "치유량과 함께 손실된 생명력 표시. 필요하면 상태를 표시 (\"죽음\", \"접속종료\", \"유령\")",
Expand Down
5 changes: 5 additions & 0 deletions locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ local L = {
["Bigger buff size"] = "加大尺寸",
["Bigger debuffs"] = "加大自身施放",
["Bigger debuff size"] = "加大尺寸",
["Horizontal Limit Side"] = "Horizontal Limit Side",
["Side on which to cut shorter than the frame"] = "Side on which to cut shorter than the frame",
["Horizontal Limit"] = "Horizontal Limit",
["Limit to a percentage of the frame"] = "Limit to a percentage of the frame",
["All"] = "全部",
["Own"] = "自己的",
["None"] = "",
Expand Down Expand Up @@ -400,6 +404,7 @@ local L = {
["combat"] = "战斗状态",
["loyalty"] = "宠物忠诚度",
["buffcount"] = "Number of positive effects on a unit",
["range"] = "Range to this unit",
["namehealerhealth"] = "与 [healerhealth] 显示相同, 但在满血时显示名字",
["healerhealth"] = "在友方单位上,与[smart:healmishp]显示相同;在敌对单位上,显示\"当前生命值/最大生命值\"",
["smart:healmishp"] = "为治疗显示损失的生命值. 需要时会显示状态:\"死亡\"\"灵魂\"\"离线\"",
Expand Down
5 changes: 5 additions & 0 deletions locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ local L = {
["Bigger buff size"] = "放大幅度",
["Bigger debuffs"] = "放大自身施放",
["Bigger debuff size"] = "放大幅度",
["Horizontal Limit Side"] = "Horizontal Limit Side",
["Side on which to cut shorter than the frame"] = "Side on which to cut shorter than the frame",
["Horizontal Limit"] = "Horizontal Limit",
["Limit to a percentage of the frame"] = "Limit to a percentage of the frame",
["All"] = "全部",
["Own"] = "自己的",
["None"] = "",
Expand Down Expand Up @@ -400,6 +404,7 @@ local L = {
["combat"] = "戰鬥狀態",
["loyalty"] = "寵物忠誠度",
["buffcount"] = "Number of positive effects on a unit",
["range"] = "Range to this unit",
["namehealerhealth"] = "與 [healerhealth] 相同, 但在滿血時顯示名字",
["healerhealth"] = "在友方單位上,與 [smart:healmishp] 相同;在敵方單位上,顯示「當前生命值/最大生命值」",
["smart:healmishp"] = "為治療顯示損失的生命值,需要時會顯示狀態 (如「死亡」、「離線」、「靈魂」)",
Expand Down
54 changes: 41 additions & 13 deletions modules/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ local InfoTags = {
["combat"] = true,
["loyalty"] = true,
["buffcount"] = true,
["range"] = true,
}
local HealthnPowerTags = {
["namehealerhealth"] = true,
Expand Down Expand Up @@ -1002,28 +1003,46 @@ function LunaUF:CreateConfig()
order = 12,
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"], ["INFRAME"] = L["Inside"], ["INFRAMECENTER"] = L["Inside Center"]},
},
wrapbuffside = {
name = L["Horizontal Limit Side"],
desc = L["Side on which to cut shorter than the frame"],
type = "select",
order = 13,
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]},
},
wrapbuff = {
name = L["Horizontal Limit"],
desc = L["Limit to a percentage of the frame"],
type = "range",
order = 14,
min = 0.2,
max = 1.5,
step = 0.01,
width = "double",
isPercent = true,
},
debuffheader = {
name = L["Debuffs"],
type = "header",
order = 13,
order = 15,
},
debuffs = {
name = L["Debuffs"],
desc = string.format(L["Enable or disable the %s."],L["Debuffs"]),
type = "toggle",
order = 14,
order = 16,
},
filterdebuffs = {
name = string.format(L["Filter %s"],L["Debuffs"]),
desc = L["Show only debuffs that you can dispel"],
type = "toggle",
order = 15,
order = 17,
},
debuffsize = {
name = L["Size"],
desc = L["Set the debuffsize."],
type = "range",
order = 16,
order = 18,
min = 4,
max = 50,
step = 1,
Expand All @@ -1032,14 +1051,14 @@ function LunaUF:CreateConfig()
name = L["Bigger debuffs"],
desc = string.format(L["Make your own %s bigger."],L["Debuffs"]),
type = "toggle",
order = 17,
order = 19,
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"],
desc = L["Set the size."],
type = "range",
order = 18,
order = 20,
min = 0,
max = 20,
step = 1,
Expand All @@ -1049,17 +1068,26 @@ function LunaUF:CreateConfig()
name = L["Position"],
desc = string.format(L["Position of the %s."],L["Debuffs"]),
type = "select",
order = 19,
order = 21,
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"], ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"], ["INFRAME"] = L["Inside"], ["INFRAMECENTER"] = L["Inside Center"]},
},
wrap = {
wrapdebuffside = {
name = L["Horizontal Limit Side"],
desc = L["Side on which to cut shorter than the frame"],
type = "select",
order = 22,
values = {["LEFT"] = L["Left"], ["RIGHT"] = L["Right"]},
},
wrapdebuff = {
name = L["Horizontal Limit"],
desc = L["Set the debuffsize."],
desc = L["Limit to a percentage of the frame."],
type = "range",
order = 16,
min = 4,
max = 50,
step = 1,
order = 23,
min = 0.2,
max = 1.5,
step = 0.01,
width = "double",
isPercent = true,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion modules/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ local defaultTags = {
elseif UnitInRange(unit) then
return "30-40"
else
return ">40"
return "~"
end
end;
["race"] = function(frame, unit)
Expand Down
46 changes: 30 additions & 16 deletions modules/auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,31 +395,45 @@ end
function Auras:UpdateLayout(frame)
local config = LunaUF.db.profile.units[frame.unitType].auras
local debuffanchor = config.buffpos == config.debuffpos and frame.auras.buffbuttons or frame
local framelength = LunaUF.db.profile.units[frame.unitType].width - 8 --??? WTF is going on
local frameheight = 1
local buttonsize, lastButton, firstButton, rowlenght, buffoffset, debuffoffset
local rowheight = 0
if config.wrapbuffside == "LEFT" then
if config.wrapbuff > 1 then
buffoffset = -((config.wrapbuff - 1) * framelength)
else
buffoffset = framelength * (1 - config.wrapbuff)
end
end
if config.wrapdebuffside == "LEFT" then
if config.wrapdebuff > 1 then
debuffoffset = -((config.wrapdebuff - 1) * framelength)
else
debuffoffset = framelength * (1 - config.wrapdebuff)
end
end
frame.auras.buffbuttons:ClearAllPoints()
frame.auras.debuffbuttons:ClearAllPoints()
if config.buffpos == "BOTTOM" then
frame.auras.buffbuttons:SetPoint("TOP", frame, "BOTTOM", 0, -3)
frame.auras.buffbuttons:SetPoint("TOP", frame, "BOTTOM", 0 + (config.wrapbuffside == "LEFT" and buffoffset or 0), -3)
elseif config.buffpos == "TOP" then
frame.auras.buffbuttons:SetPoint("BOTTOM", frame, "TOP", 0, 3)
frame.auras.buffbuttons:SetPoint("BOTTOM", frame, "TOP", 0 + (config.wrapbuffside == "LEFT" and buffoffset or 0), 3)
elseif config.buffpos == "LEFT" then
frame.auras.buffbuttons:SetPoint("BOTTOMRIGHT", frame, "LEFT", -3, 1)
else
frame.auras.buffbuttons:SetPoint("BOTTOMLEFT", frame, "RIGHT", 3, 1)
end
if config.debuffpos == "BOTTOM" then
frame.auras.debuffbuttons:SetPoint("TOP", debuffanchor, "BOTTOM", 0, (config.buffs or config.weaponbuffs) and -3 or 0)
frame.auras.debuffbuttons:SetPoint("TOP", debuffanchor, "BOTTOM", 0 + (config.wrapdebuffside == "LEFT" and debuffoffset or 0), (config.buffs or config.weaponbuffs) and -3 or 0)
elseif config.debuffpos == "TOP" then
frame.auras.debuffbuttons:SetPoint("BOTTOM", debuffanchor, "TOP", 0, (config.buffs or config.weaponbuffs) and 3 or 0)
frame.auras.debuffbuttons:SetPoint("BOTTOM", debuffanchor, "TOP", 0 + (config.wrapdebuffside == "LEFT" and debuffoffset or 0), (config.buffs or config.weaponbuffs) and 3 or 0)
elseif config.debuffpos == "LEFT" then
frame.auras.debuffbuttons:SetPoint("TOPRIGHT", frame, "LEFT", -3, -1)
else
frame.auras.debuffbuttons:SetPoint("TOPLEFT", frame, "RIGHT", 3, -1)
end

local framelength = LunaUF.db.profile.units[frame.unitType].width - 8 --??? WTF is going on
local frameheight = 1
local buttonsize, lastButton, firstButton, rowlenght
local rowheight = 0
if config.buffpos == "INFRAME" then
for i,button in ipairs(frame.auras.buffbuttons.buttons) do
if not button:IsVisible() then break end
Expand Down Expand Up @@ -488,7 +502,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapbuff) then
rowlenght = buttonsize
button:SetPoint("TOPLEFT", firstButton, "TOPLEFT", 0, (-(config.padding)-rowheight))
firstButton = button
Expand Down Expand Up @@ -522,7 +536,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapbuff) then
rowlenght = buttonsize
button:SetPoint("BOTTOMLEFT", firstButton, "BOTTOMLEFT", 0, (config.padding+rowheight))
firstButton = button
Expand Down Expand Up @@ -556,7 +570,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapbuff) then
rowlenght = buttonsize
button:SetPoint("BOTTOMRIGHT", firstButton, "BOTTOMRIGHT", 0, (config.padding+rowheight))
firstButton = button
Expand Down Expand Up @@ -590,7 +604,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapbuff) then
rowlenght = buttonsize
button:SetPoint("BOTTOMLEFT", firstButton, "BOTTOMLEFT", 0, (config.padding+rowheight))
firstButton = button
Expand Down Expand Up @@ -677,7 +691,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapdebuff) then
rowlenght = buttonsize
button:SetPoint("TOPLEFT", firstButton, "TOPLEFT", 0, (-(config.padding)-rowheight))
firstButton = button
Expand Down Expand Up @@ -711,7 +725,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapdebuff) then
rowlenght = buttonsize
button:SetPoint("BOTTOMLEFT", firstButton, "BOTTOMLEFT", 0, (config.padding+rowheight))
firstButton = button
Expand Down Expand Up @@ -745,7 +759,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapdebuff) then
rowlenght = buttonsize
button:SetPoint("TOPRIGHT", firstButton, "TOPRIGHT", 0, (-(config.padding)-rowheight))
firstButton = button
Expand Down Expand Up @@ -779,7 +793,7 @@ function Auras:UpdateLayout(frame)
rowlenght = buttonsize
rowheight = buttonsize
firstButton = button
elseif (rowlenght + buttonsize + config.padding) > framelength then
elseif (rowlenght + buttonsize + config.padding) > (framelength * config.wrapdebuff) then
rowlenght = buttonsize
button:SetPoint("TOPLEFT", firstButton, "TOPLEFT", 0, (-(config.padding)-rowheight))
firstButton = button
Expand Down
Loading

0 comments on commit f0b836c

Please sign in to comment.