Skip to content

Commit

Permalink
Combat text options, expanded tag areas
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviana committed Mar 17, 2016
1 parent 8afc025 commit 1deae2e
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 6 deletions.
6 changes: 5 additions & 1 deletion LunaUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ LunaUF = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceConsole-2.0", "AceDB
LunaUF:RegisterDB("LunaDB")

-- Assets ----------------------------------------------------------------------------------
LunaUF.Version = 2000
LunaUF.Version = 2002
LunaUF.BS = AceLibrary("Babble-Spell-2.2")
LunaUF.Banzai = AceLibrary("Banzai-1.0")
LunaUF.HealComm = AceLibrary("HealComm-1.0")
Expand Down Expand Up @@ -377,6 +377,7 @@ LunaUF.defaults = {
auras = { enabled = false, AurasPerRow = 8, position = "BOTTOM" },
highlight = { enabled = true, ontarget = false, ondebuff = true, onmouse = false },
fader = { enabled = false, inactiveAlpha = 0.2, combatAlpha = 1 },
combatText = { enabled = false, xoffset = 0, yoffset = 0, size = 2 },
tags = {
enabled = true,
bartags = {
Expand Down Expand Up @@ -427,6 +428,7 @@ LunaUF.defaults = {
auras = { enabled = false, AurasPerRow = 8, position = "BOTTOM" },
highlight = { enabled = true, ontarget = false, ondebuff = true, onmouse = false },
fader = { enabled = false, inactiveAlpha = 0.2, combatAlpha = 1 },
combatText = { enabled = false, xoffset = 0, yoffset = 0, size = 2 },
tags = {
enabled = true,
bartags = {
Expand Down Expand Up @@ -545,6 +547,7 @@ LunaUF.defaults = {
auras = { enabled = false, AurasPerRow = 8, position = "BOTTOM" },
highlight = { enabled = true, ontarget = false, ondebuff = true, onmouse = false },
fader = { enabled = false, inactiveAlpha = 0.2, combatAlpha = 1 },
combatText = { enabled = false, xoffset = 0, yoffset = 0, size = 2 },
tags = {
enabled = true,
bartags = {
Expand Down Expand Up @@ -591,6 +594,7 @@ LunaUF.defaults = {
auras = { enabled = false, AurasPerRow = 8, position = "BOTTOM" },
highlight = { enabled = true, ontarget = false, ondebuff = true, onmouse = false },
fader = { enabled = false, inactiveAlpha = 0.2, combatAlpha = 1 },
combatText = { enabled = false, xoffset = 0, yoffset = 0, size = 2 },
tags = {
enabled = true,
bartags = {
Expand Down
80 changes: 79 additions & 1 deletion modules/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,10 @@ function LunaUF:LoadOptions()
LunaOptionsFrame.pages[i].enableFader:SetChecked(LunaUF.db.profile.units[unit].fader.enabled)
LunaOptionsFrame.pages[i].FaderCombatslider:SetValue(LunaUF.db.profile.units[unit].fader.combatAlpha)
LunaOptionsFrame.pages[i].FaderNonCombatslider:SetValue(LunaUF.db.profile.units[unit].fader.inactiveAlpha)
LunaOptionsFrame.pages[i].enableCtext:SetChecked(LunaUF.db.profile.units[unit].combatText.enabled)
LunaOptionsFrame.pages[i].ctextscaleslider:SetValue(LunaUF.db.profile.units[unit].combatText.size)
LunaOptionsFrame.pages[i].ctextXslider:SetValue(LunaUF.db.profile.units[unit].combatText.xoffset)
LunaOptionsFrame.pages[i].ctextYslider:SetValue(LunaUF.db.profile.units[unit].combatText.yoffset)
LunaOptionsFrame.pages[i].enablePortrait:SetChecked(LunaUF.db.profile.units[unit].portrait.enabled)
SetDropDownValue(LunaOptionsFrame.pages[i].portraitType,LunaUF.db.profile.units[unit].portrait.type)
SetDropDownValue(LunaOptionsFrame.pages[i].portraitSide,LunaUF.db.profile.units[unit].portrait.side)
Expand Down Expand Up @@ -1324,8 +1328,82 @@ function LunaUF:CreateOptionsMenu()
LunaOptionsFrame.pages[i].FaderNonCombatslider:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].faderheader, "BOTTOMLEFT", 220, -50)
LunaOptionsFrame.pages[i].FaderNonCombatslider:SetWidth(200)

----

LunaOptionsFrame.pages[i].ctextheader = LunaOptionsFrame.pages[i]:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
LunaOptionsFrame.pages[i].ctextheader:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].faderheader, "BOTTOMLEFT", 0, -100)
LunaOptionsFrame.pages[i].ctextheader:SetHeight(24)
LunaOptionsFrame.pages[i].ctextheader:SetJustifyH("LEFT")
LunaOptionsFrame.pages[i].ctextheader:SetTextColor(1,1,0)
LunaOptionsFrame.pages[i].ctextheader:SetText(L["Combat text"])

LunaOptionsFrame.pages[i].enableCtext = CreateFrame("CheckButton", "Enable"..LunaUF.unitList[i-1].."CombatText", LunaOptionsFrame.pages[i], "UICheckButtonTemplate")
LunaOptionsFrame.pages[i].enableCtext:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].ctextheader, "BOTTOMLEFT", 0, -10)
LunaOptionsFrame.pages[i].enableCtext:SetHeight(30)
LunaOptionsFrame.pages[i].enableCtext:SetWidth(30)
LunaOptionsFrame.pages[i].enableCtext:SetScript("OnClick", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].combatText.enabled = not LunaUF.db.profile.units[unit].combatText.enabled
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units:SetupFrameModules(frame)
end
end
end)
getglobal("Enable"..LunaUF.unitList[i-1].."CombatTextText"):SetText(L["Enable"])

LunaOptionsFrame.pages[i].ctextscaleslider = CreateFrame("Slider", "CtextScale"..LunaUF.unitList[i-1], LunaOptionsFrame.pages[i], "OptionsSliderTemplate")
LunaOptionsFrame.pages[i].ctextscaleslider:SetMinMaxValues(1,5)
LunaOptionsFrame.pages[i].ctextscaleslider:SetValueStep(0.1)
LunaOptionsFrame.pages[i].ctextscaleslider:SetScript("OnValueChanged", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].combatText.size = math.floor(this:GetValue()*10)/10
getglobal("CtextScale"..unit.."Text"):SetText("Size: "..LunaUF.db.profile.units[unit].combatText.size)
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units:SetupFrameModules(frame)
end
end
end)
LunaOptionsFrame.pages[i].ctextscaleslider:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].ctextheader, "BOTTOMLEFT", 220, -10)
LunaOptionsFrame.pages[i].ctextscaleslider:SetWidth(200)

LunaOptionsFrame.pages[i].ctextXslider = CreateFrame("Slider", "CtextXSlider"..LunaUF.unitList[i-1], LunaOptionsFrame.pages[i], "OptionsSliderTemplate")
LunaOptionsFrame.pages[i].ctextXslider:SetMinMaxValues(-200,200)
LunaOptionsFrame.pages[i].ctextXslider:SetValueStep(2)
LunaOptionsFrame.pages[i].ctextXslider:SetScript("OnValueChanged", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].combatText.xoffset = math.floor(this:GetValue())
getglobal("CtextXSlider"..unit.."Text"):SetText("X: "..LunaUF.db.profile.units[unit].combatText.xoffset)
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units:SetupFrameModules(frame)
end
end
end)
LunaOptionsFrame.pages[i].ctextXslider:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].ctextheader, "BOTTOMLEFT", 0, -50)
LunaOptionsFrame.pages[i].ctextXslider:SetWidth(200)

LunaOptionsFrame.pages[i].ctextYslider = CreateFrame("Slider", "CtextYSlider"..LunaUF.unitList[i-1], LunaOptionsFrame.pages[i], "OptionsSliderTemplate")
LunaOptionsFrame.pages[i].ctextYslider:SetMinMaxValues(-200,200)
LunaOptionsFrame.pages[i].ctextYslider:SetValueStep(2)
LunaOptionsFrame.pages[i].ctextYslider:SetScript("OnValueChanged", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].combatText.yoffset = math.floor(this:GetValue())
getglobal("CtextYSlider"..unit.."Text"):SetText("Y: "..LunaUF.db.profile.units[unit].combatText.yoffset)
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units:SetupFrameModules(frame)
end
end
end)
LunaOptionsFrame.pages[i].ctextYslider:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].ctextheader, "BOTTOMLEFT", 220, -50)
LunaOptionsFrame.pages[i].ctextYslider:SetWidth(200)

----

LunaOptionsFrame.pages[i].portraitheader = LunaOptionsFrame.pages[i]:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
LunaOptionsFrame.pages[i].portraitheader:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].faderheader, "BOTTOMLEFT", 0, -100)
LunaOptionsFrame.pages[i].portraitheader:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].ctextheader, "BOTTOMLEFT", 0, -100)
LunaOptionsFrame.pages[i].portraitheader:SetHeight(24)
LunaOptionsFrame.pages[i].portraitheader:SetJustifyH("LEFT")
LunaOptionsFrame.pages[i].portraitheader:SetTextColor(1,1,0)
Expand Down
4 changes: 2 additions & 2 deletions modules/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ function Health:FullUpdate(frame)
fontstring:SetHeight(frame.healthBar:GetHeight())
if align == "left" then
fontstring:SetPoint("TOPLEFT", frame.healthBar, "TOPLEFT", 2, 0)
fontstring:SetWidth(frame.healthBar:GetWidth()/2)
fontstring:SetWidth(frame.healthBar:GetWidth()-4)
elseif align == "center" then
fontstring:SetAllPoints(frame.healthBar)
fontstring:SetWidth(frame.healthBar:GetWidth())
else
fontstring:SetPoint("TOPRIGHT", frame.healthBar, "TOPRIGHT", -2 , 0)
fontstring:SetWidth(frame.healthBar:GetWidth()/2)
fontstring:SetWidth(frame.healthBar:GetWidth()-4)
end
end
Health:Update(frame)
Expand Down
4 changes: 2 additions & 2 deletions modules/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ function Power:FullUpdate(frame)
fontstring:SetHeight(frame.powerBar:GetHeight())
if align == "left" then
fontstring:SetPoint("TOPLEFT", frame.powerBar, "TOPLEFT", 2, 0)
fontstring:SetWidth(frame.powerBar:GetWidth()/2)
fontstring:SetWidth(frame.powerBar:GetWidth()-4)
elseif align == "center" then
fontstring:SetAllPoints(frame.powerBar)
fontstring:SetWidth(frame.powerBar:GetWidth())
else
fontstring:SetPoint("TOPRIGHT", frame.powerBar, "TOPRIGHT", -2 , 0)
fontstring:SetWidth(frame.powerBar:GetWidth()/2)
fontstring:SetWidth(frame.powerBar:GetWidth()-4)
end
end
if frame.powerBar.ticker then
Expand Down

0 comments on commit 1deae2e

Please sign in to comment.