Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	LunaUnitFrames.lua
  • Loading branch information
Aviana committed Nov 5, 2016
2 parents bd958f3 + 0f534bd commit d966fd6
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 56 deletions.
56 changes: 38 additions & 18 deletions LunaUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ LunaUF = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceConsole-2.0", "AceDB
LunaUF:RegisterDB("LunaDB")

-- Assets ----------------------------------------------------------------------------------
<<<<<<< HEAD
LunaUF.Version = 2009
=======
LunaUF.Version = 2008
>>>>>>> origin/master
LunaUF.BS = AceLibrary("Babble-Spell-2.2")
LunaUF.Banzai = AceLibrary("Banzai-1.0")
LunaUF.HealComm = AceLibrary("HealComm-1.0")
Expand Down Expand Up @@ -222,7 +226,7 @@ LunaUF.defaults = {
totemBar = { enabled = true, size = 2, hide=true },
druidBar = { enabled = true, size = 2 },
portrait = { enabled = true, type = "3D", side = "left", size = 6 },
auras = { enabled = false, AurasPerRow = 12, position = "BOTTOM", weaponbuffs = true },
auras = { enabled = false, AurasPerRow = 12, position = "BOTTOM", weaponbuffs = true, timertextenabled = true, timertextbigsize = 23,timertextsmallsize = 12, timerspinenabled = true },
highlight = { enabled = true, ontarget = false, ondebuff = true, onmouse = false },
fader = { enabled = false, inactiveAlpha = 0.2, combatAlpha = 1 },
tags = {
Expand Down Expand Up @@ -980,23 +984,39 @@ function LunaUF:HideBlizzard()
-- Castbar
local CastingBarFrame = getglobal("CastingBarFrame")
if self.db.profile.blizzard.castbar then
CastingBarFrame:RegisterEvent("SPELLCAST_START")
CastingBarFrame:RegisterEvent("SPELLCAST_STOP")
CastingBarFrame:RegisterEvent("SPELLCAST_FAILED")
CastingBarFrame:RegisterEvent("SPELLCAST_INTERRUPTED")
CastingBarFrame:RegisterEvent("SPELLCAST_DELAYED")
CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_START")
CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_UPDATE")
CastingBarFrame:RegisterEvent("SPELLCAST_CHANNEL_STOP")
if CastingBarFrame.OldShow then
CastingBarFrame.Show = CastingBarFrame.OldShow
end
if CastingBarFrame.OldHide then
CastingBarFrame.Hide = CastingBarFrame.OldHide
end
if CastingBarFrame.OldIsShown then
CastingBarFrame.IsShown = CastingBarFrame.OldIsShown
end
if CastingBarFrame.OldIsVisible then
CastingBarFrame.IsVisible = CastingBarFrame.OldIsVisible
end
if CastingBarFrame.LUAFShown then
CastingBarFrame.LUAFShown = nil
CastingBarFrame:Show()
end
else
CastingBarFrame:UnregisterEvent("SPELLCAST_START")
CastingBarFrame:UnregisterEvent("SPELLCAST_STOP")
CastingBarFrame:UnregisterEvent("SPELLCAST_FAILED")
CastingBarFrame:UnregisterEvent("SPELLCAST_INTERRUPTED")
CastingBarFrame:UnregisterEvent("SPELLCAST_DELAYED")
CastingBarFrame:UnregisterEvent("SPELLCAST_CHANNEL_START")
CastingBarFrame:UnregisterEvent("SPELLCAST_CHANNEL_UPDATE")
CastingBarFrame:UnregisterEvent("SPELLCAST_CHANNEL_STOP")
CastingBarFrame.OldShow = CastingBarFrame.Show
CastingBarFrame.OldHide = CastingBarFrame.Hide
CastingBarFrame.OldIsShown = CastingBarFrame.IsShown
CastingBarFrame.OldIsVisible = CastingBarFrame.IsVisible
CastingBarFrame.Show = function(this)
this.LUAFShown = true
end
CastingBarFrame.Hide = function(this)
this.LUAFShown = nil
end
CastingBarFrame.IsShown = function(this)
return this.LUAFShown
end
CastingBarFrame.IsVisible = function(this)
return this.LUAFShown and this:GetParent():IsVisible()
end
end
--Buffs
if self.db.profile.blizzard.buffs then
Expand Down Expand Up @@ -1123,4 +1143,4 @@ function LunaUF:LoadUnits()
for _, type in pairs(self.unitList) do
self.Units:InitializeFrame(type)
end
end
end
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# LunaUnitFrames
Unit Frames for WoW 1.12.1


Be reminded that this project is frozen at the moment since i don't play vanilla. Only big errors will be taken care of.
Feel free to fork this but give credit (at least author & link to this github)
4 changes: 4 additions & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ local function enUS() return {
["XP Bar"] = "XP Bar",
["Frame background"] = "Frame background",
["Color"] = "Color",
["Enable Timer Text"] = "Enable Timer Text",
["Small font size"] = "Small font size",
["Big font size"] = "Big font size",
["Enable Timer Spin"] = "Enable Timer Spin",

["Returns plain name of the unit"] = "Returns plain name of the unit",
["Returns shortened names (Marshall Williams = M. Williams)"] = "Returns shortened names (Marshall Williams = M. Williams)",
Expand Down
72 changes: 71 additions & 1 deletion modules/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,12 @@ function LunaUF:LoadOptions()
LunaOptionsFrame.pages[i].enableauras:SetChecked(LunaUF.db.profile.units[unit].auras.enabled)
SetDropDownValue(LunaOptionsFrame.pages[i].auraposition,LunaUF.db.profile.units[unit].auras.position)
LunaOptionsFrame.pages[i].aurasizeslider:SetValue(17-LunaUF.db.profile.units[unit].auras.AurasPerRow)
if (unit == "player") then
LunaOptionsFrame.pages[i].enableaurastimertext:SetChecked(LunaUF.db.profile.units[unit].auras.timertextenabled)
LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider:SetValue(LunaUF.db.profile.units[unit].auras.timertextbigsize)
LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider:SetValue(LunaUF.db.profile.units[unit].auras.timertextsmallsize)
LunaOptionsFrame.pages[i].enableaurastimerspin:SetChecked(LunaUF.db.profile.units[unit].auras.timerspinenabled)
end
LunaOptionsFrame.pages[i].enabletags:SetChecked(LunaUF.db.profile.units[unit].tags.enabled)
LunaOptionsFrame.pages[i].tags.load(LunaOptionsFrame.pages[i].tags,LunaUF.db.profile.units[unit].tags.bartags)
LunaOptionsFrame.pages[i].barorder.load(LunaOptionsFrame.pages[i].barorder,LunaUF.db.profile.units[unit].barorder)
Expand Down Expand Up @@ -2054,8 +2060,72 @@ function LunaUF:CreateOptionsMenu()
LunaOptionsFrame.pages[i].aurasizeslider:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].auraheader, "BOTTOMLEFT", 280, -10)
LunaOptionsFrame.pages[i].aurasizeslider:SetWidth(190)

if (LunaUF.unitList[i-1] == "player") then
LunaOptionsFrame.pages[i].enableaurastimertext = CreateFrame("CheckButton", "Enable"..LunaUF.unitList[i-1].."AurasTimerText", LunaOptionsFrame.pages[i], "UICheckButtonTemplate")
LunaOptionsFrame.pages[i].enableaurastimertext:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].enableauras, "BOTTOMLEFT", 0, -10)
LunaOptionsFrame.pages[i].enableaurastimertext:SetHeight(30)
LunaOptionsFrame.pages[i].enableaurastimertext:SetWidth(30)
LunaOptionsFrame.pages[i].enableaurastimertext:SetScript("OnClick", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].auras.timertextenabled = not LunaUF.db.profile.units[unit].auras.timertextenabled
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units.FullUpdate(frame)
end
end
end)
getglobal("Enable"..LunaUF.unitList[i-1].."AurasTimerText".."Text"):SetText(L["Enable Timer Text"])

LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider = CreateFrame("Slider", "AuraTimerBigFontSlider"..LunaUF.unitList[i-1], LunaOptionsFrame.pages[i], "OptionsSliderTemplate")
LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider:SetMinMaxValues(1,23)
LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider:SetValueStep(1)
LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider:SetScript("OnValueChanged", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].auras.timertextbigsize = this:GetValue()
getglobal("AuraTimerBigFontSlider"..unit.."Text"):SetText(L["Big font size"]..": "..LunaUF.db.profile.units[unit].auras.timertextbigsize)
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units.FullUpdate(frame)
end
end
end)
LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider:SetPoint("LEFT", LunaOptionsFrame.pages[i].enableaurastimertext, "RIGHT", 120, 0)
LunaOptionsFrame.pages[i].auratimertextbigfontsizeslider:SetWidth(150)

LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider = CreateFrame("Slider", "AuraTimerSmallFontSlider"..LunaUF.unitList[i-1], LunaOptionsFrame.pages[i], "OptionsSliderTemplate")
LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider:SetMinMaxValues(1,23)
LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider:SetValueStep(1)
LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider:SetScript("OnValueChanged", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].auras.timertextsmallsize = this:GetValue()
getglobal("AuraTimerSmallFontSlider"..unit.."Text"):SetText(L["Small font size"]..": "..LunaUF.db.profile.units[unit].auras.timertextsmallsize)
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units.FullUpdate(frame)
end
end
end)
LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider:SetPoint("LEFT", LunaOptionsFrame.pages[i].enableaurastimertext, "RIGHT", 290, 0)
LunaOptionsFrame.pages[i].auratimertextsmallfontsizeslider:SetWidth(150)

LunaOptionsFrame.pages[i].enableaurastimerspin = CreateFrame("CheckButton", "Enable"..LunaUF.unitList[i-1].."AurasTimerSpin", LunaOptionsFrame.pages[i], "UICheckButtonTemplate")
LunaOptionsFrame.pages[i].enableaurastimerspin:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].enableaurastimertext, "BOTTOMLEFT", 0, -10)
LunaOptionsFrame.pages[i].enableaurastimerspin:SetHeight(30)
LunaOptionsFrame.pages[i].enableaurastimerspin:SetWidth(30)
LunaOptionsFrame.pages[i].enableaurastimerspin:SetScript("OnClick", function()
local unit = this:GetParent().id
LunaUF.db.profile.units[unit].auras.timerspinenabled = not LunaUF.db.profile.units[unit].auras.timerspinenabled
for _,frame in pairs(LunaUF.Units.frameList) do
if frame.unitGroup == unit then
LunaUF.Units.FullUpdate(frame)
end
end
end)
getglobal("Enable"..LunaUF.unitList[i-1].."AurasTimerSpin".."Text"):SetText(L["Enable Timer Spin"])
end

LunaOptionsFrame.pages[i].tagheader = LunaOptionsFrame.pages[i]:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
LunaOptionsFrame.pages[i].tagheader:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].auraheader, "BOTTOMLEFT", 0, -60)
LunaOptionsFrame.pages[i].tagheader:SetPoint("TOPLEFT", LunaOptionsFrame.pages[i].enableaurastimertext or LunaOptionsFrame.pages[i].auraheader, "BOTTOMLEFT", 0, -60)
LunaOptionsFrame.pages[i].tagheader:SetHeight(24)
LunaOptionsFrame.pages[i].tagheader:SetJustifyH("LEFT")
LunaOptionsFrame.pages[i].tagheader:SetTextColor(1,1,0)
Expand Down
Loading

0 comments on commit d966fd6

Please sign in to comment.