This commit is contained in:
Bunny67
2017-12-11 20:27:02 +03:00
commit de8c95c8f0
295 changed files with 57024 additions and 0 deletions
@@ -0,0 +1,432 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local AB = E:NewModule("ActionBars", "AceHook-3.0", "AceEvent-3.0");
local LSM = LibStub("LibSharedMedia-3.0");
--Cache global variables
--Lua functions
local _G = getfenv()
local gsub, split = string.gsub, string.split
local ceil = math.ceil
local mod = math.mod
--WoW API / Variables
local CreateFrame = CreateFrame
local UIFrameFadeIn = UIFrameFadeIn
local UIFrameFadeOut = UIFrameFadeOut
E.ActionBars = AB
AB["handledBars"] = {}
AB["handledButtons"] = {}
AB["barDefaults"] = {
["bar1"] = {
["name"] = "Action",
["position"] = "BOTTOM,ElvUIParent,BOTTOM,0,4",
},
["bar2"] = {
["name"] = "MultiBarBottomRight",
["position"] = "BOTTOM,ElvUI_Bar1,TOP,0,2"
},
["bar3"] = {
["name"] = "MultiBarRight",
["position"] = "LEFT,ElvUI_Bar1,RIGHT,4,0"
},
["bar4"] = {
["name"] = "MultiBarLeft",
["position"] = "RIGHT,ElvUIParent,RIGHT,-4,0"
},
["bar5"] = {
["name"] = "MultiBarBottomLeft",
["position"] = "RIGHT,ElvUI_Bar1,LEFT,-4,0"
}
}
function AB:PositionAndSizeBar(barName)
local buttonSpacing = E:Scale(self.db[barName].buttonspacing)
local backdropSpacing = E:Scale((self.db[barName].backdropSpacing or self.db[barName].buttonspacing))
local buttonsPerRow = self.db[barName].buttonsPerRow
local numButtons = self.db[barName].buttons
local size = E:Scale(self.db[barName].buttonsize)
local point = self.db[barName].point
local numColumns = ceil(numButtons / buttonsPerRow)
local widthMult = self.db[barName].widthMult
local heightMult = self.db[barName].heightMult
local bar = self["handledBars"][barName]
bar.db = self.db[barName]
if numButtons < buttonsPerRow then
buttonsPerRow = numButtons
end
if numColumns < 1 then
numColumns = 1
end
if self.db[barName].backdrop then
bar.backdrop:Show()
else
bar.backdrop:Hide()
widthMult = 1
heightMult = 1
end
local barWidth = (size * (buttonsPerRow * widthMult)) + ((buttonSpacing * (buttonsPerRow - 1)) * widthMult) + (buttonSpacing * (widthMult-1)) + ((self.db[barName].backdrop and (E.Border + backdropSpacing) or E.Spacing)*2)
local barHeight = (size * (numColumns * heightMult)) + ((buttonSpacing * (numColumns - 1)) * heightMult) + (buttonSpacing * (heightMult-1)) + ((self.db[barName].backdrop and (E.Border + backdropSpacing) or E.Spacing)*2)
bar:SetWidth(barWidth)
bar:SetHeight(barHeight)
bar.mouseover = self.db[barName].mouseover
local horizontalGrowth, verticalGrowth
if point == "TOPLEFT" or point == "TOPRIGHT" then
verticalGrowth = "DOWN"
else
verticalGrowth = "UP"
end
if point == "BOTTOMLEFT" or point == "TOPLEFT" then
horizontalGrowth = "RIGHT"
else
horizontalGrowth = "LEFT"
end
if self.db[barName].mouseover then
bar:SetAlpha(0)
else
bar:SetAlpha(self.db[barName].alpha)
end
local button, lastButton, lastColumnButton, x, y
local firstButtonSpacing = (self.db[barName].backdrop and (E.Border + backdropSpacing) or E.Spacing)
for i = 1, NUM_ACTIONBAR_BUTTONS do
button = bar.buttons[i]
lastButton = bar.buttons[i-1]
lastColumnButton = bar.buttons[i-buttonsPerRow]
button:ClearAllPoints()
if barName == "bar1" then
button:SetParent(bar)
end
button:SetWidth(size)
button:SetHeight(size)
ActionButton_ShowGrid(button)
if i == 1 then
if point == "BOTTOMLEFT" then
x, y = firstButtonSpacing, firstButtonSpacing
elseif point == "TOPRIGHT" then
x, y = -firstButtonSpacing, -firstButtonSpacing
elseif point == "TOPLEFT" then
x, y = firstButtonSpacing, -firstButtonSpacing
else
x, y = -firstButtonSpacing, firstButtonSpacing
end
button:SetPoint(point, bar, point, x, y)
elseif mod((i - 1), buttonsPerRow) == 0 then
x = 0
y = -buttonSpacing
local buttonPoint, anchorPoint = "TOP", "BOTTOM"
if verticalGrowth == "UP" then
y = buttonSpacing
buttonPoint = "BOTTOM"
anchorPoint = "TOP"
end
button:SetPoint(buttonPoint, lastColumnButton, anchorPoint, x, y)
else
x = buttonSpacing
y = 0
local buttonPoint, anchorPoint = "LEFT", "RIGHT"
if horizontalGrowth == "LEFT" then
x = -buttonSpacing
buttonPoint = "RIGHT"
anchorPoint = "LEFT"
end
button:SetPoint(buttonPoint, lastButton, anchorPoint, x, y)
end
if i > numButtons then
button:SetScale(0.000001)
button:SetAlpha(0)
else
button:SetScale(1)
button:SetAlpha(1)
end
end
if self.db[barName].enabled or not bar.initialized then
if not self.db[barName].mouseover then
bar:SetAlpha(self.db[barName].alpha)
end
bar:Show()
if not bar.initialized then
bar.initialized = true
self:PositionAndSizeBar(barName)
return
end
else
bar:Hide()
end
E:SetMoverSnapOffset("ElvAB_"..bar.id, bar.db.buttonspacing / 2)
end
function AB:CreateBar(id)
local bar = CreateFrame("Button", "ElvUI_Bar"..id, E.UIParent)
local point, anchor, attachTo, x, y = split(",", self["barDefaults"]["bar"..id].position)
bar:SetPoint(point, anchor, attachTo, x, y)
bar.id = id
E:CreateBackdrop(bar, "Default")
bar:SetFrameStrata("LOW")
local offset = E.Spacing
bar.backdrop:SetPoint("TOPLEFT", bar, "TOPLEFT", offset, -offset)
bar.backdrop:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -offset, offset)
bar.buttons = {}
self:HookScript(bar, "OnEnter", "Bar_OnEnter")
self:HookScript(bar, "OnLeave", "Bar_OnLeave")
for i = 1, NUM_ACTIONBAR_BUTTONS do
local button = _G[self["barDefaults"]["bar"..id].name.."Button"..i]
bar.buttons[i] = button
bar.buttons[i].id = id
self:HookScript(button, "OnEnter", "Button_OnEnter")
self:HookScript(button, "OnLeave", "Button_OnLeave")
end
if id ~= 1 then
_G[self["barDefaults"]["bar"..id].name]:SetParent(bar)
end
self["handledBars"]["bar"..id] = bar
self:PositionAndSizeBar("bar"..id)
E:CreateMover(bar, "ElvAB_"..id, L["Bar "]..id, nil, nil, nil,"ALL,ACTIONBARS")
return bar
end
function AB:UpdateButtonSettings()
for button, _ in pairs(self["handledButtons"]) do
if button then
self:StyleButton(button, button.noBackdrop)
else
self["handledButtons"][button] = nil
end
end
for i = 1, 5 do
self:PositionAndSizeBar("bar"..i)
end
--self:PositionAndSizeBarPet()
--self:PositionAndSizeBarShapeShift()
end
function AB:StyleButton(button, noBackdrop)
local name = button:GetName()
local icon = _G[name.."Icon"]
local count = _G[name.."Count"]
local flash = _G[name.."Flash"]
local hotkey = _G[name.."HotKey"]
local border = _G[name.."Border"]
local macroName = _G[name.."Name"]
local normal = _G[name.."NormalTexture"]
local normal2 = button:GetNormalTexture()
local buttonCooldown = _G[name.."Cooldown"]
local color = self.db.fontColor
if flash then flash:SetTexture(nil) end
if normal then normal:SetTexture(nil) normal:Hide() normal:SetAlpha(0) end
if normal2 then normal2:SetTexture(nil) normal2:Hide() normal2:SetAlpha(0) end
if border then E:Kill(border) end
if not button.noBackdrop then
button.noBackdrop = noBackdrop
end
if count then
count:ClearAllPoints()
count:SetPoint("BOTTOMRIGHT", 0, 2)
E:FontTemplate(count, LSM:Fetch("font", self.db.font), self.db.fontSize, self.db.fontOutline)
count:SetTextColor(color.r, color.g, color.b)
end
if macroName then
if self.db.macrotext then
macroName:Show()
E:FontTemplate(macroName, LSM:Fetch("font", self.db.font), self.db.fontSize, self.db.fontOutline)
macroName:ClearAllPoints()
macroName:Point("BOTTOM", 2, 2)
macroName:SetJustifyH("CENTER")
else
macroName:Hide()
end
end
if not button.noBackdrop and not button.backdrop then
E:CreateBackdrop(button, "Default", true)
button.backdrop:SetAllPoints()
end
if icon then
icon:SetTexCoord(unpack(E.TexCoords))
E:SetInside(icon)
end
if self.db.hotkeytext then
E:FontTemplate(hotkey, LSM:Fetch("font", self.db.font), self.db.fontSize, self.db.fontOutline)
hotkey:SetTextColor(color.r, color.g, color.b)
end
self:FixKeybindText(button)
E:StyleButton(button)
if(not self.handledButtons[button]) then
E:RegisterCooldown(buttonCooldown)
self.handledButtons[button] = true
end
end
function AB:Bar_OnEnter()
if this.mouseover then
UIFrameFadeIn(this, 0.2, this:GetAlpha(), this.db.alpha)
end
end
function AB:Bar_OnLeave()
if this.mouseover then
UIFrameFadeOut(this, 0.2, this:GetAlpha(), 0)
end
end
function AB:Button_OnEnter()
local bar = self["handledBars"]["bar"..this.id]
if bar.mouseover then
UIFrameFadeIn(bar, 0.2, bar:GetAlpha(), bar.db.alpha)
end
end
function AB:Button_OnLeave()
local bar = self["handledBars"]["bar"..this.id]
if bar.mouseover then
UIFrameFadeOut(bar, 0.2, bar:GetAlpha(), 0)
end
end
function AB:DisableBlizzard()
MainMenuBar:SetScale(0.00001)
MainMenuBar:EnableMouse(false)
PetActionBarFrame:EnableMouse(false)
ShapeshiftBarFrame:EnableMouse(false)
local elements = {
MainMenuBar,
MainMenuBarArtFrame,
BonusActionBarFrame,
PetActionBarFrame,
ShapeshiftBarFrame,
ShapeshiftBarLeft,
ShapeshiftBarMiddle,
ShapeshiftBarRight,
}
for _, element in pairs(elements) do
if element:GetObjectType() == "Frame" then
element:UnregisterAllEvents()
if element == MainMenuBarArtFrame then
element:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
end
end
if element ~= MainMenuBar then
element:Hide()
end
element:SetAlpha(0)
end
elements = nil
local uiManagedFrames = {
"MultiBarLeft",
"MultiBarRight",
"MultiBarBottomLeft",
"MultiBarBottomRight",
"ShapeshiftBarFrame",
"PETACTIONBAR_YPOS",
}
for _, frame in pairs(uiManagedFrames) do
UIPARENT_MANAGED_FRAME_POSITIONS[frame] = nil
end
uiManagedFrames = nil
end
function AB:FixKeybindText(button)
local hotkey = _G[button:GetName().."HotKey"]
local text = hotkey:GetText()
if text then
text = gsub(text, "SHIFT%-", L["KEY_SHIFT"])
text = gsub(text, "ALT%-", L["KEY_ALT"])
text = gsub(text, "CTRL%-", L["KEY_CTRL"])
text = gsub(text, "BUTTON", L["KEY_MOUSEBUTTON"])
text = gsub(text, "MOUSEWHEELUP", L["KEY_MOUSEWHEELUP"])
text = gsub(text, "MOUSEWHEELDOWN", L["KEY_MOUSEWHEELDOWN"])
text = gsub(text, "NUMPAD", L["KEY_NUMPAD"])
text = gsub(text, "PAGEUP", L["KEY_PAGEUP"])
text = gsub(text, "PAGEDOWN", L["KEY_PAGEDOWN"])
text = gsub(text, "SPACE", L["KEY_SPACE"])
text = gsub(text, "INSERT", L["KEY_INSERT"])
text = gsub(text, "HOME", L["KEY_HOME"])
text = gsub(text, "DELETE", L["KEY_DELETE"])
text = gsub(text, "NMULTIPLY", "*")
text = gsub(text, "NMINUS", "N-")
text = gsub(text, "NPLUS", "N+")
if hotkey:GetText() == _G["RANGE_INDICATOR"] then
hotkey:SetText("")
else
hotkey:SetText(text)
end
end
if self.db.hotkeytext == true then
hotkey:Show()
else
hotkey:Hide()
end
hotkey:ClearAllPoints()
hotkey:SetPoint("TOPRIGHT", 0, -3)
end
function AB:ActionButton_Update()
self:StyleButton(this)
end
function AB:Initialize()
self.db = E.db.actionbar
if E.private.actionbar.enable ~= true then return end
self:DisableBlizzard()
self:SetupMicroBar()
for i = 1, 5 do
self:CreateBar(i)
end
self:UpdateButtonSettings()
--self:LoadKeyBinder()
self:SecureHook("ActionButton_Update")
--self:SecureHook("PetActionBar_Update", "UpdatePet")
end
local function InitializeCallback()
AB:Initialize()
end
E:RegisterModule(AB:GetName(), InitializeCallback)
@@ -0,0 +1,214 @@
--[[
tullaRange
Adds out of range coloring to action buttons
Derived from RedRange with negligable improvements to CPU usage
--]]
local E, L, V, P, G = unpack(ElvUI)
local _G = getfenv()
local UPDATE_DELAY = 0.1
local ATTACK_BUTTON_FLASH_TIME = ATTACK_BUTTON_FLASH_TIME
local ActionButton_GetPagedID = ActionButton_GetPagedID
local ActionButton_IsFlashing = ActionButton_IsFlashing
local ActionHasRange = ActionHasRange
local IsActionInRange = IsActionInRange
local IsUsableAction = IsUsableAction
local HasAction = HasAction
local tullaRange = CreateFrame("Frame", "tullaRange", UIParent); tullaRange:Hide()
function tullaRange:Load()
self:SetScript("OnUpdate", self.OnUpdate)
self:SetScript("OnHide", self.OnHide)
self:SetScript("OnEvent", self.OnEvent)
self.elapsed = 0
self:RegisterEvent("PLAYER_LOGIN")
end
function tullaRange:OnEvent()
local action = this[event]
if action then
action(this, event)
end
end
function tullaRange:OnUpdate()
if this.elapsed < UPDATE_DELAY then
this.elapsed = this.elapsed + arg1
else
this:Update()
end
end
function tullaRange:OnHide()
this.elapsed = 0
end
function tullaRange:PLAYER_LOGIN()
if not TULLARANGE_COLORS then
self:LoadDefaults()
end
self.colors = TULLARANGE_COLORS
self.buttonsToUpdate = {}
hooksecurefunc("ActionButton_OnUpdate", self.RegisterButton)
hooksecurefunc("ActionButton_UpdateUsable", self.OnUpdateButtonUsable)
hooksecurefunc("ActionButton_Update", self.OnButtonUpdate)
end
function tullaRange:Update()
self:UpdateButtons(self.elapsed)
self.elapsed = 0
end
function tullaRange:ForceColorUpdate()
for button in pairs(self.buttonsToUpdate) do
tullaRange.OnUpdateButtonUsable(button)
end
end
function tullaRange:UpdateShown()
if next(self.buttonsToUpdate) then
self:Show()
else
self:Hide()
end
end
function tullaRange:UpdateButtons(elapsed)
if not next(self.buttonsToUpdate) then
self:Hide()
return
end
for button in pairs(self.buttonsToUpdate) do
self:UpdateButton(button, elapsed)
end
end
function tullaRange:UpdateButton(button, elapsed)
tullaRange.UpdateButtonUsable(button)
tullaRange.UpdateFlash(button, elapsed)
end
function tullaRange:UpdateButtonStatus()
local action = ActionButton_GetPagedID(this)
if not(this:IsVisible() and action and HasAction(action) and ActionHasRange(action)) then
self.buttonsToUpdate[this] = nil
else
self.buttonsToUpdate[this] = true
end
self:UpdateShown()
end
function tullaRange.RegisterButton()
this:SetScript("OnShow", tullaRange.OnButtonShow)
this:SetScript("OnHide", tullaRange.OnButtonHide)
this:SetScript("OnUpdate", nil)
tullaRange:UpdateButtonStatus(this)
end
function tullaRange.OnButtonShow()
tullaRange:UpdateButtonStatus(this)
end
function tullaRange.OnButtonHide()
tullaRange:UpdateButtonStatus(this)
end
function tullaRange.OnUpdateButtonUsable()
this.tullaRangeColor = nil
tullaRange.UpdateButtonUsable(this)
end
function tullaRange.OnButtonUpdate()
tullaRange:UpdateButtonStatus(this)
end
function tullaRange.UpdateButtonUsable(button)
local action = ActionButton_GetPagedID(button)
local isUsable, notEnoughMana = IsUsableAction(action)
if isUsable then
if IsActionInRange(action) == 0 then
tullaRange.SetButtonColor(button, "OOR")
else
tullaRange.SetButtonColor(button, "NORMAL")
end
elseif notEnoughMana then
tullaRange.SetButtonColor(button, "OOM")
else
tullaRange.SetButtonColor(button, "UNUSABLE")
end
end
function tullaRange.SetButtonColor(button, colorType)
if button.tullaRangeColor ~= colorType then
button.tullaRangeColor = colorType
local r, g, b = tullaRange:GetColor(colorType)
local icon = _G[button:GetName() .. "Icon"]
icon:SetVertexColor(r, g, b)
end
end
function tullaRange.UpdateFlash(button, elapsed)
if ActionButton_IsFlashing(button) then
local flashtime = button.flashtime - elapsed
if flashtime <= 0 then
local overtime = -flashtime
if overtime >= ATTACK_BUTTON_FLASH_TIME then
overtime = 0
end
flashtime = ATTACK_BUTTON_FLASH_TIME - overtime
local flashTexture = _G[button:GetName() .. "Flash"]
if flashTexture:IsShown() then
flashTexture:Hide()
else
flashTexture:Show()
end
end
button.flashtime = flashtime
end
end
function tullaRange:LoadDefaults()
TULLARANGE_COLORS = {
["OOR"] = E:GetColorTable(E.db.actionbar.noRangeColor),
["OOM"] = E:GetColorTable(E.db.actionbar.noPowerColor),
["NORMAL"] = E:GetColorTable(E.db.actionbar.usableColor),
["UNUSABLE"] = E:GetColorTable(E.db.actionbar.notUsableColor)
};
end
function tullaRange:Reset()
self:LoadDefaults()
self.colors = TULLARANGE_COLORS
self:ForceColorUpdate()
end
function tullaRange:SetColor(index, r, g, b)
local color = self.colors[index]
color[1] = r
color[2] = g
color[3] = b
self:ForceColorUpdate()
end
function tullaRange:GetColor(index)
local color = self.colors[index]
return color[1], color[2], color[3]
end
tullaRange:Load()
@@ -0,0 +1,8 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="ActionBars.lua"/>
<Script file="Microbar.lua"/>
<Script file="BarPet.lua"/>
<Script file="ButtonColoring.lua"/>
<Script file="BarShapeShift.lua"/>
<Script file="Bind.lua"/>
</Ui>
@@ -0,0 +1,134 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local AB = E:GetModule("ActionBars");
--Cache global variables
--Lua functions
local _G = getfenv()
local getn = table.getn
local mod = math.mod
--WoW API / Variables
local CreateFrame = CreateFrame
local MICRO_BUTTONS = {
"CharacterMicroButton",
"SpellbookMicroButton",
"TalentMicroButton",
"QuestLogMicroButton",
"SocialsMicroButton",
"WorldMapMicroButton",
"MainMenuMicroButton",
"HelpMicroButton"
}
local function Button_OnEnter()
if AB.db.microbar.mouseover then
UIFrameFadeIn(ElvUI_MicroBar, .2, ElvUI_MicroBar:GetAlpha(), AB.db.microbar.alpha)
end
end
local function Button_OnLeave()
if AB.db.microbar.mouseover then
UIFrameFadeOut(ElvUI_MicroBar, .2, ElvUI_MicroBar:GetAlpha(), 0)
end
end
function AB:HandleMicroButton(button)
local pushed = button:GetPushedTexture()
local normal = button:GetNormalTexture()
local disabled = button:GetDisabledTexture()
--button:SetParent(ElvUI_MicroBar)
E:Kill(button:GetHighlightTexture())
HookScript(button, "OnEnter", Button_OnEnter)
HookScript(button, "OnLeave", Button_OnLeave)
local f = CreateFrame("Frame", nil, button)
f:SetFrameLevel(1)
f:SetFrameStrata("BACKGROUND")
f:SetPoint("BOTTOMLEFT", button, "BOTTOMLEFT", 2, 0)
f:SetPoint("TOPRIGHT", button, "TOPRIGHT", -2, -28)
E:SetTemplate(f, "Default", true)
button.backdrop = f
pushed:SetTexCoord(0.17, 0.87, 0.5, 0.908)
E:SetInside(pushed, f)
normal:SetTexCoord(0.17, 0.87, 0.5, 0.908)
E:SetInside(normal, f)
if disabled then
disabled:SetTexCoord(0.17, 0.87, 0.5, 0.908)
E:SetInside(disabled, f)
end
end
function AB:UpdateMicroButtonsParent()
if CharacterMicroButton:GetParent() == ElvUI_MicroBar then return end
for i = 1, getn(MICRO_BUTTONS) do
-- _G[MICRO_BUTTONS[i]]:SetParent(ElvUI_MicroBar)
end
AB:UpdateMicroPositionDimensions()
end
function AB:UpdateMicroPositionDimensions()
if not ElvUI_MicroBar then return; end
local numRows = 1
for i = 1, getn(MICRO_BUTTONS) do
local button = _G[MICRO_BUTTONS[i]]
local prevButton = _G[MICRO_BUTTONS[i-1]] or ElvUI_MicroBar
local lastColumnButton = _G[MICRO_BUTTONS[i-self.db.microbar.buttonsPerRow]]
button:ClearAllPoints()
if prevButton == ElvUI_MicroBar then
button:SetPoint("TOPLEFT", prevButton, "TOPLEFT", -2 + E.Border, 28 - E.Border)
elseif mod((i - 1), self.db.microbar.buttonsPerRow) == 0 then
button:SetPoint("TOP", lastColumnButton, "BOTTOM", 0, 28 - self.db.microbar.yOffset)
numRows = numRows + 1
else
button:SetPoint("LEFT", prevButton, "RIGHT", - 4 + self.db.microbar.xOffset, 0)
end
end
if AB.db.microbar.mouseover then
ElvUI_MicroBar:SetAlpha(0)
else
ElvUI_MicroBar:SetAlpha(self.db.microbar.alpha)
end
AB.MicroWidth = ((_G["CharacterMicroButton"]:GetWidth() - 4) * self.db.microbar.buttonsPerRow) + (self.db.microbar.xOffset * (self.db.microbar.buttonsPerRow - 1)) + E.Border * 2
AB.MicroHeight = ((_G["CharacterMicroButton"]:GetHeight() - 28) * numRows) + (self.db.microbar.yOffset * (numRows - 1)) + E.Border * 2
ElvUI_MicroBar:SetWidth(AB.MicroWidth)
ElvUI_MicroBar:SetHeight(AB.MicroHeight)
if self.db.microbar.enabled then
ElvUI_MicroBar:Show()
if ElvUI_MicroBar.mover then
E:EnableMover(ElvUI_MicroBar.mover:GetName())
end
else
ElvUI_MicroBar:Hide()
if ElvUI_MicroBar.mover then
E:DisableMover(ElvUI_MicroBar.mover:GetName())
end
end
end
function AB:SetupMicroBar()
local microBar = CreateFrame("Frame", "ElvUI_MicroBar", E.UIParent)
microBar:SetPoint("TOPLEFT", E.UIParent, "TOPLEFT", 4, -48)
for i = 1, getn(MICRO_BUTTONS) do
self:HandleMicroButton(_G[MICRO_BUTTONS[i]])
end
E:SetInside(MicroButtonPortrait, CharacterMicroButton.backdrop)
self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateMicroButtonsParent")
self:UpdateMicroPositionDimensions()
E:CreateMover(microBar, "MicrobarMover", L["Micro Bar"], nil, nil, nil, "ALL,ACTIONBARS")
end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,3 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Chat.lua"/>
</Ui>
@@ -0,0 +1,66 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local mod = E:NewModule("DataBars", "AceEvent-3.0");
E.DataBars = mod
--Cache global variables
--Lua functions
local _G = _G
--WoW API / Variables
local UIFrameFadeOut = UIFrameFadeOut
function mod:OnLeave()
if (this == ElvUI_ExperienceBar and mod.db.experience.mouseover) or (this == ElvUI_ReputationBar and mod.db.reputation.mouseover) then
UIFrameFadeOut(this, 1, this:GetAlpha(), 0)
end
GameTooltip:Hide()
end
function mod:CreateBar(name, onEnter, onClick, ...)
local bar = CreateFrame("Button", name, E.UIParent)
bar:SetPoint(unpack(arg))
bar:SetScript("OnEnter", onEnter)
bar:SetScript("OnLeave", mod.OnLeave)
bar:SetScript("OnClick", onClick)
bar:SetFrameStrata("LOW")
E:SetTemplate(bar, "Transparent")
bar:Hide()
bar.statusBar = CreateFrame("StatusBar", nil, bar)
E:SetInside(bar.statusBar)
bar.statusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(bar.statusBar)
bar.text = bar.statusBar:CreateFontString(nil, "OVERLAY")
E:FontTemplate(bar.text)
bar.text:SetPoint("CENTER", 0, 0)
return bar
end
function mod:UpdateDataBarDimensions()
self:UpdateExperienceDimensions()
self:UpdateReputationDimensions()
end
function mod:PLAYER_LEVEL_UP(level, level2)
print(level, level2)
local maxLevel = 60
if (level ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then
self:UpdateExperience("PLAYER_LEVEL_UP", level)
else
self.expBar:Hide()
end
end
function mod:Initialize()
self.db = E.db.databars
self:LoadExperienceBar()
self:LoadReputationBar()
self:RegisterEvent("PLAYER_LEVEL_UP")
end
local function InitializeCallback()
mod:Initialize()
end
E:RegisterModule(mod:GetName(), InitializeCallback)
@@ -0,0 +1,166 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local mod = E:GetModule("DataBars");
local LSM = LibStub("LibSharedMedia-3.0");
--Cache global variables
--Lua functions
local _G = _G
local format = format
local min = min
--WoW API / Variables
local GetPetExperience, UnitXP, UnitXPMax = GetPetExperience, UnitXP, UnitXPMax
local UnitLevel = UnitLevel
local GetXPExhaustion = GetXPExhaustion
function mod:GetXP(unit)
if unit == "pet" then
return GetPetExperience()
else
return UnitXP(unit), UnitXPMax(unit)
end
end
function mod:UpdateExperience(event)
if not mod.db.experience.enable then return end
local bar = self.expBar
local hideXP = (UnitLevel("player") == 60 and self.db.experience.hideAtMaxLevel)
if hideXP then
E:DisableMover(self.expBar.mover:GetName())
bar:Hide()
elseif not hideXP then
E:EnableMover(self.expBar.mover:GetName())
bar:Show()
local cur, max = self:GetXP("player")
if max <= 0 then max = 1 end
bar.statusBar:SetMinMaxValues(0, max)
bar.statusBar:SetValue(cur - 1 >= 0 and cur - 1 or 0)
bar.statusBar:SetValue(cur)
local rested = GetXPExhaustion()
local text = ""
local textFormat = self.db.experience.textFormat
if rested and rested > 0 then
bar.rested:SetMinMaxValues(0, max)
bar.rested:SetValue(min(cur + rested, max))
if textFormat == "PERCENT" then
text = format("%d%% R:%d%%", cur / max * 100, rested / max * 100)
elseif textFormat == "CURMAX" then
text = format("%s - %s R:%s", E:ShortValue(cur), E:ShortValue(max), E:ShortValue(rested))
elseif textFormat == "CURPERC" then
text = format("%s - %d%% R:%s [%d%%]", E:ShortValue(cur), cur / max * 100, E:ShortValue(rested), rested / max * 100)
elseif textFormat == "CUR" then
text = format("%s R:%s", E:ShortValue(cur), E:ShortValue(rested))
elseif textFormat == "REM" then
text = format("%s R:%s", E:ShortValue(max - cur), E:ShortValue(rested))
elseif textFormat == "CURREM" then
text = format("%s - %s R:%s", E:ShortValue(cur), E:ShortValue(max - cur), E:ShortValue(rested))
elseif textFormat == "CURPERCREM" then
text = format("%s - %d%% (%s) R:%s", E:ShortValue(cur), cur / max * 100, E:ShortValue(max - cur), E:ShortValue(rested))
end
else
bar.rested:SetMinMaxValues(0, 1)
bar.rested:SetValue(0)
if textFormat == "PERCENT" then
text = format("%d%%", cur / max * 100)
elseif textFormat == "CURMAX" then
text = format("%s - %s", E:ShortValue(cur), E:ShortValue(max))
elseif textFormat == "CURPERC" then
text = format("%s - %d%%", E:ShortValue(cur), cur / max * 100)
elseif textFormat == "CUR" then
text = format("%s", E:ShortValue(cur))
elseif textFormat == "REM" then
text = format("%s", E:ShortValue(max - cur))
elseif textFormat == "CURREM" then
text = format("%s - %s", E:ShortValue(cur), E:ShortValue(max - cur))
elseif textFormat == "CURPERCREM" then
text = format("%s - %d%% (%s)", E:ShortValue(cur), cur / max * 100, E:ShortValue(max - cur))
end
end
bar.text:SetText(text)
end
end
function mod:ExperienceBar_OnEnter()
if mod.db.experience.mouseover then
UIFrameFadeIn(this, 0.4, this:GetAlpha(), 1)
end
GameTooltip:ClearLines()
GameTooltip:SetOwner(this, "ANCHOR_CURSOR", 0, -4)
local cur, max = mod:GetXP("player")
local rested = GetXPExhaustion()
GameTooltip:AddLine(L["Experience"])
GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine(L["XP:"], format(" %d / %d (%d%%)", cur, max, cur/max * 100), 1, 1, 1)
GameTooltip:AddDoubleLine(L["Remaining:"], format(" %d (%d%% - %d "..L["Bars"]..")", max - cur, (max - cur) / max * 100, 20 * (max - cur) / max), 1, 1, 1)
if rested then
GameTooltip:AddDoubleLine(L["Rested:"], format("+%d (%d%%)", rested, rested / max * 100), 1, 1, 1)
end
GameTooltip:Show()
end
function mod:ExperienceBar_OnClick()
end
function mod:UpdateExperienceDimensions()
self.expBar:SetWidth(self.db.experience.width)
self.expBar:SetHeight(self.db.experience.height)
E:FontTemplate(self.expBar.text, LSM:Fetch("font", self.db.experience.font), self.db.experience.textSize, self.db.experience.fontOutline)
self.expBar.rested:SetOrientation(self.db.experience.orientation)
self.expBar.statusBar:SetOrientation(self.db.experience.orientation)
if self.db.experience.mouseover then
self.expBar:SetAlpha(0)
else
self.expBar:SetAlpha(1)
end
end
function mod:EnableDisable_ExperienceBar()
local maxLevel = 60
if (UnitLevel("player") ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then
self:RegisterEvent("PLAYER_XP_UPDATE", "UpdateExperience")
self:RegisterEvent("DISABLE_XP_GAIN", "UpdateExperience")
self:RegisterEvent("ENABLE_XP_GAIN", "UpdateExperience")
self:RegisterEvent("UPDATE_EXHAUSTION", "UpdateExperience")
self:UnregisterEvent("UPDATE_EXPANSION_LEVEL")
self:UpdateExperience()
E:EnableMover(self.expBar.mover:GetName())
else
self:UnregisterEvent("PLAYER_XP_UPDATE")
self:UnregisterEvent("DISABLE_XP_GAIN")
self:UnregisterEvent("ENABLE_XP_GAIN")
self:UnregisterEvent("UPDATE_EXHAUSTION")
self:RegisterEvent("UPDATE_EXPANSION_LEVEL", "EnableDisable_ExperienceBar")
self.expBar:Hide()
E:DisableMover(self.expBar.mover:GetName())
end
end
function mod:LoadExperienceBar()
self.expBar = self:CreateBar("ElvUI_ExperienceBar", self.ExperienceBar_OnEnter, self.ExperienceBar_OnClick, "LEFT", LeftChatPanel, "RIGHT", -E.Border + E.Spacing*3, 0)
self.expBar.statusBar:SetStatusBarColor(0, 0.4, 1, .8)
self.expBar.rested = CreateFrame("StatusBar", nil, self.expBar)
E:SetInside(self.expBar.rested)
self.expBar.rested:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(self.expBar.rested)
self.expBar.rested:SetStatusBarColor(1, 0, 1, 0.2)
self:UpdateExperienceDimensions()
E:CreateMover(self.expBar, "ExperienceBarMover", L["Experience Bar"])
self:EnableDisable_ExperienceBar()
end
@@ -0,0 +1,5 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="DataBars.lua"/>
<Script file="Experience.lua"/>
<Script file="Reputation.lua"/>
</Ui>
@@ -0,0 +1,132 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local mod = E:GetModule("DataBars");
local LSM = LibStub("LibSharedMedia-3.0");
--Cache global variables
--Lua functions
local _G = _G
local format = format
--WoW API / Variables
local GetWatchedFactionInfo, GetNumFactions, GetFactionInfo = GetWatchedFactionInfo, GetNumFactions, GetFactionInfo
local InCombatLockdown = InCombatLockdown
local FACTION_BAR_COLORS = FACTION_BAR_COLORS
local REPUTATION, STANDING = REPUTATION, STANDING
local backupColor = FACTION_BAR_COLORS[1]
local FactionStandingLabelUnknown = UNKNOWN
function mod:UpdateReputation(event)
if not mod.db.reputation.enable then return end
local bar = self.repBar
local ID, standingLabel
local name, reaction, min, max, value = GetWatchedFactionInfo()
local numFactions = GetNumFactions()
if not name then
bar:Hide()
elseif name then
bar:Show()
local text = ""
local textFormat = self.db.reputation.textFormat
local color = FACTION_BAR_COLORS[reaction] or backupColor
bar.statusBar:SetStatusBarColor(color.r, color.g, color.b)
bar.statusBar:SetMinMaxValues(min, max)
bar.statusBar:SetValue(value)
for i = 1, numFactions do
local factionName, _, standingID = GetFactionInfo(i)
if factionName == name then
ID = standingID;
end
end
if ID then
standingLabel = _G["FACTION_STANDING_LABEL"..ID]
else
standingLabel = FactionStandingLabelUnknown
end
--Prevent a division by zero
local maxMinDiff = max - min
if maxMinDiff == 0 then
maxMinDiff = 1
end
if textFormat == "PERCENT" then
text = format("%s: %d%% [%s]", name, ((value - min) / maxMinDiff * 100), standingLabel)
elseif textFormat == "CURMAX" then
text = format("%s: %s - %s [%s]", name, E:ShortValue(value - min), E:ShortValue(max - min), standingLabel)
elseif textFormat == "CURPERC" then
text = format("%s: %s - %d%% [%s]", name, E:ShortValue(value - min), ((value - min) / maxMinDiff * 100), standingLabel)
elseif textFormat == "CUR" then
text = format("%s: %s [%s]", name, E:ShortValue(value - min), standingLabel)
elseif textFormat == "REM" then
text = format("%s: %s [%s]", name, E:ShortValue((max - min) - (value-min)), standingLabel)
elseif textFormat == "CURREM" then
text = format("%s: %s - %s [%s]", name, E:ShortValue(value - min), E:ShortValue((max - min) - (value-min)), standingLabel)
elseif textFormat == "CURPERCREM" then
text = format("%s: %s - %d%% (%s) [%s]", name, E:ShortValue(value - min), ((value - min) / maxMinDiff * 100), E:ShortValue((max - min) - (value-min)), standingLabel)
end
bar.text:SetText(text)
end
end
function mod:ReputationBar_OnEnter()
if mod.db.reputation.mouseover then
UIFrameFadeIn(this, 0.4, this:GetAlpha(), 1)
end
GameTooltip:ClearLines()
GameTooltip:SetOwner(this, "ANCHOR_CURSOR", 0, -4)
local name, reaction, min, max, value = GetWatchedFactionInfo()
if name then
GameTooltip:AddLine(name)
GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine(STANDING..":", _G["FACTION_STANDING_LABEL"..reaction], 1, 1, 1)
GameTooltip:AddDoubleLine(REPUTATION..":", format("%d / %d (%d%%)", value - min, max - min, (value - min) / ((max - min == 0) and max or (max - min)) * 100), 1, 1, 1)
end
GameTooltip:Show()
end
function mod:ReputationBar_OnClick()
ToggleCharacter("ReputationFrame");
end
function mod:UpdateReputationDimensions()
self.repBar:SetWidth(self.db.reputation.width)
self.repBar:SetHeight(self.db.reputation.height)
self.repBar.statusBar:SetOrientation(self.db.reputation.orientation)
E:FontTemplate(self.repBar.text, LSM:Fetch("font", self.db.reputation.font), self.db.reputation.textSize, self.db.reputation.fontOutline)
if self.db.reputation.mouseover then
self.repBar:SetAlpha(0)
else
self.repBar:SetAlpha(1)
end
end
function mod:EnableDisable_ReputationBar()
if self.db.reputation.enable then
self:RegisterEvent("UPDATE_FACTION", "UpdateReputation")
self:UpdateReputation()
E:EnableMover(self.repBar.mover:GetName())
else
self:UnregisterEvent("UPDATE_FACTION")
self.repBar:Hide()
E:DisableMover(self.repBar.mover:GetName())
end
end
function mod:LoadReputationBar()
self.repBar = self:CreateBar("ElvUI_ReputationBar", self.ReputationBar_OnEnter, self.ReputationBar_OnClick, "RIGHT", RightChatPanel, "LEFT", E.Border - E.Spacing*3, 0)
E:RegisterStatusBar(self.repBar.statusBar)
self:UpdateReputationDimensions()
E:CreateMover(self.repBar, "ReputationBarMover", L["Reputation Bar"])
self:EnableDisable_ReputationBar()
end
@@ -0,0 +1,70 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local format = string.format
local join = string.join
--WoW API / Variables
local UnitArmor = UnitArmor
local UnitLevel = UnitLevel
local ARMOR = ARMOR
local lastPanel
local chanceString = "%.2f%%"
local displayString = ""
local _, effectiveArmor
local function GetArmorReduction(armor, attackerLevel)
local levelModifier = attackerLevel
if levelModifier > 59 then
levelModifier = levelModifier + (4.5 * (levelModifier - 59))
end
local temp = 0.1 * armor/(8.5 * levelModifier + 40)
temp = temp/(1 + temp)
if temp > 0.75 then return 75 end
if temp < 0 then return 0 end
return temp*100
end
local function OnEvent(self)
_, effectiveArmor = UnitArmor("player")
self.text:SetText(format(displayString, ARMOR, effectiveArmor))
lastPanel = self
end
local function OnEnter(self)
DT:SetupTooltip(self)
DT.tooltip:AddLine(L["Mitigation By Level: "])
DT.tooltip:AddLine(" ")
local playerLevel = UnitLevel("player") + 3
for i = 1, 4 do
local armorReduction = GetArmorReduction(effectiveArmor, playerLevel)
DT.tooltip:AddDoubleLine(playerLevel, format(chanceString, armorReduction), 1, 1, 1)
playerLevel = playerLevel - 1
end
local targetLevel = UnitLevel("target")
if targetLevel and targetLevel > 0 and (targetLevel > playerLevel + 3 or targetLevel < playerLevel) then
local armorReduction = GetArmorReduction(effectiveArmor, targetLevel)
DT.tooltip:AddDoubleLine(targetLevel, format(chanceString, armorReduction), 1, 1, 1)
end
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
displayString = join("", "%s: ", hex, "%d|r")
if lastPanel ~= nil then
OnEvent(lastPanel)
end
end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
DT:RegisterDatatext("Armor", {"UNIT_RESISTANCES"}, OnEvent, nil, nil, OnEnter, nil, ARMOR)
@@ -0,0 +1,124 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local format, join = string.format, string.join
local abs = math.abs
--WoW API / Variables
local GetInventorySlotInfo = GetInventorySlotInfo
local GetInventoryItemID = GetInventoryItemID
local GetItemInfo = GetItemInfo
local UnitLevel = UnitLevel
local GetDodgeChance = GetDodgeChance
local GetParryChance = GetParryChance
local GetBlockChance = GetBlockChance
local GetBonusBarOffset = GetBonusBarOffset
local BOSS = BOSS
local DODGE_CHANCE = DODGE_CHANCE
local PARRY_CHANCE = PARRY_CHANCE
local BLOCK_CHANCE = BLOCK_CHANCE
DEFENSE = "Defense";
DODGE_CHANCE = "Dodge Chance";
PARRY_CHANCE = "Parry Chance";
BLOCK_CHANCE = "Block Chance";
local displayString, lastPanel
local targetlv, playerlv
local baseMissChance, levelDifference, dodge, parry, block, avoidance, unhittable
local chanceString = "%.2f%%"
local AVD_DECAY_RATE = 0.2
local function IsWearingShield()
local slotID = GetInventorySlotInfo("SecondaryHandSlot")
local itemID = nil
if itemID then
return select(9, GetItemInfo(itemID))
end
end
local function OnEvent(self)
targetlv, playerlv = UnitLevel("target"), UnitLevel("player")
baseMissChance = E.myrace == "NightElf" and 7 or 5
if targetlv == -1 then
levelDifference = 3
elseif targetlv > playerlv then
levelDifference = (targetlv - playerlv)
elseif targetlv < playerlv and targetlv > 0 then
levelDifference = (targetlv - playerlv)
else
levelDifference = 0
end
if levelDifference >= 0 then
dodge = (GetDodgeChance() - levelDifference * AVD_DECAY_RATE)
parry = (GetParryChance() - levelDifference * AVD_DECAY_RATE)
block = (GetBlockChance() - levelDifference * AVD_DECAY_RATE)
baseMissChance = (baseMissChance - levelDifference * AVD_DECAY_RATE)
else
dodge = (GetDodgeChance() + abs(levelDifference * AVD_DECAY_RATE))
parry = (GetParryChance() + abs(levelDifference * AVD_DECAY_RATE))
block = (GetBlockChance() + abs(levelDifference * AVD_DECAY_RATE))
baseMissChance = (baseMissChance+ abs(levelDifference * AVD_DECAY_RATE))
end
if dodge <= 0 then dodge = 0 end
if parry <= 0 then parry = 0 end
if block <= 0 then block = 0 end
if E.myclass == "DRUID" and GetBonusBarOffset() == 3 then
parry = 0
end
if IsWearingShield() ~= "INVTYPE_SHIELD" then
block = 0
end
avoidance = (dodge + parry + block + baseMissChance)
unhittable = avoidance - 102.4
self.text:SetText(format(displayString, DEFENSE, avoidance))
lastPanel = self
end
local function OnEnter(self)
DT:SetupTooltip(self)
if targetlv > 1 then
DT.tooltip:AddDoubleLine(L["Avoidance Breakdown"], join("", " (", L["lvl"], " ", targetlv, ")"))
elseif targetlv == -1 then
DT.tooltip:AddDoubleLine(L["Avoidance Breakdown"], join("", " (", BOSS, ")"))
else
DT.tooltip:AddDoubleLine(L["Avoidance Breakdown"], join("", " (", L["lvl"], " ", playerlv, ")"))
end
DT.tooltip:AddLine(" ")
DT.tooltip:AddDoubleLine(DODGE_CHANCE, format(chanceString, dodge), 1, 1, 1)
DT.tooltip:AddDoubleLine(PARRY_CHANCE, format(chanceString, parry), 1, 1, 1)
DT.tooltip:AddDoubleLine(BLOCK_CHANCE, format(chanceString, block), 1, 1, 1)
DT.tooltip:AddDoubleLine(L["Miss Chance"], format(chanceString, baseMissChance), 1, 1, 1)
DT.tooltip:AddLine(" ")
if unhittable > 0 then
DT.tooltip:AddDoubleLine(L["Unhittable:"], "+" .. format(chanceString, unhittable), 1, 1, 1, 0, 1, 0)
else
DT.tooltip:AddDoubleLine(L["Unhittable:"], format(chanceString, unhittable), 1, 1, 1, 1, 0, 0)
end
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
displayString = join("", "%s: ", hex, "%.2f%%|r")
if lastPanel ~= nil then
OnEvent(lastPanel)
end
end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
DT:RegisterDatatext("Avoidance", {"COMBAT_RATING_UPDATE", "PLAYER_TARGET_CHANGED"}, OnEvent, nil, nil, OnEnter, nil, L["Avoidance Breakdown"])
@@ -0,0 +1,318 @@
local E, L, V, P, G = unpack(ElvUI)
local DT = E:NewModule("DataTexts", "AceTimer-3.0", "AceHook-3.0", "AceEvent-3.0")
local LDB = LibStub:GetLibrary("LibDataBroker-1.1")
local LSM = LibStub("LibSharedMedia-3.0")
local TT = E:GetModule("Tooltip")
local pairs, type, error = pairs, type, error
local len = string.len
local CreateFrame = CreateFrame
local InCombatLockdown = InCombatLockdown
local IsInInstance = IsInInstance
function DT:Initialize()
E.DataTexts = DT
self.tooltip = CreateFrame("GameTooltip", "DatatextTooltip", E.UIParent, "GameTooltipTemplate")
DatatextTooltipTextLeft1:SetFontObject(GameTooltipText)
DatatextTooltipTextRight1:SetFontObject(GameTooltipText)
TT:HookScript(self.tooltip, "OnShow", "SetStyle")
self:RegisterLDB()
LDB.RegisterCallback(E, "LibDataBroker_DataObjectCreated", DT.SetupObjectLDB)
self:LoadDataTexts()
self:RegisterEvent("PLAYER_ENTERING_WORLD")
end
DT.RegisteredPanels = {}
DT.RegisteredDataTexts = {}
DT.PointLocation = {
[1] = "middle",
[2] = "left",
[3] = "right"
}
local hasEnteredWorld = false
function DT:PLAYER_ENTERING_WORLD()
hasEnteredWorld = true
self:LoadDataTexts()
end
local function LoadDataTextsDelayed()
E.Delay(0.5, function() DT:LoadDataTexts() end)
end
local hex = "|cffFFFFFF"
function DT:SetupObjectLDB(name, obj)
local curFrame = nil
local function OnEnter()
DT:SetupTooltip(this)
if obj.OnTooltipShow then
obj.OnTooltipShow(DT.tooltip)
end
if obj.OnEnter then
obj.OnEnter(this)
end
DT.tooltip:Show()
end
local function OnLeave()
if obj.OnLeave then
obj.OnLeave(this)
end
DT.tooltip:Hide()
end
local function OnClick(self, button)
if obj.OnClick then
obj.OnClick(self, button)
end
end
local function textUpdate(_, name, _, value)
if value == nil or (len(value) >= 3) or value == "n/a" or name == value then
curFrame.text:SetText(value ~= "n/a" and value or name)
else
curFrame.text:SetFormattedText("%s: %s%s|r", name, hex, value)
end
end
local function OnEvent(self)
curFrame = self
LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..name.."_text", textUpdate)
LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..name.."_value", textUpdate)
LDB.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_text", name, nil, obj.text, obj)
end
DT:RegisterDatatext(name, {"PLAYER_ENTER_WORLD"}, OnEvent, nil, OnClick, OnEnter, OnLeave)
if DT.PanelLayoutOptions then
DT:PanelLayoutOptions()
end
if hasEnteredWorld then
LoadDataTextsDelayed()
end
end
function DT:RegisterLDB()
for name, obj in LDB:DataObjectIterator() do
self:SetupObjectLDB(name, obj)
end
end
local function ValueColorUpdate(newHex)
hex = newHex
end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
function DT:GetDataPanelPoint(panel, i, numPoints)
if(numPoints == 1) then
return "CENTER", panel, "CENTER"
else
if(i == 1) then
return "CENTER", panel, "CENTER"
elseif(i == 2) then
return "RIGHT", panel.dataPanels["middle"], "LEFT", -4, 0
elseif(i == 3) then
return "LEFT", panel.dataPanels["middle"], "RIGHT", 4, 0
end
end
end
function DT:UpdateAllDimensions()
for _, panel in pairs(DT.RegisteredPanels) do
local width = (panel:GetWidth() / panel.numPoints) - 4
local height = panel:GetHeight() - 4
for i = 1, panel.numPoints do
local pointIndex = DT.PointLocation[i]
panel.dataPanels[pointIndex]:SetWidth(width)
panel.dataPanels[pointIndex]:SetHeight(height)
panel.dataPanels[pointIndex]:SetPoint(DT:GetDataPanelPoint(panel, i, panel.numPoints))
end
end
end
function DT:Data_OnLeave()
DT.tooltip:Hide()
end
function DT:SetupTooltip(panel)
local parent = panel:GetParent()
self.tooltip:Hide()
self.tooltip:SetOwner(parent, parent.anchor, parent.xOff, parent.yOff)
self.tooltip:ClearLines()
GameTooltip:Hide()
end
function DT:RegisterPanel(panel, numPoints, anchor, xOff, yOff)
DT.RegisteredPanels[panel:GetName()] = panel
panel.dataPanels = {}
panel.numPoints = numPoints
panel.xOff = xOff
panel.yOff = yOff
panel.anchor = anchor
for i = 1, numPoints do
local pointIndex = DT.PointLocation[i]
if not panel.dataPanels[pointIndex] then
panel.dataPanels[pointIndex] = CreateFrame("Button", panel:GetName().."DataText"..i, panel)
panel.dataPanels[pointIndex]:RegisterForClicks("LeftButtonUp", "RightButtonUp")
panel.dataPanels[pointIndex].text = panel.dataPanels[pointIndex]:CreateFontString(nil, "OVERLAY")
panel.dataPanels[pointIndex].text:SetAllPoints()
E:FontTemplate(panel.dataPanels[pointIndex].text)
panel.dataPanels[pointIndex].text:SetJustifyH("CENTER")
panel.dataPanels[pointIndex].text:SetJustifyV("MIDDLE")
end
panel.dataPanels[pointIndex]:SetPoint(DT:GetDataPanelPoint(panel, i, numPoints))
end
panel:SetScript("OnSizeChanged", DT.UpdateAllDimensions)
DT.UpdateAllDimensions(panel)
end
function DT:AssignPanelToDataText(panel, data)
panel.name = ""
if data["name"] then
panel.name = data["name"]
end
if data["events"] then
for _, event in pairs(data["events"]) do
panel:RegisterEvent(event)
end
end
if data["eventFunc"] then
panel:SetScript("OnEvent", function()
data["eventFunc"](this, event)
end)
data["eventFunc"](panel, "ELVUI_FORCE_RUN")
end
if data["onUpdate"] then
panel:SetScript("OnUpdate", function()
data["onUpdate"](this, arg1)
end)
data["onUpdate"](panel, 20000)
end
if data["onClick"] then
panel:SetScript("OnClick", function()
data["onClick"](this, arg1)
end)
end
if data["onEnter"] then
panel:SetScript("OnEnter", function()
data["onEnter"](this)
end)
end
if data["onLeave"] then
panel:SetScript("OnLeave", function()
data["onLeave"](this)
end)
else
panel:SetScript("OnLeave", DT.Data_OnLeave)
end
end
function DT:LoadDataTexts()
self.db = E.db.datatexts
LDB:UnregisterAllCallbacks(self)
local inInstance, instanceType = IsInInstance()
local fontTemplate = LSM:Fetch("font", self.db.font)
for panelName, panel in pairs(DT.RegisteredPanels) do
for i = 1, panel.numPoints do
local pointIndex = DT.PointLocation[i]
panel.dataPanels[pointIndex]:UnregisterAllEvents()
panel.dataPanels[pointIndex]:SetScript("OnUpdate", nil)
panel.dataPanels[pointIndex]:SetScript("OnEnter", nil)
panel.dataPanels[pointIndex]:SetScript("OnLeave", nil)
panel.dataPanels[pointIndex]:SetScript("OnClick", nil)
E:FontTemplate(panel.dataPanels[pointIndex].text, fontTemplate, self.db.fontSize, self.db.fontOutline)
panel.dataPanels[pointIndex].text:SetText(nil)
panel.dataPanels[pointIndex].pointIndex = pointIndex
if (panelName == "LeftChatDataPanel" or panelName == "RightChatDataPanel") and (inInstance and (instanceType == "pvp")) and not DT.ForceHideBGStats and E.db.datatexts.battleground then
panel.dataPanels[pointIndex]:RegisterEvent("UPDATE_BATTLEFIELD_SCORE")
panel.dataPanels[pointIndex]:RegisterEvent("PLAYER_REGEN_ENABLED")
panel.dataPanels[pointIndex]:SetScript("OnEvent", DT.UPDATE_BATTLEFIELD_SCORE)
panel.dataPanels[pointIndex]:SetScript("OnEnter", DT.BattlegroundStats)
panel.dataPanels[pointIndex]:SetScript("OnLeave", DT.Data_OnLeave)
panel.dataPanels[pointIndex]:SetScript("OnClick", DT.HideBattlegroundTexts)
DT.UPDATE_BATTLEFIELD_SCORE(panel.dataPanels[pointIndex])
else
for name, data in pairs(DT.RegisteredDataTexts) do
for option, value in pairs(self.db.panels) do
if value and type(value) == "table" then
if option == panelName and self.db.panels[option][pointIndex] and self.db.panels[option][pointIndex] == name then
DT:AssignPanelToDataText(panel.dataPanels[pointIndex], data)
end
elseif value and type(value) == "string" and value == name then
if self.db.panels[option] == name and option == panelName then
DT:AssignPanelToDataText(panel.dataPanels[pointIndex], data)
end
end
end
end
end
end
end
if DT.ForceHideBGStats then
DT.ForceHideBGStats = nil
end
end
function DT:RegisterDatatext(name, events, eventFunc, updateFunc, clickFunc, onEnterFunc, onLeaveFunc, localizedName)
if name then
DT.RegisteredDataTexts[name] = {}
else
error("Cannot register datatext no name was provided.")
end
DT.RegisteredDataTexts[name]["name"] = name
if type(events) ~= "table" and events ~= nil then
error("Events must be registered as a table.")
else
DT.RegisteredDataTexts[name]["events"] = events
DT.RegisteredDataTexts[name]["eventFunc"] = eventFunc
end
if updateFunc and type(updateFunc) == "function" then
DT.RegisteredDataTexts[name]["onUpdate"] = updateFunc
end
if clickFunc and type(clickFunc) == "function" then
DT.RegisteredDataTexts[name]["onClick"] = clickFunc
end
if onEnterFunc and type(onEnterFunc) == "function" then
DT.RegisteredDataTexts[name]["onEnter"] = onEnterFunc
end
if onLeaveFunc and type(onLeaveFunc) == "function" then
DT.RegisteredDataTexts[name]["onLeave"] = onLeaveFunc
end
if localizedName and type(localizedName) == "string" then
DT.RegisteredDataTexts[name]["localizedName"] = localizedName
end
end
local function InitializeCallback()
DT:Initialize()
end
E:RegisterModule(DT:GetName(), InitializeCallback)
@@ -0,0 +1,102 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local _G = _G
local pairs = pairs
local format, join, upper = string.format, string.join, string.upper
--WoW API / Variables
local GetInventoryItemDurability = GetInventoryItemDurability
local GetInventoryItemTexture = GetInventoryItemTexture
local GetInventorySlotInfo = GetInventorySlotInfo
local ToggleCharacter = ToggleCharacter
local DURABILITY_TEMPLATE = string.gsub(DURABILITY_TEMPLATE, "%%d / %%d", "(%%d+) / (%%d+)")
local DURABILITY = "Durability" -- Neel ElvUI locale
local displayString = ""
local tooltipString = "%d%%"
local totalDurability = 0
local current, max, lastPanel
local invDurability = {}
local slots = {
"RangedSlot",
"SecondaryHandSlot",
"MainHandSlot",
"FeetSlot",
"LegsSlot",
"HandsSlot",
"WristSlot",
"WaistSlot",
"ChestSlot",
"ShoulderSlot",
"HeadSlot"
}
local scan
local function GetInventoryItemDurability(slot)
if not GetInventoryItemTexture("player", slot) then return nil, nil end
if not scan then
scan = CreateFrame("GameTooltip", "DurabilityScan", nil, "ShoppingTooltipTemplate")
scan:SetOwner(UIParent, "ANCHOR_NONE")
end
scan:ClearLines()
scan:SetInventoryItem("player", slot)
for i = 4, scan:NumLines() do
local text = _G[scan:GetName().."TextLeft"..i]:GetText()
for durability, max in string.gfind(text, DURABILITY_TEMPLATE) do
return tonumber(durability), tonumber(max)
end
end
end
local function OnEvent(self, t)
lastPanel = self
totalDurability = 100
for _, value in pairs(slots) do
local slot = GetInventorySlotInfo(value)
current, max = GetInventoryItemDurability(slot)
if current then
current, max = GetInventoryItemDurability(slot)
invDurability[value] = (current / max) * 100
if ((current / max) * 100) < totalDurability then
totalDurability = (current / max) * 100
end
end
end
self.text:SetText(format(displayString, totalDurability))
end
local function OnClick()
ToggleCharacter("PaperDollFrame")
end
local function OnEnter(self)
DT:SetupTooltip(self)
for slot, durability in pairs(invDurability) do
DT.tooltip:AddDoubleLine(_G[upper(slot)], format(tooltipString, durability), 1, 1, 1, E:ColorGradient(durability * 0.01, 1, 0, 0, 1, 1, 0, 0, 1, 0))
end
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
displayString = join("", DURABILITY, ": ", hex, "%d%%|r")
if lastPanel ~= nil then
OnEvent(lastPanel, "ELVUI_COLOR_UPDATE")
end
end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
DT:RegisterDatatext("Durability", {"PLAYER_ENTERING_WORLD", "UPDATE_INVENTORY_ALERTS", "MERCHANT_SHOW"}, OnEvent, nil, OnClick, OnEnter, nil, DURABILITY)
@@ -0,0 +1,82 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local pairs = pairs
local join = string.join
--WoW API / Variables
local GetMoney = GetMoney
local IsShiftKeyDown = IsShiftKeyDown
local Profit = 0
local Spent = 0
local resetInfoFormatter = join("", "|cffaaaaaa", L["Reset Data: Hold Shift + Right Click"], "|r")
local function OnEvent(self)
local NewMoney = GetMoney()
ElvDB = ElvDB or {}
ElvDB["gold"] = ElvDB["gold"] or {}
ElvDB["gold"][E.myrealm] = ElvDB["gold"][E.myrealm] or {}
ElvDB["gold"][E.myrealm][E.myname] = ElvDB["gold"][E.myrealm][E.myname] or NewMoney
local OldMoney = ElvDB["gold"][E.myrealm][E.myname] or NewMoney
local Change = NewMoney - OldMoney
if OldMoney > NewMoney then
Spent = Spent - Change
else
Profit = Profit + Change
end
self.text:SetText(E:FormatMoney(NewMoney, E.db.datatexts.goldFormat or "BLIZZARD", not E.db.datatexts.goldCoins))
ElvDB["gold"][E.myrealm][E.myname] = NewMoney
end
local function OnClick(self, btn)
if btn == "RightButton" and IsShiftKeyDown() then
ElvDB.gold = nil
OnEvent(self)
DT.tooltip:Hide()
else
OpenAllBags()
end
end
local function OnEnter(self)
DT:SetupTooltip(self)
local textOnly = not E.db.datatexts.goldCoins and true or false
local style = E.db.datatexts.goldFormat or "BLIZZARD"
DT.tooltip:AddLine(L["Session:"])
DT.tooltip:AddDoubleLine(L["Earned:"], E:FormatMoney(Profit, style, textOnly), 1, 1, 1, 1, 1, 1)
DT.tooltip:AddDoubleLine(L["Spent:"], E:FormatMoney(Spent, style, textOnly), 1, 1, 1, 1, 1, 1)
if Profit < Spent then
DT.tooltip:AddDoubleLine(L["Deficit:"], E:FormatMoney(Profit-Spent, style, textOnly), 1, 0, 0, 1, 1, 1)
elseif (Profit - Spent) > 0 then
DT.tooltip:AddDoubleLine(L["Profit:"], E:FormatMoney(Profit-Spent, style, textOnly), 0, 1, 0, 1, 1, 1)
end
DT.tooltip:AddLine(" ")
local totalGold = 0;
DT.tooltip:AddLine(L["Character: "])
for k, _ in pairs(ElvDB["gold"][E.myrealm]) do
if ElvDB["gold"][E.myrealm][k] then
DT.tooltip:AddDoubleLine(k, E:FormatMoney(ElvDB["gold"][E.myrealm][k], style, textOnly), 1, 1, 1, 1, 1, 1)
totalGold = totalGold + ElvDB["gold"][E.myrealm][k]
end
end
DT.tooltip:AddLine(" ")
DT.tooltip:AddLine(L["Server: "])
DT.tooltip:AddDoubleLine(L["Total: "], E:FormatMoney(totalGold, style, textOnly), 1, 1, 1, 1, 1, 1)
DT.tooltip:AddLine(" ")
DT.tooltip:AddLine(resetInfoFormatter)
DT.tooltip:Show()
end
DT:RegisterDatatext("Gold", {"PLAYER_ENTERING_WORLD", "PLAYER_MONEY", "SEND_MAIL_MONEY_CHANGED", "SEND_MAIL_COD_CHANGED", "PLAYER_TRADE_MONEY", "TRADE_MONEY_CHANGED"}, OnEvent, nil, OnClick, OnEnter, nil, L["Gold"])
@@ -0,0 +1,243 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local select, unpack = select, unpack
local format, join = string.format, string.join
local sort, wipe = table.sort, wipe
--WoW API / Variables
local EasyMenu = EasyMenu
local GetGuildInfo = GetGuildInfo
local GetGuildRosterInfo = GetGuildRosterInfo
local GetGuildRosterMOTD = GetGuildRosterMOTD
local GetMouseFocus = GetMouseFocus
local GetNumGuildMembers = GetNumGuildMembers
local GetQuestDifficultyColor = GetQuestDifficultyColor
local GetRealZoneText = GetRealZoneText
local GuildRoster = GuildRoster
local InviteUnit = InviteUnit
local IsInGuild = IsInGuild
local IsShiftKeyDown = IsShiftKeyDown
local LoadAddOn = LoadAddOn
local SetItemRef = SetItemRef
local ToggleFriendsFrame = ToggleFriendsFrame
local UnitInParty = UnitInParty
local UnitInRaid = UnitInRaid
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local MOTD_COLON = MOTD_COLON
local FRIENDS_LIST_ONLINE = "FRIENDS_LIST_ONLINE"
local tthead, ttsubh, ttoff = {r=0.4, g=0.78, b=1}, {r=0.75, g=0.9, b=1}, {r=.3,g=1,b=.3}
local activezone, inactivezone = {r=0.3, g=1.0, b=0.3}, {r=0.65, g=0.65, b=0.65}
local displayString = ""
local noGuildString = ""
local guildInfoString = "%s"
local guildInfoString2 = join("", GUILD, ": %d/%d")
local guildMotDString = "%s |cffaaaaaa |cffffffff%s"
local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"
local levelNameStatusString = "|cff%02x%02x%02x%d|r %s "
local nameRankString = "%s |cff999999-|cffffffff %s"
local moreMembersOnlineString = join("", "+ %d ", FRIENDS_LIST_ONLINE, "...")
local noteString = join("", "|cff999999 ", LABEL_NOTE, ":|r %s")
local officerNoteString = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s")
local guildTable, guildMotD = {}, ""
local lastPanel
local function SortGuildTable(shift)
sort(guildTable, function(a, b)
if a and b then
if shift then
return a[9] < b[9]
else
return a[1] < b[1]
end
end
end)
end
local function BuildGuildTable()
wipe(guildTable)
local _, name, rank, level, zone, note, officernote, connected, status, class
local totalMembers = GetNumGuildMembers()
for i = 1, totalMembers do
name, rank, _, level, class, zone, note, officernote, connected, status = GetGuildRosterInfo(i)
if connected then
guildTable[getn(guildTable) + 1] = {name, rank, level, zone, note, officernote, connected, status, string.upper(class)}
end
end
end
local function UpdateGuildMessage()
guildMotD = GetGuildRosterMOTD()
end
local eventHandlers = {
["CHAT_MSG_SYSTEM"] = function()
GuildRoster()
end,
-- when we enter the world and guildframe is not available then
-- load guild frame, update guild message and guild xp
["PLAYER_ENTERING_WORLD"] = function()
if IsInGuild() then
GuildRoster()
end
end,
-- Guild Roster updated, so rebuild the guild table
["GUILD_ROSTER_UPDATE"] = function(self)
GuildRoster()
BuildGuildTable()
UpdateGuildMessage()
if GetMouseFocus() == self then
self:GetScript("OnEnter")(self, nil, true)
end
end,
["PLAYER_GUILD_UPDATE"] = function()
GuildRoster()
end,
-- our guild message of the day changed
["GUILD_MOTD"] = function(_, arg1)
guildMotD = arg1
end,
["ELVUI_FORCE_RUN"] = E.noop,
["ELVUI_COLOR_UPDATE"] = E.noop,
}
local function OnEvent(self, event, ...)
lastPanel = self
if IsInGuild() then
eventHandlers[event](self, unpack(arg))
self.text:SetText(format(displayString, getn(guildTable)))
else
self.text:SetText(noGuildString)
end
end
local menuFrame = CreateFrame("Frame", "GuildDatatTextRightClickMenu", E.UIParent, "UIDropDownMenuTemplate")
local menuList = {
{ text = OPTIONS_MENU, isTitle = true, notCheckable=true},
{ text = INVITE, hasArrow = true, notCheckable=true,},
{ text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable=true,}
}
local function inviteClick(_, playerName)
menuFrame:Hide()
InviteUnit(playerName)
end
local function whisperClick(_, playerName)
menuFrame:Hide()
SetItemRef("player:"..playerName, ("|Hplayer:%1$s|h[%1$s]|h"):format(playerName), "LeftButton")
end
local function OnClick(_, btn)
if btn == "RightButton" and IsInGuild() then
DT.tooltip:Hide()
local classc, levelc, grouped, info
local menuCountWhispers = 0
local menuCountInvites = 0
menuList[2].menuList = {}
menuList[3].menuList = {}
for i = 1, getn(guildTable) do
info = guildTable[i]
if info[7] and info[1] ~= E.myname then
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[info[9]], GetQuestDifficultyColor(info[3])
--if UnitInParty(info[1]) or UnitInRaid(info[1]) then
-- grouped = "|cffaaaaaa*|r"
--elseif not info[11] then
menuCountInvites = menuCountInvites + 1
grouped = ""
menuList[2].menuList[menuCountInvites] = {text = format(levelNameString, levelc.r*255,levelc.g*255,levelc.b*255, info[3], classc.r*255,classc.g*255,classc.b*255, info[1], ""), arg1 = info[1],notCheckable=true, func = inviteClick}
--end
menuCountWhispers = menuCountWhispers + 1
if not grouped then grouped = "" end
menuList[3].menuList[menuCountWhispers] = {text = format(levelNameString, levelc.r*255,levelc.g*255,levelc.b*255, info[3], classc.r*255,classc.g*255,classc.b*255, info[1], grouped), arg1 = info[1],notCheckable=true, func = whisperClick}
end
end
EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 2)
else
ToggleFriendsFrame(3)
end
end
local function OnEnter(self, _, noUpdate)
if not IsInGuild() then return end
DT:SetupTooltip(self)
local online, total = 0, GetNumGuildMembers(true)
for i = 0, total do
local _, _, _, _, _, _, _, _, _, status = GetGuildRosterInfo(i)
if status then
online = online + 1
end
end
if getn(guildTable) == 0 then BuildGuildTable() end
SortGuildTable(IsShiftKeyDown())
local guildName, guildRank = GetGuildInfo("player")
if guildName and guildRank then
DT.tooltip:AddDoubleLine(format(guildInfoString, guildName), format(guildInfoString2, online, total),tthead.r,tthead.g,tthead.b,tthead.r,tthead.g,tthead.b)
DT.tooltip:AddLine(guildRank, unpack(tthead))
end
if guildMotD ~= "" then
DT.tooltip:AddLine(" ")
DT.tooltip:AddLine(format(guildMotDString, GUILD_MOTD_LABEL, guildMotD), ttsubh.r, ttsubh.g, ttsubh.b, 1)
end
local zonec, classc, levelc, info
local shown = 0
DT.tooltip:AddLine(" ")
for i = 1, getn(guildTable) do
-- if more then 30 guild members are online, we don't Show any more, but inform user there are more
if 30 - shown <= 1 then
if online - 30 > 1 then DT.tooltip:AddLine(format(moreMembersOnlineString, online - 30), ttsubh.r, ttsubh.g, ttsubh.b) end
break
end
info = guildTable[i]
if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[info[9]], GetQuestDifficultyColor(info[3])
if IsShiftKeyDown() then
DT.tooltip:AddDoubleLine(format(nameRankString, info[1], info[2]), info[4], classc.r, classc.g, classc.b, zonec.r, zonec.g, zonec.b)
if info[5] ~= "" then DT.tooltip:AddLine(format(noteString, info[5]), ttsubh.r, ttsubh.g, ttsubh.b, 1) end
if info[6] ~= "" then DT.tooltip:AddLine(format(officerNoteString, info[6]), ttoff.r, ttoff.g, ttoff.b, 1) end
else
DT.tooltip:AddDoubleLine(format(levelNameStatusString, levelc.r*255, levelc.g*255, levelc.b*255, info[3], info[1], info[4]), info[4], classc.r,classc.g,classc.b, zonec.r,zonec.g,zonec.b)
end
shown = shown + 1
end
DT.tooltip:Show()
if not noUpdate then
GuildRoster()
end
end
local function ValueColorUpdate(hex)
displayString = join("", GUILD, ": ", hex, "%d|r")
noGuildString = join("", hex, L["No Guild"])
if lastPanel ~= nil then
OnEvent(lastPanel, "ELVUI_COLOR_UPDATE")
end
end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
DT:RegisterDatatext("Guild", {"PLAYER_ENTERING_WORLD", "CHAT_MSG_SYSTEM", "GUILD_ROSTER_UPDATE", "PLAYER_GUILD_UPDATE", "GUILD_MOTD"}, OnEvent, nil, OnClick, OnEnter, nil, GUILD)
@@ -0,0 +1,10 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="DataTexts.lua"/>
<Script file="Armor.lua"/>
<Script file="Avoidance.lua"/>
<Script file="Durability.lua"/>
<Script file="Gold.lua"/>
<Script file="Guild.lua"/>
<Script file="System.lua"/>
<Script file="Time.lua"/>
</Ui>
@@ -0,0 +1,187 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local select, collectgarbage = select, collectgarbage
local sort, wipe = table.sort, wipe
local floor = math.floor
local format = string.format
--WoW API / Variables
local GetNumAddOns = GetNumAddOns
local GetAddOnInfo = GetAddOnInfo
local IsAddOnLoaded = IsAddOnLoaded
local UpdateAddOnMemoryUsage = UpdateAddOnMemoryUsage
local UpdateAddOnCPUUsage = UpdateAddOnCPUUsage
local GetAddOnMemoryUsage = GetAddOnMemoryUsage
local GetAddOnCPUUsage = GetAddOnCPUUsage
local ResetCPUUsage = ResetCPUUsage
local GetCVar = GetCVar
local GetNetStats = GetNetStats
local IsShiftKeyDown = IsShiftKeyDown
local GetFramerate = GetFramerate
local int, int2 = 6, 5
local statusColors = {
"|cff0CD809",
"|cffE8DA0F",
"|cffFF9000",
"|cffD80909"
}
local enteredFrame = false
local homeLatencyString = "%d ms"
local kiloByteString = "%d kb"
local megaByteString = "%.2f mb"
local totalMemory = 0
local function formatMem(memory)
local mult = 10 ^ 1
if(memory > 999) then
local mem = ((memory / 1024) * mult) / mult
return format(megaByteString, mem)
else
local mem = (memory * mult) / mult
return format(kiloByteString, mem)
end
end
local function sortByMemoryOrCPU(a, b)
if(a and b) then
return a[3] > b[3]
end
end
local memoryTable = {}
local cpuTable = {}
local function RebuildAddonList()
local addOnCount = GetNumAddOns()
if(addOnCount == getn(memoryTable)) then return end
wipe(memoryTable)
wipe(cpuTable)
for i = 1, addOnCount do
memoryTable[i] = {i, GetAddOnInfo(i), 0, IsAddOnLoaded(i)}
cpuTable[i] = {i, GetAddOnInfo(i), 0, IsAddOnLoaded(i)}
end
end
local function UpdateMemory()
--UpdateAddOnMemoryUsage()
--[[totalMemory = 0
for i = 1, getn(memoryTable) do
memoryTable[i][3] = GetAddOnMemoryUsage(memoryTable[i][1])
totalMemory = totalMemory + memoryTable[i][3]
end
sort(memoryTable, sortByMemoryOrCPU)]]
end
local function UpdateCPU()
UpdateAddOnCPUUsage()
local addonCPU = 0
local totalCPU = 0
for i = 1, getn(cpuTable) do
addonCPU = GetAddOnCPUUsage(cpuTable[i][1])
cpuTable[i][3] = addonCPU
totalCPU = totalCPU + addonCPU
end
sort(cpuTable, sortByMemoryOrCPU)
return totalCPU
end
local function ToggleGameMenuFrame()
if GameMenuFrame:IsShown() then
PlaySound("igMainMenuQuit")
HideUIPanel(GameMenuFrame)
else
PlaySound("igMainMenuOpen")
ShowUIPanel(GameMenuFrame)
end
end
local function OnClick(_, btn)
if(btn == "RightButton") then
collectgarbage("collect")
ResetCPUUsage()
elseif(btn == "LeftButton") then
ToggleGameMenuFrame()
end
end
local function OnEnter(self)
enteredFrame = true
local cpuProfiling = false
DT:SetupTooltip(self)
UpdateMemory()
local _, _, latency = GetNetStats()
DT.tooltip:AddDoubleLine(L["Home Latency:"], format(homeLatencyString, latency), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65)
local totalCPU = nil
DT.tooltip:AddDoubleLine(L["Total Memory:"], formatMem(totalMemory), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65)
if(cpuProfiling) then
totalCPU = UpdateCPU()
DT.tooltip:AddDoubleLine(L["Total CPU:"], format(homeLatencyString, totalCPU), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65)
end
local red, green
if(IsShiftKeyDown() or not cpuProfiling) then
DT.tooltip:AddLine(" ")
for i = 1, getn(memoryTable) do
if(memoryTable[i][4]) then
red = memoryTable[i][3] / totalMemory
green = 1 - red
DT.tooltip:AddDoubleLine(memoryTable[i][2], formatMem(memoryTable[i][3]), 1, 1, 1, red, green + .5, 0)
end
end
end
if(cpuProfiling and not IsShiftKeyDown()) then
DT.tooltip:AddLine(" ")
for i = 1, getn(cpuTable) do
if(cpuTable[i][4]) then
red = cpuTable[i][3] / totalCPU
green = 1 - red
DT.tooltip:AddDoubleLine(cpuTable[i][2], format(homeLatencyString, cpuTable[i][3]), 1, 1, 1, red, green + .5, 0)
end
end
DT.tooltip:AddLine(" ")
DT.tooltip:AddLine(L["(Hold Shift) Memory Usage"])
end
DT.tooltip:Show()
end
local function OnLeave()
enteredFrame = false
DT.tooltip:Hide()
end
local function OnUpdate(self, t)
int = int - (arg1 or t)
int2 = int2 - (arg1 or t)
if int < 0 then
RebuildAddonList()
int = 10
end
if int2 < 0 then
local framerate = floor(GetFramerate())
local _, _, latency = GetNetStats()
self.text:SetText(format("FPS: %s%d|r MS: %s%d|r",
statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4],
framerate,
statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4],
latency))
int2 = 1
if enteredFrame then
OnEnter(this)
end
end
end
DT:RegisterDatatext("System", nil, nil, OnUpdate, OnClick, OnEnter, OnLeave, L["System"])
@@ -0,0 +1,77 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule("DataTexts");
--Cache global variables
--Lua functions
local time = time
local format, join = string.format, string.join
--WoW API / Variables
local GetGameTime = GetGameTime
local GetNumSavedInstances = GetNumSavedInstances
local GetSavedInstanceInfo = GetSavedInstanceInfo
local SecondsToTime = SecondsToTime
local TIMEMANAGER_TOOLTIP_REALMTIME = "Realm time:"
local timeDisplayFormat = ""
local dateDisplayFormat = ""
local europeDisplayFormat_nocolor = join("", "%02d", ":|r%02d")
local lockoutInfoFormatNoEnc = "%s%s |cffaaaaaa(%s)"
local difficultyInfo = {"N", "N", "H", "H"}
local lockoutColorExtended, lockoutColorNormal = {r = 0.3, g = 1, b = 0.3}, {r = .8, g = .8, b = .8}
local function OnLeave()
DT.tooltip:Hide()
end
local function OnEnter(self)
DT:SetupTooltip(self)
local name, _, reset, difficultyId, locked, extended, isRaid, maxPlayers
local oneraid, lockoutColor
for i = 1, GetNumSavedInstances() do
name, _, reset, difficultyId, locked, extended, _, isRaid, maxPlayers = GetSavedInstanceInfo(i)
if isRaid and (locked or extended) and name then
if not oneraid then
DT.tooltip:AddLine(L["Saved Raid(s)"])
DT.tooltip:AddLine(" ")
oneraid = true
end
if extended then
lockoutColor = lockoutColorExtended
else
lockoutColor = lockoutColorNormal
end
DT.tooltip:AddDoubleLine(format(lockoutInfoFormatNoEnc, maxPlayers, difficultyInfo[difficultyId], name), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b)
end
end
DT.tooltip:AddDoubleLine(TIMEMANAGER_TOOLTIP_REALMTIME, format(europeDisplayFormat_nocolor, GetGameTime()), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b)
DT.tooltip:Show()
end
local lastPanel
local int = 5
local function OnUpdate(self, t)
int = int - t
if int > 0 then return end
self.text:SetText(gsub(gsub(BetterDate(E.db.datatexts.timeFormat.." "..E.db.datatexts.dateFormat, time()), ":", timeDisplayFormat), "%s", dateDisplayFormat))
lastPanel = self
int = 1
end
local function ValueColorUpdate(hex)
timeDisplayFormat = join("", hex, ":|r")
dateDisplayFormat = join("", hex, " ")
if lastPanel ~= nil then
OnUpdate(lastPanel, 20000)
end
end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
DT:RegisterDatatext("Time", nil, nil, OnUpdate, nil, OnEnter, OnLeave)
@@ -0,0 +1,9 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Include file="Tooltip\Load_Tooltip.xml"/>
<Include file="DataTexts\Load_DataTexts.xml"/>
<Include file="ActionBars\Load_ActionBars.xml"/>
<Include file="Maps\Load_Maps.xml"/>
<Include file="Chat\Load_Chat.xml"/>
<Include file="Skins\Load_Skins.xml"/>
<Include file="DataBars\Load_DataBars.xml"/>
</Ui>
@@ -0,0 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Minimap.lua"/>
<Script file="WorldMap.lua"/>
</Ui>
+401
View File
@@ -0,0 +1,401 @@
local E, L, V, P, G = unpack(ElvUI)
local M = E:NewModule("Minimap", "AceEvent-3.0")
E.Minimap = M
local _G = _G
local strsub = strsub
local CreateFrame = CreateFrame
local ToggleCharacter = ToggleCharacter
local ToggleFrame = ToggleFrame
local ToggleAchievementFrame = ToggleAchievementFrame
local ToggleFriendsFrame = ToggleFriendsFrame
local IsAddOnLoaded = IsAddOnLoaded
local ToggleHelpFrame = ToggleHelpFrame
local GetZonePVPInfo = GetZonePVPInfo
local IsShiftKeyDown = IsShiftKeyDown
local ToggleDropDownMenu = ToggleDropDownMenu
local Minimap_OnClick = Minimap_OnClick
local GetMinimapZoneText = GetMinimapZoneText
local menuFrame = CreateFrame("Frame", "MinimapRightClickMenu", E.UIParent, "UIDropDownMenuTemplate")
local menuList = {
{text = "CHARACTER_BUTTON",
func = function() ToggleCharacter("PaperDollFrame") end},
{text = "SPELLBOOK_ABILITIES_BUTTON",
func = function() ToggleFrame(SpellBookFrame) end},
{text = "TALENTS_BUTTON",
func = ToggleTalentFrame},
{text = "ACHIEVEMENT_BUTTON",
func = ToggleAchievementFrame},
{text = "QUESTLOG_BUTTON",
func = function() ToggleFrame(QuestLogFrame) end},
{text = "SOCIAL_BUTTON",
func = function() ToggleFriendsFrame(1) end},
{text = L["Calendar"],
func = function() GameTimeFrame:Click() end},
{text = L["Farm Mode"],
func = FarmMode},
{text = "BATTLEFIELD_MINIMAP",
func = ToggleBattlefieldMinimap},
{text = "TIMEMANAGER_TITLE",
func = ToggleTimeManager},
{text = "PLAYER_V_PLAYER",
func = function() ToggleFrame(PVPParentFrame) end},
{text = "LFG_TITLE",
func = function() ToggleFrame(LFDParentFrame) end},
{text = "L_LFRAID",
func = function() ToggleFrame(LFRParentFrame) end},
{text = "HELP_BUTTON",
func = ToggleHelpFrame},
{text = "L_CALENDAR",
func = function()
if(not CalendarFrame) then
LoadAddOn("Blizzard_Calendar")
end
Calendar_Toggle()
end}
}
function GetMinimapShape()
return "SQUARE"
end
function M:GetLocTextColor()
local pvpType = GetZonePVPInfo()
if(pvpType == "sanctuary") then
return 0.035, 0.58, 0.84
elseif(pvpType == "arena") then
return 0.84, 0.03, 0.03
elseif(pvpType == "friendly") then
return 0.05, 0.85, 0.03
elseif(pvpType == "hostile") then
return 0.84, 0.03, 0.03
elseif(pvpType == "contested") then
return 0.9, 0.85, 0.05
else
return 0.84, 0.03, 0.03
end
end
function M:Minimap_OnMouseUp(btn)
local position = this:GetPoint()
if arg1 == "MiddleButton" or (arg1 == "RightButton" and IsShiftKeyDown()) then
if position then
L_EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 2)
else
L_EasyMenu(menuList, menuFrame, "cursor", -160, 0, "MENU", 2)
end
else
Minimap_OnClick(this)
end
end
function M:Minimap_OnMouseWheel()
if arg1 > 0 then
_G.MinimapZoomIn:Click()
elseif arg1 < 0 then
_G.MinimapZoomOut:Click()
end
end
function M:Update_ZoneText()
if E.db.general.minimap.locationText == "HIDE" or not E.private.general.minimap.enable then return end
Minimap.location:SetText(strsub(GetMinimapZoneText(),1,46))
Minimap.location:SetTextColor(self:GetLocTextColor())
E:FontTemplate(Minimap.location, E.LSM:Fetch("font", E.db.general.minimap.locationFont), E.db.general.minimap.locationFontSize, E.db.general.minimap.locationFontOutline)
end
function M:PLAYER_REGEN_ENABLED()
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
self:UpdateSettings()
end
local isResetting
local function ResetZoom()
Minimap:SetZoom(0)
MinimapZoomIn:Enable()
MinimapZoomOut:Disable()
isResetting = false
end
local function SetupZoomReset()
if(E.db.general.minimap.resetZoom.enable and not isResetting) then
isResetting = true
E:Delay(E.db.general.minimap.resetZoom.time, ResetZoom)
end
end
hooksecurefunc(Minimap, "SetZoom", SetupZoomReset)
function M:UpdateSettings()
E.MinimapSize = E.private.general.minimap.enable and E.db.general.minimap.size or Minimap:GetWidth() + 10
E.MinimapWidth = E.MinimapSize
E.MinimapHeight = E.MinimapSize
if E.private.general.minimap.enable then
Minimap:SetScale(E.MinimapSize / 140)
end
if(LeftMiniPanel and RightMiniPanel) then
if(E.db.datatexts.minimapPanels and E.private.general.minimap.enable) then
LeftMiniPanel:Show()
RightMiniPanel:Show()
else
LeftMiniPanel:Hide()
RightMiniPanel:Hide()
end
end
if(BottomMiniPanel) then
if(E.db.datatexts.minimapBottom and E.private.general.minimap.enable) then
BottomMiniPanel:Show()
else
BottomMiniPanel:Hide()
end
end
if(BottomLeftMiniPanel) then
if(E.db.datatexts.minimapBottomLeft and E.private.general.minimap.enable) then
BottomLeftMiniPanel:Show()
else
BottomLeftMiniPanel:Hide()
end
end
if(BottomRightMiniPanel) then
if(E.db.datatexts.minimapBottomRight and E.private.general.minimap.enable) then
BottomRightMiniPanel:Show()
else
BottomRightMiniPanel:Hide()
end
end
if(TopMiniPanel) then
if(E.db.datatexts.minimapTop and E.private.general.minimap.enable) then
TopMiniPanel:Show()
else
TopMiniPanel:Hide()
end
end
if(TopLeftMiniPanel) then
if(E.db.datatexts.minimapTopLeft and E.private.general.minimap.enable) then
TopLeftMiniPanel:Show()
else
TopLeftMiniPanel:Hide()
end
end
if(TopRightMiniPanel) then
if(E.db.datatexts.minimapTopRight and E.private.general.minimap.enable) then
TopRightMiniPanel:Show()
else
TopRightMiniPanel:Hide()
end
end
if MMHolder then
MMHolder:SetWidth(E.MinimapWidth + E.Border + E.Spacing*3)
if E.db.datatexts.minimapPanels then
MMHolder:SetHeight(E.MinimapHeight + (LeftMiniPanel and (LeftMiniPanel:GetHeight() + E.Border) or 24) + E.Spacing*3)
else
MMHolder:SetHeight(E.MinimapHeight + E.Border + E.Spacing*3)
end
end
if Minimap.location then
Minimap.location:SetWidth(E.MinimapSize)
if(E.db.general.minimap.locationText ~= "SHOW" or not E.private.general.minimap.enable) then
Minimap.location:Hide()
else
Minimap.location:Show()
end
end
if MinimapMover then
MinimapMover:SetWidth(MMHolder:GetWidth())
MinimapMover:SetHeight(MMHolder:GetHeight())
end
if GameTimeFrame then
if E.private.general.minimap.hideCalendar then
GameTimeFrame:Hide()
else
local pos = E.db.general.minimap.icons.calendar.position or "TOPRIGHT"
local scale = E.db.general.minimap.icons.calendar.scale or 1
GameTimeFrame:ClearAllPoints()
GameTimeFrame:SetPoint(pos, Minimap, pos, E.db.general.minimap.icons.calendar.xOffset or 0, E.db.general.minimap.icons.calendar.yOffset or 0)
GameTimeFrame:SetScale(scale)
GameTimeFrame:Show()
end
end
if MiniMapMailFrame then
local pos = E.db.general.minimap.icons.mail.position or "TOPRIGHT"
local scale = E.db.general.minimap.icons.mail.scale or 1
MiniMapMailFrame:ClearAllPoints()
MiniMapMailFrame:SetPoint(pos, Minimap, pos, E.db.general.minimap.icons.mail.xOffset or 3, E.db.general.minimap.icons.mail.yOffset or 4)
MiniMapMailFrame:SetScale(scale)
end
if MiniMapLFGFrame then
local pos = E.db.general.minimap.icons.lfgEye.position or "BOTTOMRIGHT"
local scale = E.db.general.minimap.icons.lfgEye.scale or 1
MiniMapLFGFrame:ClearAllPoints()
MiniMapLFGFrame:Point(pos, Minimap, pos, E.db.general.minimap.icons.lfgEye.xOffset or 3, E.db.general.minimap.icons.lfgEye.yOffset or 0)
MiniMapLFGFrame:SetScale(scale)
LFDSearchStatus:SetScale(scale)
end
if MiniMapBattlefieldFrame then
local pos = E.db.general.minimap.icons.battlefield.position or "BOTTOMRIGHT"
local scale = E.db.general.minimap.icons.battlefield.scale or 1
MiniMapBattlefieldFrame:ClearAllPoints()
MiniMapBattlefieldFrame:SetPoint(pos, Minimap, pos, E.db.general.minimap.icons.battlefield.xOffset or 3, E.db.general.minimap.icons.battlefield.yOffset or 0)
MiniMapBattlefieldFrame:SetScale(scale)
end
if MiniMapInstanceDifficulty then
local pos = E.db.general.minimap.icons.difficulty.position or "TOPLEFT"
local scale = E.db.general.minimap.icons.difficulty.scale or 1
local x = E.db.general.minimap.icons.difficulty.xOffset or 0
local y = E.db.general.minimap.icons.difficulty.yOffset or 0
MiniMapInstanceDifficulty:ClearAllPoints()
MiniMapInstanceDifficulty:SetPoint(pos, Minimap, pos, x, y)
MiniMapInstanceDifficulty:SetScale(scale)
end
end
local function MinimapPostDrag()
MinimapCluster:ClearAllPoints()
MinimapCluster:SetAllPoints(Minimap)
MinimapBackdrop:ClearAllPoints()
MinimapBackdrop:SetAllPoints(Minimap)
end
function M:Initialize()
E:SetTemplate(menuFrame, "Transparent", true)
self:UpdateSettings()
if not E.private.general.minimap.enable then
Minimap:SetMaskTexture("Textures\\MinimapMask")
return
end
local mmholder = CreateFrame("Frame", "MMHolder", UIParent)
mmholder:SetPoint("TOPRIGHT", E.UIParent, "TOPRIGHT", -3, -3)
mmholder:SetWidth(E.MinimapWidth + 29)
mmholder:SetHeight(E.MinimapHeight + 53)
Minimap:ClearAllPoints()
Minimap:SetPoint("TOPRIGHT", mmholder, "TOPRIGHT", -E.Border, -E.Border)
Minimap:SetMaskTexture("Interface\\ChatFrame\\ChatFrameBackground")
Minimap.backdrop = CreateFrame("Frame", nil, UIParent)
E:SetOutside(Minimap.backdrop, Minimap)
Minimap.backdrop:SetFrameStrata(Minimap:GetFrameStrata())
Minimap.backdrop:SetFrameLevel(Minimap:GetFrameLevel() - 1)
E:SetTemplate(Minimap.backdrop, "Default")
HookScript(Minimap, "OnEnter", function()
if E.db.general.minimap.locationText ~= "MOUSEOVER" or not E.private.general.minimap.enable then
return
end
this.location:Show()
end)
HookScript(Minimap, "OnLeave", function()
if E.db.general.minimap.locationText ~= "MOUSEOVER" or not E.private.general.minimap.enable then
return
end
this.location:Hide()
end)
Minimap.location = Minimap:CreateFontString(nil, "OVERLAY")
E:FontTemplate(Minimap.location, nil, nil, "OUTLINE")
Minimap.location:SetPoint("TOP", Minimap, "TOP", 0, -2)
Minimap.location:SetJustifyH("CENTER")
Minimap.location:SetJustifyV("MIDDLE")
if E.db.general.minimap.locationText ~= "SHOW" or not E.private.general.minimap.enable then
Minimap.location:Hide()
end
MinimapBorder:Hide()
MinimapBorderTop:Hide()
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
MinimapZoneTextButton:Hide()
MiniMapMailBorder:Hide()
MiniMapMailIcon:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\mail")
MiniMapBattlefieldBorder:Hide()
E:CreateMover(MMHolder, "MinimapMover", L["Minimap"], nil, nil, MinimapPostDrag)
Minimap:EnableMouseWheel(true)
Minimap:SetScript("OnMouseWheel", M.Minimap_OnMouseWheel)
Minimap:SetScript("OnMouseUp", M.Minimap_OnMouseUp)
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "Update_ZoneText")
self:RegisterEvent("ZONE_CHANGED", "Update_ZoneText")
self:RegisterEvent("ZONE_CHANGED_INDOORS", "Update_ZoneText")
self:RegisterEvent("PLAYER_ENTERING_WORLD", "Update_ZoneText")
local fm = CreateFrame("Minimap", "FarmModeMap", E.UIParent)
fm:SetWidth(E.db.farmSize)
fm:SetHeight(E.db.farmSize)
fm:SetPoint("TOP", E.UIParent, "TOP", 0, -120)
fm:SetClampedToScreen(true)
E:CreateBackdrop(fm, "Default")
fm:EnableMouseWheel(true)
fm:SetScript("OnMouseWheel", M.Minimap_OnMouseWheel)
fm:SetScript("OnMouseUp", M.Minimap_OnMouseUp)
fm:RegisterForDrag("LeftButton", "RightButton")
fm:SetMovable(true)
fm:SetScript("OnDragStart", function() this:StartMoving() end)
fm:SetScript("OnDragStop", function() this:StopMovingOrSizing() end)
fm:Hide()
FarmModeMap:SetScript("OnShow", function()
if(BuffsMover and not E:HasMoverBeenMoved("BuffsMover")) then
BuffsMover:ClearAllPoints()
BuffsMover:Point("TOPRIGHT", E.UIParent, "TOPRIGHT", -3, -3)
end
if(DebuffsMover and not E:HasMoverBeenMoved("DebuffsMover")) then
DebuffsMover:ClearAllPoints()
DebuffsMover:Point("TOPRIGHT", ElvUIPlayerBuffs, "BOTTOMRIGHT", 0, -3)
end
MinimapCluster:ClearAllPoints()
MinimapCluster:SetAllPoints(FarmModeMap)
end)
FarmModeMap:SetScript("OnHide", function()
if(BuffsMover and not E:HasMoverBeenMoved("BuffsMover")) then
E:ResetMovers(L["Player Buffs"])
end
if(DebuffsMover and not E:HasMoverBeenMoved("DebuffsMover")) then
E:ResetMovers(L["Player Debuffs"])
end
MinimapCluster:ClearAllPoints()
MinimapCluster:SetAllPoints(Minimap)
end)
HookScript(UIParent, "OnShow", function()
if not FarmModeMap.enabled then
FarmModeMap:Hide()
end
end)
end
local function InitializeCallback()
M:Initialize()
end
E:RegisterInitialModule(M:GetName(), InitializeCallback)
+112
View File
@@ -0,0 +1,112 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local M = E:NewModule("WorldMap", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0");
E.WorldMap = M
--Cache global variables
--Lua functions
local format = string.format
--WoW API / Variables
local CreateFrame = CreateFrame
local GetPlayerMapPosition = GetPlayerMapPosition
local GetCursorPosition = GetCursorPosition
local PLAYER = PLAYER
local INVERTED_POINTS = {
["TOPLEFT"] = "BOTTOMLEFT",
["TOPRIGHT"] = "BOTTOMRIGHT",
["BOTTOMLEFT"] = "TOPLEFT",
["BOTTOMRIGHT"] = "TOPRIGHT",
["TOP"] = "BOTTOM",
["BOTTOM"] = "TOP"
}
function M:UpdateCoords()
if not WorldMapFrame:IsShown() then return end
local x, y = GetPlayerMapPosition("player")
x = x and E:Round(100 * x, 2) or 0
y = y and E:Round(100 * y, 2) or 0
if x ~= 0 and y ~= 0 then
CoordsHolder.playerCoords:SetText(PLAYER..": "..format("%.2f, %.2f", x, y))
else
CoordsHolder.playerCoords:SetText("")
end
local scale = WorldMapDetailFrame:GetEffectiveScale()
local width = WorldMapDetailFrame:GetWidth()
local height = WorldMapDetailFrame:GetHeight()
local centerX, centerY = WorldMapDetailFrame:GetCenter()
local x, y = GetCursorPosition()
local adjustedX = (x / scale - (centerX - (width / 2))) / width
local adjustedY = (centerY + (height / 2) - y / scale) / height
if adjustedX >= 0 and adjustedY >= 0 and adjustedX <= 1 and adjustedY <= 1 then
adjustedX = E:Round(100 * adjustedX, 2)
adjustedY = E:Round(100 * adjustedY, 2)
CoordsHolder.mouseCoords:SetText("MOUSE_LABEL"..": "..format("%.2f, %.2f", adjustedX, adjustedY))
else
CoordsHolder.mouseCoords:SetText("")
end
end
function M:PositionCoords()
local db = E.global.general.WorldMapCoordinates
local position = db.position
local xOffset = db.xOffset
local yOffset = db.yOffset
local x, y = 5, 5
if position == "BOTTOMRIGHT" or position == "TOPRIGHT" then x = -5 end
if position == "TOPLEFT" or position == "TOP" or position == "TOPRIGHT" then y = -5 end
CoordsHolder.playerCoords:ClearAllPoints()
CoordsHolder.playerCoords:SetPoint(position, WorldMapDetailFrame, position, x + xOffset, y + yOffset)
CoordsHolder.mouseCoords:ClearAllPoints()
CoordsHolder.mouseCoords:SetPoint(position, CoordsHolder.playerCoords, INVERTED_POINTS[position], 0, y)
end
function M:Initialize()
if E.global.general.WorldMapCoordinates.enable then
local coordsHolder = CreateFrame("Frame", "CoordsHolder", WorldMapFrame)
coordsHolder:SetFrameStrata(WorldMapDetailFrame:GetFrameStrata())
coordsHolder.playerCoords = coordsHolder:CreateFontString(nil, "OVERLAY")
coordsHolder.mouseCoords = coordsHolder:CreateFontString(nil, "OVERLAY")
coordsHolder.playerCoords:SetTextColor(1, 1 ,0)
coordsHolder.mouseCoords:SetTextColor(1, 1 ,0)
coordsHolder.playerCoords:SetFontObject(NumberFontNormal)
coordsHolder.mouseCoords:SetFontObject(NumberFontNormal)
coordsHolder.playerCoords:SetPoint("BOTTOMLEFT", WorldMapDetailFrame, "BOTTOMLEFT", 5, 5)
coordsHolder.playerCoords:SetText(PLAYER..": 0, 0")
coordsHolder.mouseCoords:SetPoint("BOTTOMLEFT", coordsHolder.playerCoords, "TOPLEFT", 0, 5)
coordsHolder.mouseCoords:SetText("MOUSE_LABEL"..": 0, 0")
coordsHolder:SetScript("OnUpdate", self.UpdateCoords)
self:PositionCoords()
end
--if E.global.general.smallerWorldMap then
BlackoutWorld:SetTexture(nil)
--WorldMapFrame:SetParent(UIParent)
WorldMapFrame:EnableKeyboard(false)
HookScript(WorldMapFrame, "OnShow", function()
WorldMapFrame:SetScale(UIParent:GetScale())
end)
WorldMapFrame:EnableMouse(false)
UIPanelWindows["WorldMapFrame"] = {area = "center", pushable = 0, whileDead = 1}
HookScript(DropDownList1, "OnShow", function()
if DropDownList1:GetScale() ~= UIParent:GetScale() then
DropDownList1:SetScale(UIParent:GetScale())
end
end)
--end
end
local function InitializeCallback()
M:Initialize()
end
E:RegisterInitialModule(M:GetName(), InitializeCallback)
@@ -0,0 +1,421 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local select = select
local pairs = pairs
--WoW API / Variables
local CreateFrame = CreateFrame
local RegisterAsWidget, RegisterAsContainer
local function SetModifiedBackdrop()
if this.backdrop then this = this.backdrop end
this:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor))
end
local function SetOriginalBackdrop()
if this.backdrop then this = this.backdrop end
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
local function SkinScrollBar(frame, thumbTrim)
if _G[frame:GetName().."BG"] then _G[frame:GetName().."BG"]:SetTexture(nil) end
if _G[frame:GetName().."Track"] then _G[frame:GetName().."Track"]:SetTexture(nil) end
if _G[frame:GetName().."Top"] then
_G[frame:GetName().."Top"]:SetTexture(nil)
_G[frame:GetName().."Bottom"]:SetTexture(nil)
_G[frame:GetName().."Middle"]:SetTexture(nil)
end
if _G[frame:GetName().."ScrollUpButton"] and _G[frame:GetName().."ScrollDownButton"] then
E:StripTextures(_G[frame:GetName().."ScrollUpButton"])
if not _G[frame:GetName().."ScrollUpButton"].icon then
S:HandleNextPrevButton(_G[frame:GetName().."ScrollUpButton"])
S:SquareButton_SetIcon(_G[frame:GetName().."ScrollUpButton"], "UP")
-- _G[frame:GetName().."ScrollUpButton"]:Size(_G[frame:GetName().."ScrollUpButton"]:GetWidth() + 7, _G[frame:GetName().."ScrollUpButton"]:GetHeight() + 7)
_G[frame:GetName().."ScrollUpButton"]:SetWidth(_G[frame:GetName().."ScrollUpButton"]:GetWidth() + 7)
_G[frame:GetName().."ScrollUpButton"]:SetHeight(_G[frame:GetName().."ScrollUpButton"]:GetHeight() + 7)
end
E:StripTextures(_G[frame:GetName().."ScrollDownButton"])
if not _G[frame:GetName().."ScrollDownButton"].icon then
S:HandleNextPrevButton(_G[frame:GetName().."ScrollDownButton"])
S:SquareButton_SetIcon(_G[frame:GetName().."ScrollDownButton"], "DOWN")
-- _G[frame:GetName().."ScrollDownButton"]:Size(_G[frame:GetName().."ScrollDownButton"]:GetWidth() + 7, _G[frame:GetName().."ScrollDownButton"]:GetHeight() + 7)
_G[frame:GetName().."ScrollDownButton"]:SetWidth(_G[frame:GetName().."ScrollDownButton"]:GetWidth() + 7)
_G[frame:GetName().."ScrollDownButton"]:SetHeight(_G[frame:GetName().."ScrollDownButton"]:GetHeight() + 7)
end
if not frame.trackbg then
frame.trackbg = CreateFrame("Frame", nil, frame)
frame.trackbg:SetPoint("TOPLEFT", _G[frame:GetName().."ScrollUpButton"], "BOTTOMLEFT", 0, -1)
frame.trackbg:SetPoint("BOTTOMRIGHT", _G[frame:GetName().."ScrollDownButton"], "TOPRIGHT", 0, 1)
E:SetTemplate(frame.trackbg, "Transparent")
end
if frame:GetThumbTexture() then
if not thumbTrim then thumbTrim = 3 end
frame:GetThumbTexture():SetTexture(nil)
if not frame.thumbbg then
frame.thumbbg = CreateFrame("Frame", nil, frame)
frame.thumbbg:SetPoint("TOPLEFT", frame:GetThumbTexture(), "TOPLEFT", 2, -thumbTrim)
frame.thumbbg:SetPoint("BOTTOMRIGHT", frame:GetThumbTexture(), "BOTTOMRIGHT", -2, thumbTrim)
E:SetTemplate(frame.thumbbg, "Default", true, true)
frame.thumbbg:SetBackdropColor(0.3, 0.3, 0.3)
if frame.trackbg then
frame.thumbbg:SetFrameLevel(frame.trackbg:GetFrameLevel() + 1)
end
end
end
end
end
local function SkinButton(f, strip, noTemplate)
local name = f:GetName()
if(name) then
local left = _G[name.."Left"]
local middle = _G[name.."Middle"]
local right = _G[name.."Right"]
if(left) then E:Kill(left) end
if(middle) then E:Kill(middle) end
if(right) then E:Kill(right) end
end
if(f.Left) then E:Kill(f.Left) end
if(f.Middle) then E:Kill(f.Middle) end
if(f.Right) then E:Kill(f.Right) end
if f.SetNormalTexture then f:SetNormalTexture("") end
if f.SetHighlightTexture then f:SetHighlightTexture("") end
if f.SetPushedTexture then f:SetPushedTexture("") end
if f.SetDisabledTexture then f:SetDisabledTexture("") end
if strip then E:StripTextures(f) end
if not f.template and not noTemplate then
E:SetTemplate(f, "Default", true)
end
f:SetScript("OnEnter", function() S:SetModifiedBackdrop(this) end)
f:SetScript("OnLeave", function() S:SetOriginalBackdrop(this) end)
end
function S:SkinAce3()
local AceGUI = LibStub("AceGUI-3.0", true)
if not AceGUI then return end
local oldRegisterAsWidget = AceGUI.RegisterAsWidget
RegisterAsWidget = function(self, widget)
if not E.private.skins.ace3.enable then
return oldRegisterAsWidget(self, widget)
end
local TYPE = widget.type
if TYPE == "MultiLineEditBox" then
local frame = widget.frame
if not widget.scrollBG.template then
E:SetTemplate(widget.scrollBG, "Default")
end
SkinButton(widget.button)
SkinScrollBar(widget.scrollBar)
widget.scrollBar:SetPoint("RIGHT", frame, "RIGHT", 0 -4)
widget.scrollBG:SetPoint("TOPRIGHT", widget.scrollBar, "TOPLEFT", -2, 19)
widget.scrollBG:SetPoint("BOTTOMLEFT", widget.button, "TOPLEFT")
widget.scrollFrame:SetPoint("BOTTOMRIGHT", widget.scrollBG, "BOTTOMRIGHT", -4, 8)
elseif TYPE == "CheckBox" then
E:Kill(widget.checkbg)
E:Kill(widget.highlight)
if not widget.skinnedCheckBG then
widget.skinnedCheckBG = CreateFrame("Frame", nil, widget.frame)
E:SetTemplate(widget.skinnedCheckBG, "Default")
widget.skinnedCheckBG:SetPoint("TOPLEFT", widget.checkbg, "TOPLEFT", 4, -4)
widget.skinnedCheckBG:SetPoint("BOTTOMRIGHT", widget.checkbg, "BOTTOMRIGHT", -4, 4)
end
widget.check:SetParent(widget.skinnedCheckBG)
elseif TYPE == "Dropdown" then
local frame = widget.dropdown
local button = widget.button
local text = widget.text
E:StripTextures(frame)
button:ClearAllPoints()
button:SetPoint("RIGHT", frame, "RIGHT", -20, 0)
S:HandleNextPrevButton(button, true)
if not frame.backdrop then
E:CreateBackdrop(frame, "Default")
frame.backdrop:SetPoint("TOPLEFT", 20, -2)
frame.backdrop:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
end
button:SetParent(frame.backdrop)
text:SetParent(frame.backdrop)
HookScript(button, "OnClick", function(this)
local dropdown = this.obj.pullout
if dropdown.frame then
E:SetTemplate(dropdown.frame, "Default", true)
if dropdown.slider then
E:SetTemplate(dropdown.slider, "Default")
dropdown.slider:SetPoint("TOPRIGHT", dropdown.frame, "TOPRIGHT", -10, -10)
dropdown.slider:SetPoint("BOTTOMRIGHT", dropdown.frame, "BOTTOMRIGHT", -10, 10)
if dropdown.slider:GetThumbTexture() then
dropdown.slider:SetThumbTexture(E["media"].blankTex)
dropdown.slider:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
-- dropdown.slider:GetThumbTexture():Size(10, 12)
dropdown.slider:GetThumbTexture():SetWidth(10)
dropdown.slider:GetThumbTexture():SetHeight(12)
end
end
end
end)
elseif TYPE == "LSM30_Font" or TYPE == "LSM30_Sound" or TYPE == "LSM30_Border" or TYPE == "LSM30_Background" or TYPE == "LSM30_Statusbar" then
local frame = widget.frame
local button = frame.dropButton
local text = frame.text
E:StripTextures(frame)
S:HandleNextPrevButton(button, true)
frame.text:ClearAllPoints()
frame.text:SetPoint("RIGHT", button, "LEFT", -2, 0)
button:ClearAllPoints()
button:SetPoint("RIGHT", frame, "RIGHT", -10, -6)
if not frame.backdrop then
E:CreateBackdrop(frame, "Default")
if TYPE == "LSM30_Font" then
frame.backdrop:SetPoint("TOPLEFT", 20, -17)
elseif TYPE == "LSM30_Sound" then
frame.backdrop:SetPoint("TOPLEFT", 20, -17)
widget.soundbutton:SetParent(frame.backdrop)
widget.soundbutton:ClearAllPoints()
widget.soundbutton:SetPoint("LEFT", frame.backdrop, "LEFT", 2, 0)
elseif TYPE == "LSM30_Statusbar" then
frame.backdrop:SetPoint("TOPLEFT", 20, -17)
widget.bar:SetParent(frame.backdrop)
E:SetInside(widget.bar)
elseif TYPE == "LSM30_Border" or TYPE == "LSM30_Background" then
frame.backdrop:SetPoint("TOPLEFT", 42, -16)
end
frame.backdrop:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
end
button:SetParent(frame.backdrop)
text:SetParent(frame.backdrop)
HookScript(button, "OnClick", function(this)
local dropdown = this.obj.dropdown
if dropdown then
E:SetTemplate(dropdown, "Default", true)
if dropdown.slider then
E:SetTemplate(dropdown.slider, "Transparent")
dropdown.slider:SetPoint("TOPRIGHT", dropdown, "TOPRIGHT", -10, -10)
dropdown.slider:SetPoint("BOTTOMRIGHT", dropdown, "BOTTOMRIGHT", -10, 10)
if dropdown.slider:GetThumbTexture() then
dropdown.slider:SetThumbTexture(E["media"].blankTex)
dropdown.slider:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
-- dropdown.slider:GetThumbTexture():Size(10, 12)
dropdown.slider:GetThumbTexture():SetWidth(10)
dropdown.slider:GetThumbTexture():SetHeight(12)
end
end
if TYPE == "LSM30_Sound" then
local frame = this.obj.frame
local width = frame:GetWidth()
dropdown:SetPoint("TOPLEFT", frame, "BOTTOMLEFT")
dropdown:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 30, 0)
end
end
end)
elseif TYPE == "EditBox" then
local frame = widget.editbox
local button = widget.button
E:Kill(_G[frame:GetName().."Left"])
E:Kill(_G[frame:GetName().."Middle"])
E:Kill(_G[frame:GetName().."Right"])
frame:SetHeight(17)
E:CreateBackdrop(frame, "Default")
frame.backdrop:SetPoint("TOPLEFT", -2, 0)
frame.backdrop:SetPoint("BOTTOMRIGHT", 2, 0)
frame.backdrop:SetParent(widget.frame)
frame:SetParent(frame.backdrop)
SkinButton(button)
elseif TYPE == "Button" then
local frame = widget.frame
SkinButton(frame, nil, true)
E:StripTextures(frame)
E:CreateBackdrop(frame, "Default", true)
E:SetInside(frame.backdrop)
widget.text:SetParent(frame.backdrop)
elseif TYPE == "Button-ElvUI" then
local frame = widget.frame
SkinButton(frame, nil, true)
E:StripTextures(frame)
E:CreateBackdrop(frame, "Default", true)
E:SetInside(frame.backdrop)
widget.text:SetParent(frame.backdrop)
elseif TYPE == "Keybinding" then
local button = widget.button
local msgframe = widget.msgframe
local msg = widget.msgframe.msg
SkinButton(button)
E:StripTextures(msgframe)
E:CreateBackdrop(msgframe, "Default", true)
E:SetInside(msgframe.backdrop)
msgframe:SetToplevel(true)
msg:ClearAllPoints()
msg:SetPoint("LEFT", 10, 0)
msg:SetPoint("RIGHT", -10, 0)
msg:SetJustifyV("MIDDLE")
msg:SetWidth(msg:GetWidth() + 10)
elseif TYPE == "Slider" then
local frame = widget.slider
local editbox = widget.editbox
local lowtext = widget.lowtext
local hightext = widget.hightext
local HEIGHT = 12
E:StripTextures(frame)
E:SetTemplate(frame, "Default")
frame:SetHeight(HEIGHT)
frame:SetThumbTexture(E["media"].blankTex)
frame:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
-- frame:GetThumbTexture():Size(HEIGHT-2,HEIGHT+2)
frame:GetThumbTexture():SetWidth(HEIGHT-2)
frame:GetThumbTexture():SetHeight(HEIGHT+2)
E:SetTemplate(editbox, "Default")
editbox:SetHeight(15)
editbox:SetPoint("TOP", frame, "BOTTOM", 0, -1)
lowtext:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 2, -2)
hightext:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", -2, -2)
--[[elseif TYPE == "ColorPicker" then
local frame = widget.frame
local colorSwatch = widget.colorSwatch
]]
end
return oldRegisterAsWidget(self, widget)
end
AceGUI.RegisterAsWidget = RegisterAsWidget
local oldRegisterAsContainer = AceGUI.RegisterAsContainer
RegisterAsContainer = function(self, widget)
if not E.private.skins.ace3.enable then
return oldRegisterAsContainer(self, widget)
end
local TYPE = widget.type
if TYPE == "ScrollFrame" then
local frame = widget.scrollbar
SkinScrollBar(frame)
elseif TYPE == "InlineGroup" or TYPE == "TreeGroup" or TYPE == "TabGroup" or TYPE == "Frame" or TYPE == "DropdownGroup" or TYPE == "Window" then
local frame = widget.content:GetParent()
if TYPE == "Frame" then
E:StripTextures(frame)
if(not E.GUIFrame) then
E.GUIFrame = frame
end
for i=1, frame:GetNumChildren() do
local child = select(i, frame:GetChildren())
if child:GetObjectType() == "Button" and child:GetText() then
SkinButton(child)
else
E:StripTextures(child)
end
end
elseif TYPE == "Window" then
E:StripTextures(frame)
S:HandleCloseButton(frame.obj.closebutton)
end
E:SetTemplate(frame, "Transparent")
if widget.treeframe then
E:SetTemplate(widget.treeframe, "Transparent")
frame:SetPoint("TOPLEFT", widget.treeframe, "TOPRIGHT", 1, 0)
local oldCreateButton = widget.CreateButton
widget.CreateButton = function(self)
local button = oldCreateButton(self)
E:StripTextures(button.toggle)
button.toggle.SetNormalTexture = E.noop
button.toggle.SetPushedTexture = E.noop
button.toggleText = button.toggle:CreateFontString(nil, "OVERLAY")
E:FontTemplate(button.toggleText, nil, 19)
-- button.toggleText:SetPoint("CENTER")
button.toggleText:SetText("+")
return button
end
local oldRefreshTree = widget.RefreshTree
widget.RefreshTree = function(self, scrollToSelection)
oldRefreshTree(self, scrollToSelection)
if not self.tree then return end
local status = self.status or self.localstatus
local groupstatus = status.groups
local lines = self.lines
local buttons = self.buttons
for i, line in pairs(lines) do
local button = buttons[i]
if groupstatus[line.uniquevalue] and button then
button.toggleText:SetText("-")
elseif button then
button.toggleText:SetText("+")
end
end
end
end
if TYPE == "TabGroup" then
local oldCreateTab = widget.CreateTab
widget.CreateTab = function(self, id)
local tab = oldCreateTab(self, id)
E:StripTextures(tab)
tab.backdrop = CreateFrame("Frame", nil, tab)
E:SetTemplate(tab.backdrop, "Transparent")
tab.backdrop:SetFrameLevel(tab:GetFrameLevel() - 1)
tab.backdrop:SetPoint("TOPLEFT", 10, -3)
tab.backdrop:SetPoint("BOTTOMRIGHT", -10, 0)
return tab
end
end
if widget.scrollbar then
SkinScrollBar(widget.scrollbar)
end
elseif TYPE == "SimpleGroup" then
local frame = widget.content:GetParent()
E:SetTemplate(frame, "Transparent", nil, true) --ignore border updates
frame:SetBackdropBorderColor(0,0,0,0) --Make border completely transparent
end
return oldRegisterAsContainer(self, widget)
end
AceGUI.RegisterAsContainer = RegisterAsContainer
end
local function attemptSkin()
local AceGUI = LibStub("AceGUI-3.0", true)
if AceGUI and (AceGUI.RegisterAsContainer ~= RegisterAsContainer or AceGUI.RegisterAsWidget ~= RegisterAsWidget) then
S:SkinAce3()
end
end
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", attemptSkin)
S:AddCallback("Ace3", attemptSkin)
@@ -0,0 +1,3 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Ace3.lua"/>
</Ui>
@@ -0,0 +1,327 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.auctionhouse ~= true then return end
E:StripTextures(AuctionFrame, true)
E:CreateBackdrop(AuctionFrame, "Transparent")
AuctionFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
AuctionFrame.backdrop:SetPoint("BOTTOMRIGHT", 0, 4)
E:StripTextures(BrowseFilterScrollFrame)
E:StripTextures(BrowseScrollFrame)
E:StripTextures(AuctionsScrollFrame)
E:StripTextures(BidScrollFrame)
S:HandleDropDownBox(BrowseDropDown)
S:HandleScrollBar(BrowseFilterScrollFrameScrollBar)
S:HandleScrollBar(BrowseScrollFrameScrollBar)
S:HandleScrollBar(AuctionsScrollFrameScrollBar)
S:HandleCloseButton(AuctionFrameCloseButton)
-- DressUpFrame
E:StripTextures(AuctionDressUpFrame)
E:CreateBackdrop(AuctionDressUpFrame, "Default")
SetAuctionDressUpBackground()
AuctionDressUpBackgroundTop:SetDesaturated(true)
AuctionDressUpBackgroundBot:SetDesaturated(true)
E:SetOutside(AuctionDressUpFrame.backdrop, AuctionDressUpBackgroundTop, nil, nil, AuctionDressUpBackgroundBot)
S:HandleRotateButton(AuctionDressUpModelRotateLeftButton)
AuctionDressUpModelRotateLeftButton:SetPoint("TOPLEFT", AuctionDressUpFrame, 8, -17)
S:HandleRotateButton(AuctionDressUpModelRotateRightButton)
AuctionDressUpModelRotateRightButton:SetPoint("TOPLEFT", AuctionDressUpModelRotateLeftButton, "TOPRIGHT", 3, 0)
S:HandleButton(AuctionDressUpFrameResetButton)
S:HandleCloseButton(AuctionDressUpFrameCloseButton, AuctionDressUpFrame.backdrop)
local buttons = {
"BrowseBidButton",
"BidBidButton",
"BrowseBuyoutButton",
"BidBuyoutButton",
"BrowseCloseButton",
"BidCloseButton",
"BrowseSearchButton",
"AuctionsCloseButton",
"AuctionsCancelAuctionButton",
"AuctionsCreateAuctionButton",
}
for _, button in pairs(buttons) do
S:HandleButton(_G[button])
end
--Fix Button Positions
AuctionsCloseButton:SetPoint("BOTTOMRIGHT", AuctionFrameAuctions, "BOTTOMRIGHT", 66, 14)
AuctionsCancelAuctionButton:SetPoint("RIGHT", AuctionsCloseButton, "LEFT", -4, 0)
BidBuyoutButton:SetPoint("RIGHT", BidCloseButton, "LEFT", -4, 0)
BidBidButton:SetPoint("RIGHT", BidBuyoutButton, "LEFT", -4, 0)
BrowseBuyoutButton:SetPoint("RIGHT", BrowseCloseButton, "LEFT", -4, 0)
BrowseBidButton:SetPoint("RIGHT", BrowseBuyoutButton, "LEFT", -4, 0)
AuctionsCreateAuctionButton:SetPoint("BOTTOMLEFT", 18, 44)
BrowseSearchButton:ClearAllPoints()
BrowseSearchButton:SetPoint("TOPRIGHT", AuctionFrameBrowse, "TOPRIGHT", 25, -30)
S:HandleNextPrevButton(BrowseNextPageButton)
BrowseNextPageButton:ClearAllPoints()
BrowseNextPageButton:SetPoint("BOTTOMLEFT", BrowseSearchButton, "BOTTOMRIGHT", 10, -27)
S:HandleNextPrevButton(BrowsePrevPageButton)
BrowsePrevPageButton:ClearAllPoints()
BrowsePrevPageButton:SetPoint("BOTTOMRIGHT", BrowseSearchButton, "BOTTOMLEFT", -10, -27)
E:StripTextures(AuctionsItemButton)
E:SetTemplate(AuctionsItemButton, "Default", true)
E:StyleButton(AuctionsItemButton)
HookScript(AuctionsItemButton, "OnEvent", function()
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
if arg1 == "NEW_AUCTION_UPDATE" and this:GetNormalTexture() then
this:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
E:SetInside(this:GetNormalTexture())
end
local _, _, _, quality = GetAuctionSellItemInfo()
if quality and quality > 1 then
AuctionsItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
AuctionsItemButtonName:SetTextColor(quality)
else
E:SetTemplate(AuctionsItemButton, "Default", true)
end
end)
local sorttabs = {
"BrowseQualitySort",
"BrowseLevelSort",
"BrowseDurationSort",
"BrowseHighBidderSort",
"BrowseCurrentBidSort",
"BidQualitySort",
"BidLevelSort",
"BidDurationSort",
"BidBuyoutSort",
"BidStatusSort",
"BidBidSort",
"AuctionsQualitySort",
"AuctionsDurationSort",
"AuctionsHighBidderSort",
"AuctionsBidSort",
}
for _, sorttab in pairs(sorttabs) do
E:Kill(_G[sorttab.."Left"])
E:Kill(_G[sorttab.."Middle"])
E:Kill(_G[sorttab.."Right"])
E:StyleButton(_G[sorttab])
end
for i = 1, 3 do
S:HandleTab(_G["AuctionFrameTab"..i])
end
AuctionFrameTab1:ClearAllPoints()
AuctionFrameTab1:SetPoint("BOTTOMLEFT", AuctionFrame, "BOTTOMLEFT", 25, -26)
AuctionFrameTab1.SetPoint = E.noop
for i = 1, NUM_FILTERS_TO_DISPLAY do
local tab = _G["AuctionFilterButton"..i]
E:StripTextures(tab)
E:StyleButton(tab)
end
local editboxs = {
"BrowseName",
"BrowseMinLevel",
"BrowseMaxLevel",
"BrowseBidPriceGold",
"BrowseBidPriceSilver",
"BrowseBidPriceCopper",
"BidBidPriceGold",
"BidBidPriceSilver",
"BidBidPriceCopper",
"StartPriceGold",
"StartPriceSilver",
"StartPriceCopper",
"BuyoutPriceGold",
"BuyoutPriceSilver",
"BuyoutPriceCopper"
}
for _, editbox in pairs(editboxs) do
S:HandleEditBox(_G[editbox])
_G[editbox]:SetTextInsets(1, 1, -1, 1)
end
BrowseBidPrice:SetPoint("BOTTOM", -15, 18)
BrowseBidText:SetPoint("BOTTOMRIGHT", AuctionFrameBrowse, "BOTTOM", -116, 21)
BrowseMaxLevel:SetPoint("LEFT", BrowseMinLevel, "RIGHT", 8, 0)
BrowseLevelText:SetPoint("BOTTOMLEFT", AuctionFrameBrowse, "TOPLEFT", 195, -48)
BrowseName:SetWidth(164)
BrowseName:SetPoint("TOPLEFT", AuctionFrameBrowse, "TOPLEFT", 20, -54)
BrowseNameText:SetPoint("TOPLEFT", BrowseName, "TOPLEFT", 0, 16)
S:HandleCheckBox(IsUsableCheckButton)
IsUsableCheckButton:ClearAllPoints()
IsUsableCheckButton:SetPoint("RIGHT", BrowseIsUsableText, "LEFT", 2, 0)
BrowseIsUsableText:SetPoint("TOPLEFT", 440, -40)
S:HandleCheckBox(ShowOnPlayerCheckButton)
ShowOnPlayerCheckButton:ClearAllPoints()
ShowOnPlayerCheckButton:SetPoint("RIGHT", BrowseShowOnCharacterText, "LEFT", 2, 0)
BrowseShowOnCharacterText:SetPoint("TOPLEFT", 440, -60)
for i = 1, NUM_BROWSE_TO_DISPLAY do
local button = _G["BrowseButton"..i]
local icon = _G["BrowseButton"..i.."Item"]
local name = _G["BrowseButton"..i.."Name"]
local texture = _G["BrowseButton"..i.."ItemIconTexture"]
if texture then
texture:SetTexCoord(unpack(E.TexCoords))
E:SetInside(texture)
end
if icon then
E:StyleButton(icon)
icon:GetNormalTexture():SetTexture("")
E:SetTemplate(icon, "Default")
hooksecurefunc(name, "SetVertexColor", function(_, r, g, b)
if(r == 1 and g == 1 and b == 1) then
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
else
icon:SetBackdropBorderColor(r, g, b)
end
end)
hooksecurefunc(name, "Hide", function(_, r, g, b)
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end)
end
E:StripTextures(button)
E:StyleButton(button)
_G["BrowseButton"..i.."Highlight"] = button:GetHighlightTexture()
button:GetHighlightTexture():ClearAllPoints()
button:GetHighlightTexture():SetPoint("TOPLEFT", icon, "TOPRIGHT", 2, 0)
button:GetHighlightTexture():SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5)
button:GetPushedTexture():SetAllPoints(button:GetHighlightTexture())
end
for i = 1, NUM_AUCTIONS_TO_DISPLAY do
local button = _G["AuctionsButton"..i]
local icon = _G["AuctionsButton"..i.."Item"]
local name = _G["AuctionsButton"..i.."Name"]
_G["AuctionsButton"..i.."ItemIconTexture"]:SetTexCoord(unpack(E.TexCoords))
E:SetInside(_G["AuctionsButton"..i.."ItemIconTexture"])
E:StyleButton(icon)
icon:GetNormalTexture():SetTexture("")
E:SetTemplate(icon, "Default")
hooksecurefunc(name, "SetVertexColor", function(_, r, g, b)
if(r == 1 and g == 1 and b == 1) then
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
else
icon:SetBackdropBorderColor(r, g, b)
end
end)
hooksecurefunc(name, "Hide", function(_, r, g, b)
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end)
E:StripTextures(button)
E:StyleButton(button)
_G["AuctionsButton"..i.."Highlight"] = button:GetHighlightTexture()
button:GetHighlightTexture():ClearAllPoints()
button:GetHighlightTexture():SetPoint("TOPLEFT", icon, "TOPRIGHT", 2, 0)
button:GetHighlightTexture():SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5)
button:GetPushedTexture():SetAllPoints(button:GetHighlightTexture())
end
for i = 1, NUM_BIDS_TO_DISPLAY do
local button = _G["BidButton"..i]
local icon = _G["BidButton"..i.."Item"]
local name = _G["BidButton"..i.."Name"]
_G["BidButton"..i.."ItemIconTexture"]:SetTexCoord(unpack(E.TexCoords))
E:SetInside(_G["BidButton"..i.."ItemIconTexture"])
E:StyleButton(icon)
icon:GetNormalTexture():SetTexture("")
E:SetTemplate(icon, "Default")
E:CreateBackdrop(icon, "Default")
icon.backdrop:SetAllPoints()
hooksecurefunc(name, "SetVertexColor", function(_, r, g, b)
if(r == 1 and g == 1 and b == 1) then
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
else
icon:SetBackdropBorderColor(r, g, b)
end
end)
hooksecurefunc(name, "Hide", function(_, r, g, b)
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end)
E:StripTextures(button)
E:StyleButton(button)
_G["BidButton"..i.."Highlight"] = button:GetHighlightTexture()
button:GetHighlightTexture():ClearAllPoints()
button:GetHighlightTexture():SetPoint("TOPLEFT", icon, "TOPRIGHT", 2, 0)
button:GetHighlightTexture():SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5)
button:GetPushedTexture():SetAllPoints(button:GetHighlightTexture())
end
--Custom Backdrops
AuctionFrameBrowse.bg1 = CreateFrame("Frame", nil, AuctionFrameBrowse)
E:SetTemplate(AuctionFrameBrowse.bg1, "Default")
AuctionFrameBrowse.bg1:SetPoint("TOPLEFT", 20, -103)
AuctionFrameBrowse.bg1:SetPoint("BOTTOMRIGHT", -575, 40)
BrowseNoResultsText:SetParent(AuctionFrameBrowse.bg1)
BrowseSearchCountText:SetParent(AuctionFrameBrowse.bg1)
AuctionFrameBrowse.bg1:SetFrameLevel(AuctionFrameBrowse.bg1:GetFrameLevel() - 1)
AuctionFrameBrowse.bg2 = CreateFrame("Frame", nil, AuctionFrameBrowse)
E:SetTemplate(AuctionFrameBrowse.bg2, "Default")
AuctionFrameBrowse.bg2:SetPoint("TOPLEFT", AuctionFrameBrowse.bg1, "TOPRIGHT", 4, 0)
AuctionFrameBrowse.bg2:SetPoint("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 40)
AuctionFrameBrowse.bg2:SetFrameLevel(AuctionFrameBrowse.bg2:GetFrameLevel() - 1)
AuctionFrameBid.bg = CreateFrame("Frame", nil, AuctionFrameBid)
E:SetTemplate(AuctionFrameBid.bg, "Default")
AuctionFrameBid.bg:SetPoint("TOPLEFT", 20, -72)
AuctionFrameBid.bg:SetPoint("BOTTOMRIGHT", 66, 40)
AuctionFrameBid.bg:SetFrameLevel(AuctionFrameBid.bg:GetFrameLevel() - 1)
AuctionFrameAuctions.bg1 = CreateFrame("Frame", nil, AuctionFrameAuctions)
E:SetTemplate(AuctionFrameAuctions.bg1, "Default")
AuctionFrameAuctions.bg1:SetPoint("TOPLEFT", 15, -72)
AuctionFrameAuctions.bg1:SetPoint("BOTTOMRIGHT", -545, 40)
AuctionFrameAuctions.bg1:SetFrameLevel(AuctionFrameAuctions.bg1:GetFrameLevel() - 3)
AuctionFrameAuctions.bg2 = CreateFrame("Frame", nil, AuctionFrameAuctions)
E:SetTemplate(AuctionFrameAuctions.bg2, "Default")
AuctionFrameAuctions.bg2:SetPoint("TOPLEFT", AuctionFrameAuctions.bg1, "TOPRIGHT", 3, 0)
AuctionFrameAuctions.bg2:SetPoint("BOTTOMRIGHT", AuctionFrame, -8, 40)
AuctionFrameAuctions.bg2:SetFrameLevel(AuctionFrameAuctions.bg2:GetFrameLevel() - 3)
end
S:AddCallbackForAddon("Blizzard_AuctionUI", "AuctionHouse", LoadSkin)
@@ -0,0 +1,80 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local split = string.split
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.bgscore ~= true then return end
E:CreateBackdrop(WorldStateScoreFrame, "Transparent")
WorldStateScoreFrame.backdrop:SetPoint("TOPLEFT", 10, -15)
WorldStateScoreFrame.backdrop:SetPoint("BOTTOMRIGHT", -113, 67)
E:StripTextures(WorldStateScoreFrame)
E:StripTextures(WorldStateScoreScrollFrame)
S:HandleScrollBar(WorldStateScoreScrollFrameScrollBar)
local tab
for i = 1, 3 do
tab = _G["WorldStateScoreFrameTab"..i]
S:HandleTab(tab)
_G["WorldStateScoreFrameTab"..i.."Text"]:SetPoint("CENTER", 0, 2)
end
S:HandleButton(WorldStateScoreFrameLeaveButton)
S:HandleCloseButton(WorldStateScoreFrameCloseButton)
E:StyleButton(WorldStateScoreFrameKB)
E:StyleButton(WorldStateScoreFrameDeaths)
E:StyleButton(WorldStateScoreFrameHK)
E:StyleButton(WorldStateScoreFrameHonorGained)
E:StyleButton(WorldStateScoreFrameName)
for i = 1, 5 do
E:StyleButton(_G["WorldStateScoreColumn"..i])
end
hooksecurefunc("WorldStateScoreFrame_Update", function()
local offset = FauxScrollFrame_GetOffset(WorldStateScoreScrollFrame)
for i = 1, MAX_WORLDSTATE_SCORE_BUTTONS do
local index = offset + i
local name, _, _, _, _, faction = GetBattlefieldScore(index)
if name then
local n, r = split("-", name, 2)
local myName = UnitName("player")
if name == myName then
n = "> "..n.." <"
end
if r then
local color
if faction == 1 then
color = "|cff00adf0"
else
color = "|cffff1919"
end
r = color..r.."|r"
n = n.."|cffffffff - |r"..r
end
local classTextColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[classToken] or RAID_CLASS_COLORS[classToken]
_G["WorldStateScoreButton"..i.."NameText"]:SetText(n)
_G["WorldStateScoreButton"..i.."NameText"]:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b)
end
end
end)
end
S:AddCallback("WorldStateScore", LoadSkin)
@@ -0,0 +1,26 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
--WoW API / Variables
local function LoadSkin()
E:StripTextures(BattlefieldFrame)
E:CreateBackdrop(BattlefieldFrame, "Transparent")
BattlefieldFrame.backdrop:SetPoint("TOPLEFT", 11, -12)
BattlefieldFrame.backdrop:SetPoint("BOTTOMRIGHT", -34, 74)
E:StripTextures(BattlefieldListScrollFrame)
S:HandleScrollBar(BattlefieldListScrollFrameScrollBar)
S:HandleButton(BattlefieldFrameCancelButton)
S:HandleButton(BattlefieldFrameJoinButton)
S:HandleButton(BattlefieldFrameGroupJoinButton)
S:HandleCloseButton(BattlefieldFrameCloseButton)
end
S:AddCallback("Battlefield", LoadSkin)
@@ -0,0 +1,34 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.binding ~= true then return end
E:StripTextures(KeyBindingFrame)
E:CreateBackdrop(KeyBindingFrame, "Transparent")
KeyBindingFrame.backdrop:SetPoint("TOPLEFT", 2, 0)
KeyBindingFrame.backdrop:SetPoint("BOTTOMRIGHT", -42, 12)
local bindingKey1, bindingKey2
for i = 1, KEY_BINDINGS_DISPLAYED do
bindingKey1 = _G["KeyBindingFrameBinding"..i.."Key1Button"]
bindingKey2 = _G["KeyBindingFrameBinding"..i.."Key2Button"]
S:HandleButton(bindingKey1)
S:HandleButton(bindingKey2)
bindingKey2:SetPoint("LEFT", bindingKey1, "RIGHT", 1, 0)
end
S:HandleScrollBar(KeyBindingFrameScrollFrameScrollBar)
S:HandleCheckBox(KeyBindingFrameCharacterButton)
S:HandleButton(KeyBindingFrameDefaultButton)
S:HandleButton(KeyBindingFrameCancelButton)
S:HandleButton(KeyBindingFrameOkayButton)
KeyBindingFrameOkayButton:SetPoint("RIGHT", KeyBindingFrameCancelButton, "LEFT", -3, 0)
S:HandleButton(KeyBindingFrameUnbindButton)
KeyBindingFrameUnbindButton:SetPoint("RIGHT", KeyBindingFrameOkayButton, "LEFT", -3, 0)
end
S:AddCallbackForAddon("Blizzard_BindingUI", "Binding", LoadSkin)
@@ -0,0 +1,324 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local getn = table.getn
--WoW API / Variables
local GetInventoryItemTexture = GetInventoryItemTexture
local GetInventoryItemQuality = GetInventoryItemQuality
local GetNumFactions = GetNumFactions
local FauxScrollFrame_GetOffset = FauxScrollFrame_GetOffset
local NUM_FACTIONS_DISPLAYED = NUM_FACTIONS_DISPLAYED
local CHARACTERFRAME_SUBFRAMES = CHARACTERFRAME_SUBFRAMES
local function LoadSkin()
-- Character Frame
E:StripTextures(CharacterFrame, true)
E:CreateBackdrop(CharacterFrame, "Transparent")
CharacterFrame.backdrop:SetPoint("TOPLEFT", 11, -12)
CharacterFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 76)
S:HandleCloseButton(CharacterFrameCloseButton)
for i = 1, getn(CHARACTERFRAME_SUBFRAMES) do
local tab = _G["CharacterFrameTab"..i]
S:HandleTab(tab)
end
E:StripTextures(PaperDollFrame)
S:HandleRotateButton(CharacterModelFrameRotateLeftButton)
CharacterModelFrameRotateLeftButton:SetPoint("TOPLEFT", 3, -3)
S:HandleRotateButton(CharacterModelFrameRotateRightButton)
CharacterModelFrameRotateRightButton:SetPoint("TOPLEFT", CharacterModelFrameRotateLeftButton, "TOPRIGHT", 3, 0)
E:StripTextures(CharacterAttributesFrame)
local function HandleResistanceFrame(frameName)
for i = 1, 5 do
local frame = _G[frameName..i]
frame:SetWidth(24)
frame:SetHeight(24)
local icon, text = _G[frameName..i]:GetRegions()
E:SetInside(icon)
icon:SetDrawLayer("ARTWORK")
text:SetDrawLayer("OVERLAY")
E:SetTemplate(frame, "Default")
if i ~= 1 then
frame:ClearAllPoints()
frame:SetPoint("TOP", _G[frameName..i-1], "BOTTOM", 0, -(E.Border + E.Spacing))
end
end
end
HandleResistanceFrame("MagicResFrame")
MagicResFrame1:GetRegions():SetTexCoord(0.21875, 0.8125, 0.25, 0.32421875) --Arcane
MagicResFrame2:GetRegions():SetTexCoord(0.21875, 0.8125, 0.0234375, 0.09765625) --Fire
MagicResFrame3:GetRegions():SetTexCoord(0.21875, 0.8125, 0.13671875, 0.2109375) --Nature
MagicResFrame4:GetRegions():SetTexCoord(0.21875, 0.8125, 0.36328125, 0.4375) --Frost
MagicResFrame5:GetRegions():SetTexCoord(0.21875, 0.8125, 0.4765625, 0.55078125) --Shadow
local slots = {"HeadSlot", "NeckSlot", "ShoulderSlot", "BackSlot", "ChestSlot", "ShirtSlot", "TabardSlot", "WristSlot",
"HandsSlot", "WaistSlot", "LegsSlot", "FeetSlot", "Finger0Slot", "Finger1Slot", "Trinket0Slot", "Trinket1Slot",
"MainHandSlot", "SecondaryHandSlot", "RangedSlot", "AmmoSlot"
}
for _, slot in pairs(slots) do
local icon = _G["Character"..slot.."IconTexture"]
local cooldown = _G["Character"..slot.."Cooldown"]
slot = _G["Character"..slot]
E:StripTextures(slot)
E:StyleButton(slot, false)
E:SetTemplate(slot, "Default", true, true)
icon:SetTexCoord(unpack(E.TexCoords))
E:SetInside(icon)
slot:SetFrameLevel(PaperDollFrame:GetFrameLevel() + 2)
if cooldown then
E:RegisterCooldown(cooldown)
end
end
hooksecurefunc("PaperDollItemSlotButton_Update", function(cooldownOnly)
if cooldownOnly then return end
local textureName = GetInventoryItemTexture("player", this:GetID())
if textureName then
local rarity = GetInventoryItemQuality("player", this:GetID())
this:SetBackdropBorderColor(GetItemQualityColor(rarity))
else
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end)
E:StripTextures(ReputationFrame)
for i = 1, NUM_FACTIONS_DISPLAYED do
local factionBar = _G["ReputationBar"..i]
local factionHeader = _G["ReputationHeader"..i]
local factionName = _G["ReputationBar"..i.."FactionName"]
local factionAtWarCheck = _G["ReputationBar"..i.."AtWarCheck"]
E:StripTextures(factionBar)
E:CreateBackdrop(factionBar, "Default")
factionBar:SetStatusBarTexture(E.media.normTex)
--factionBar:SetSize(108, 13)
E:RegisterStatusBar(factionBar)
--factionName:SetPoint("LEFT", factionBar, "LEFT", -150, 0)
--factionName:SetWidth(140)
--factionName.SetWidth = E.noop
E:StripTextures(factionAtWarCheck)
--factionAtWarCheck:SetPoint("LEFT", factionBar, "RIGHT", 0, 0)
factionAtWarCheck.Text = factionAtWarCheck:CreateFontString(nil, "OVERLAY")
E:FontTemplate(factionAtWarCheck.Text)
factionAtWarCheck.Text:SetPoint("LEFT", 3, -6)
factionAtWarCheck.Text:SetText("|TInterface\\Buttons\\UI-CheckBox-SwordCheck:45:45|t")
E:StripTextures(factionHeader)
factionHeader:SetNormalTexture(nil)
factionHeader.SetNormalTexture = E.noop
factionHeader.Text = factionHeader:CreateFontString(nil, "OVERLAY")
E:FontTemplate(factionHeader.Text, nil, 22)
factionHeader.Text:SetPoint("LEFT", 3, 0)
factionHeader.Text:SetText("+")
end
-- PetPaperDollFrame
E:StripTextures(PetPaperDollFrame)
S:HandleButton(PetPaperDollCloseButton)
S:HandleRotateButton(PetModelFrameRotateLeftButton)
PetModelFrameRotateLeftButton:ClearAllPoints()
PetModelFrameRotateLeftButton:SetPoint("TOPLEFT", 3, -3)
S:HandleRotateButton(PetModelFrameRotateRightButton)
PetModelFrameRotateRightButton:ClearAllPoints()
PetModelFrameRotateRightButton:SetPoint("TOPLEFT", PetModelFrameRotateLeftButton, "TOPRIGHT", 3, 0)
E:StripTextures(PetAttributesFrame)
E:CreateBackdrop(PetResistanceFrame, "Default")
E:SetOutside(PetResistanceFrame.backdrop, PetMagicResFrame1, nil, nil, PetMagicResFrame5)
for i = 1, 5 do
local frame = _G["PetMagicResFrame"..i]
-- frame:Size(24)
frame:SetWidth(24)
frame:SetHeight(24)
end
PetMagicResFrame1:GetRegions():SetTexCoord(0.21875, 0.78125, 0.25, 0.3203125)
PetMagicResFrame2:GetRegions():SetTexCoord(0.21875, 0.78125, 0.0234375, 0.09375)
PetMagicResFrame3:GetRegions():SetTexCoord(0.21875, 0.78125, 0.13671875, 0.20703125)
PetMagicResFrame4:GetRegions():SetTexCoord(0.21875, 0.78125, 0.36328125, 0.43359375)
PetMagicResFrame5:GetRegions():SetTexCoord(0.21875, 0.78125, 0.4765625, 0.546875)
E:StripTextures(PetPaperDollFrameExpBar)
PetPaperDollFrameExpBar:SetStatusBarTexture(E["media"].normTex)
E:RegisterStatusBar(PetPaperDollFrameExpBar)
E:CreateBackdrop(PetPaperDollFrameExpBar, "Default")
local function updHappiness()
local happiness = GetPetHappiness()
local _, isHunterPet = HasPetUI()
if not happiness or not isHunterPet then
return
end
local texture = this:GetRegions()
if happiness == 1 then
texture:SetTexCoord(0.41, 0.53, 0.06, 0.30)
elseif happiness == 2 then
texture:SetTexCoord(0.22, 0.345, 0.06, 0.30)
elseif happiness == 3 then
texture:SetTexCoord(0.04, 0.15, 0.06, 0.30)
end
end
PetPaperDollPetInfo:SetPoint("TOPLEFT", PetModelFrameRotateLeftButton, "BOTTOMLEFT", 9, -3)
PetPaperDollPetInfo:GetRegions():SetTexCoord(0.04, 0.15, 0.06, 0.30)
PetPaperDollPetInfo:SetFrameLevel(PetModelFrame:GetFrameLevel() + 2)
E:CreateBackdrop(PetPaperDollPetInfo, "Default")
-- PetPaperDollPetInfo:Size(24, 24)
PetPaperDollPetInfo:SetWidth(24)
PetPaperDollPetInfo:SetHeight(24)
-- updHappiness(PetPaperDollPetInfo)
PetPaperDollPetInfo:RegisterEvent("UNIT_HAPPINESS")
PetPaperDollPetInfo:SetScript("OnEvent", updHappiness)
PetPaperDollPetInfo:SetScript("OnShow", updHappiness)
-- Reputation Frame
hooksecurefunc("ReputationFrame_Update", function()
local numFactions = GetNumFactions()
local factionIndex, factionHeader
local factionOffset = FauxScrollFrame_GetOffset(ReputationListScrollFrame)
for i = 1, NUM_FACTIONS_DISPLAYED, 1 do
factionHeader = _G["ReputationHeader"..i]
factionIndex = factionOffset + i
if factionIndex <= numFactions then
if factionHeader.isCollapsed then
factionHeader.Text:SetText("+")
else
factionHeader.Text:SetText("-")
end
end
end
end)
E:StripTextures(ReputationListScrollFrame)
S:HandleScrollBar(ReputationListScrollFrameScrollBar)
E:StripTextures(ReputationDetailFrame)
E:SetTemplate(ReputationDetailFrame, "Transparent")
S:HandleCloseButton(ReputationDetailCloseButton)
S:HandleCheckBox(ReputationDetailAtWarCheckBox)
ReputationDetailAtWarCheckBox:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-SwordCheck")
S:HandleCheckBox(ReputationDetailInactiveCheckBox)
S:HandleCheckBox(ReputationDetailMainScreenCheckBox)
-- Skill Frame
E:StripTextures(SkillFrame)
SkillFrameExpandButtonFrame:DisableDrawLayer("BACKGROUND")
SkillFrameCollapseAllButton:SetPoint("LEFT", SkillFrameExpandTabLeft, "RIGHT", -40, -3)
SkillFrameCollapseAllButton:SetNormalTexture("")
SkillFrameCollapseAllButton.SetNormalTexture = E.noop
SkillFrameCollapseAllButton:SetHighlightTexture(nil)
SkillFrameCollapseAllButton.Text = SkillFrameCollapseAllButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(SkillFrameCollapseAllButton.Text, nil, 22)
SkillFrameCollapseAllButton.Text:SetPoint("CENTER", -10, 0)
SkillFrameCollapseAllButton.Text:SetText("+")
hooksecurefunc(SkillFrameCollapseAllButton, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
else
self.Text:SetText("+")
end
end)
S:HandleButton(SkillFrameCancelButton)
for i = 1, SKILLS_TO_DISPLAY do
local bar = _G["SkillRankFrame"..i]
bar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(bar)
E:CreateBackdrop(bar, "Default")
E:StripTextures(_G["SkillRankFrame"..i.."Border"])
_G["SkillRankFrame"..i.."Background"]:SetTexture(nil)
local label = _G["SkillTypeLabel"..i]
label:SetNormalTexture("")
label.SetNormalTexture = E.noop
label:SetHighlightTexture(nil)
label.Text = label:CreateFontString(nil, "OVERLAY")
E:FontTemplate(label.Text, nil, 22)
label.Text:SetPoint("LEFT", 3, 0)
label.Text:SetText("+")
hooksecurefunc(label, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
else
self.Text:SetText("+")
end
end)
end
E:StripTextures(SkillListScrollFrame)
S:HandleScrollBar(SkillListScrollFrameScrollBar)
E:StripTextures(SkillDetailScrollFrame)
S:HandleScrollBar(SkillDetailScrollFrameScrollBar)
E:StripTextures(SkillDetailStatusBar)
SkillDetailStatusBar:SetParent(SkillDetailScrollFrame)
E:CreateBackdrop(SkillDetailStatusBar, "Default")
SkillDetailStatusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(SkillDetailStatusBar)
E:StripTextures(SkillDetailStatusBarUnlearnButton)
SkillDetailStatusBarUnlearnButton:SetPoint("LEFT", SkillDetailStatusBarBorder, "RIGHT", -2, -5)
-- SkillDetailStatusBarUnlearnButton:Size(36)
SkillDetailStatusBarUnlearnButton:SetWidth(36)
SkillDetailStatusBarUnlearnButton:SetHeight(36)
SkillDetailStatusBarUnlearnButton.Text = SkillDetailStatusBarUnlearnButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(SkillDetailStatusBarUnlearnButton.Text)
SkillDetailStatusBarUnlearnButton.Text:SetPoint("LEFT", 7, 5)
SkillDetailStatusBarUnlearnButton.Text:SetText("|TInterface\\Buttons\\UI-GroupLoot-Pass-Up:34:34|t")
-- Honor Frame
hooksecurefunc("HonorFrame_Update", function()
E:StripTextures(HonorFrame)
HonorFrameProgressBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(HonorFrameProgressBar)
end)
end
S:AddCallback("Character", LoadSkin)
@@ -0,0 +1,160 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local select = select
local find = string.find
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or not E.private.skins.blizzard.craft ~= true then return end
E:StripTextures(CraftFrame, true)
E:CreateBackdrop(CraftFrame, "Transparent")
CraftFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
CraftFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 74)
E:StripTextures(CraftRankFrameBorder)
CraftRankFrame:SetHeight(16)
CraftRankFrame:ClearAllPoints()
CraftRankFrame:SetPoint("TOP", 10, -45)
E:CreateBackdrop(CraftRankFrame)
CraftRankFrame:SetStatusBarTexture(E["media"].normTex)
CraftRankFrame:SetStatusBarColor(0.13, 0.35, 0.80)
E:RegisterStatusBar(CraftRankFrame)
CraftRankFrameSkillRank:ClearAllPoints()
CraftRankFrameSkillRank:SetPoint("CENTER", CraftRankFrame, "CENTER", 0, 0)
E:StripTextures(CraftExpandButtonFrame)
E:StripTextures(CraftDetailScrollChildFrame)
E:StripTextures(CraftListScrollFrame)
S:HandleScrollBar(CraftListScrollFrameScrollBar)
E:StripTextures(CraftDetailScrollFrame)
S:HandleScrollBar(CraftDetailScrollFrameScrollBar)
E:StripTextures(CraftIcon)
S:HandleButton(CraftCreateButton)
S:HandleButton(CraftCancelButton)
S:HandleCloseButton(CraftFrameCloseButton)
for i = 1, MAX_CRAFT_REAGENTS do
local reagent = _G["CraftReagent" .. i]
local icon = _G["CraftReagent" .. i .. "IconTexture"]
local count = _G["CraftReagent" .. i .. "Count"]
local nameFrame = _G["CraftReagent" .. i .. "NameFrame"]
icon:SetTexCoord(unpack(E.TexCoords))
icon:SetDrawLayer("OVERLAY")
icon.backdrop = CreateFrame("Frame", nil, reagent)
icon.backdrop:SetFrameLevel(reagent:GetFrameLevel() - 1)
E:SetTemplate(icon.backdrop, "Default")
E:SetOutside(icon.backdrop, icon)
icon:SetParent(icon.backdrop)
count:SetParent(icon.backdrop)
count:SetDrawLayer("OVERLAY")
E:Kill(nameFrame)
end
hooksecurefunc("CraftFrame_SetSelection", function(id)
if CraftIcon:GetNormalTexture() then
CraftIcon:SetAlpha(1)
CraftIcon:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
E:SetInside(CraftIcon:GetNormalTexture())
else
CraftIcon:SetAlpha(0)
end
local skillLink = GetCraftItemLink(id, 1)
if(skillLink) then
CraftRequirements:SetTextColor(1, 0.80, 0.10)
local quality = select(3, GetItemInfo(skillLink))
if(quality and quality > 1) then
CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality))
CraftName:SetTextColor(GetItemQualityColor(quality))
else
CraftIcon:SetBackdropBorderColor(unpack(E["media"].bordercolor))
CraftName:SetTextColor(1, 1, 1)
end
end
local numReagents = GetCraftNumReagents(id)
for i = 1, numReagents, 1 do
local reagentName, reagentTexture, reagentCount, playerReagentCount = GetCraftReagentInfo(id, i)
local reagentLink = GetCraftReagentItemLink(id, i)
local icon = _G["CraftReagent" .. i .. "IconTexture"]
local name = _G["CraftReagent" .. i .. "Name"]
if(reagentLink) then
local quality = select(3, GetItemInfo(reagentLink))
if(quality and quality > 1) then
icon.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
if(playerReagentCount < reagentCount) then
name:SetTextColor(0.5, 0.5, 0.5)
else
name:SetTextColor(GetItemQualityColor(quality))
end
else
icon.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end
end
end)
for i = 1, CRAFTS_DISPLAYED do
local craftButton = _G["Craft" .. i]
craftButton:SetNormalTexture("")
craftButton.SetNormalTexture = E.noop
_G["Craft" .. i .. "Highlight"]:SetTexture("")
_G["Craft" .. i .. "Highlight"].SetTexture = E.noop
craftButton.Text = craftButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(craftButton.Text, nil, 22)
craftButton.Text:SetPoint("LEFT", 3, 0)
craftButton.Text:SetText("+")
hooksecurefunc(craftButton, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
self.Text:SetText("+")
else
self.Text:SetText("")
end
end)
end
CraftCollapseAllButton:SetNormalTexture("")
CraftCollapseAllButton.SetNormalTexture = E.noop
CraftCollapseAllButton:SetHighlightTexture("")
CraftCollapseAllButton.SetHighlightTexture = E.noop
CraftCollapseAllButton:SetDisabledTexture("")
CraftCollapseAllButton.SetDisabledTexture = E.noop
CraftCollapseAllButton.Text = CraftCollapseAllButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(CraftCollapseAllButton.Text, nil, 22)
CraftCollapseAllButton.Text:SetPoint("LEFT", 3, 0)
CraftCollapseAllButton.Text:SetText("+")
hooksecurefunc(CraftCollapseAllButton, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
else
self.Text:SetText("+")
end
end)
end
S:AddCallbackForAddon("Blizzard_CraftUI", "Craft", LoadSkin)
@@ -0,0 +1,78 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local getn = table.getn
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.debug ~= true then return end
-- ScriptErrorsFrame:SetParent(E.UIParent)
ScriptErrorsFrame:SetScale(UIParent:GetScale())
E:SetTemplate(ScriptErrorsFrame, "Transparent")
S:HandleScrollBar(ScriptErrorsFrameScrollFrameScrollBar)
S:HandleCloseButton(ScriptErrorsFrameClose)
E:FontTemplate(ScriptErrorsFrameScrollFrameText, nil, 13)
E:CreateBackdrop(ScriptErrorsFrameScrollFrame, "Default")
ScriptErrorsFrameScrollFrame:SetFrameLevel(ScriptErrorsFrameScrollFrame:GetFrameLevel() + 2)
E:SetTemplate(EventTraceFrame, "Transparent")
S:HandleSliderFrame(EventTraceFrameScroll)
local texs = {
"TopLeft",
"TopRight",
"Top",
"BottomLeft",
"BottomRight",
"Bottom",
"Left",
"Right",
"TitleBG",
"DialogBG",
}
for i = 1, getn(texs) do
_G["ScriptErrorsFrame"..texs[i]]:SetTexture(nil)
_G["EventTraceFrame"..texs[i]]:SetTexture(nil)
end
S:HandleButton(ScriptErrorsFrame.reload)
S:HandleNextPrevButton(ScriptErrorsFrame.previous)
S:HandleNextPrevButton(ScriptErrorsFrame.next)
S:HandleButton(ScriptErrorsFrame.close)
S:HandleButton(ScriptErrorsFrame.close)
ScriptErrorsFrame.reload:SetPoint("BOTTOMLEFT", 12, 8)
ScriptErrorsFrame.close:SetPoint("BOTTOMRIGHT", -12, 8)
-- TODO FIX HandleNextPrevButton button size
ScriptErrorsFrame.previous:SetPoint("BOTTOM", ScriptErrorsFrame, "BOTTOM", -50, 12)
ScriptErrorsFrame.next:SetPoint("BOTTOM", ScriptErrorsFrame, "BOTTOM", 50, 12)
local noscalemult = E.mult * GetCVar("uiScale")
HookScript(FrameStackTooltip, "OnShow", function()
this:SetBackdrop({
bgFile = E["media"].blankTex,
edgeFile = E["media"].blankTex,
tile = false, tileSize = 0, edgeSize = noscalemult,
insets = { left = -noscalemult, right = -noscalemult, top = -noscalemult, bottom = -noscalemult}
});
this:SetBackdropColor(unpack(E["media"].backdropfadecolor))
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end)
HookScript(EventTraceTooltip, "OnShow", function()
E:SetTemplate(this, "Transparent")
end)
S:HandleCloseButton(EventTraceFrameCloseButton)
end
S:AddCallbackForAddon("!DebugTools", "SkinDebugTools", LoadSkin)
@@ -0,0 +1,43 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
--WoW API / Variables
local SetDressUpBackground = SetDressUpBackground
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.dressingroom ~= true then return end
E:StripTextures(DressUpFrame)
E:CreateBackdrop(DressUpFrame, "Transparent")
DressUpFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
DressUpFrame.backdrop:SetPoint("BOTTOMRIGHT", -33, 73)
E:Kill(DressUpFramePortrait)
SetDressUpBackground()
DressUpBackgroundTopLeft:SetDesaturated(true)
DressUpBackgroundTopRight:SetDesaturated(true)
DressUpBackgroundBotLeft:SetDesaturated(true)
DressUpBackgroundBotRight:SetDesaturated(true)
DressUpFrameDescriptionText:SetPoint("CENTER", DressUpFrameTitleText, "BOTTOM", -5, -22)
S:HandleCloseButton(DressUpFrameCloseButton)
S:HandleRotateButton(DressUpModelRotateLeftButton)
DressUpModelRotateLeftButton:SetPoint("TOPLEFT", DressUpFrame, 25, -79)
S:HandleRotateButton(DressUpModelRotateRightButton)
DressUpModelRotateRightButton:SetPoint("TOPLEFT", DressUpModelRotateLeftButton, "TOPRIGHT", 3, 0)
S:HandleButton(DressUpFrameCancelButton)
DressUpFrameCancelButton:SetPoint("CENTER", DressUpFrame, "TOPLEFT", 306, -423)
S:HandleButton(DressUpFrameResetButton)
DressUpFrameResetButton:SetPoint("RIGHT", DressUpFrameCancelButton, "LEFT", -3, 0)
E:CreateBackdrop(DressUpModel, "Default")
E:SetOutside(DressUpModel.backdrop, DressUpBackgroundTopLeft, nil, nil, DressUpModel)
end
S:AddCallback("DressingRoom", LoadSkin)
@@ -0,0 +1,278 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local GetWhoInfo = GetWhoInfo
local GetGuildRosterInfo = GetGuildRosterInfo
local GUILDMEMBERS_TO_DISPLAY = GUILDMEMBERS_TO_DISPLAY
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS
function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.friends ~= true then return end
-- Friends Frame
E:StripTextures(FriendsFrame, true)
E:CreateBackdrop(FriendsFrame, "Transparent")
FriendsFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
FriendsFrame.backdrop:SetPoint("BOTTOMRIGHT", -33, 76)
S:HandleCloseButton(FriendsFrameCloseButton)
for i = 1, 4 do
S:HandleTab(_G["FriendsFrameTab"..i])
end
-- Friends List Frame
for i = 1, 2 do
local tab = _G["FriendsFrameToggleTab"..i]
E:StripTextures(tab)
E:CreateBackdrop(tab, "Default", true)
tab.backdrop:SetPoint("TOPLEFT", 3, -7)
tab.backdrop:SetPoint("BOTTOMRIGHT", -2, -1)
tab:SetScript("OnEnter", function() S:SetModifiedBackdrop(this) end)
tab:SetScript("OnLeave", function() S:SetOriginalBackdrop(this) end)
end
local r, g, b = 0.8, 0.8, 0.8
local function StyleButton(f, scale)
f:SetHighlightTexture(nil)
local width, height = (f:GetWidth() * (scale or 0.5)), f:GetHeight()
local leftGrad = f:CreateTexture(nil, "HIGHLIGHT")
-- leftGrad:Size(width, height)
leftGrad:SetWidth(width)
leftGrad:SetHeight(height)
leftGrad:SetPoint("LEFT", f, "CENTER")
leftGrad:SetTexture(E.media.blankTex)
leftGrad:SetGradientAlpha("Horizontal", r, g, b, 0.35, r, g, b, 0)
local rightGrad = f:CreateTexture(nil, "HIGHLIGHT")
-- rightGrad:Size(width, height)
rightGrad:SetWidth(width)
rightGrad:SetHeight(height)
rightGrad:SetPoint("RIGHT", f, "CENTER")
rightGrad:SetTexture(E.media.blankTex)
rightGrad:SetGradientAlpha("Horizontal", r, g, b, 0, r, g, b, 0.35)
end
for i = 1, 10 do
StyleButton(_G["FriendsFrameFriendButton"..i], 0.6)
end
E:StripTextures(FriendsFrameFriendsScrollFrame)
S:HandleScrollBar(FriendsFrameFriendsScrollFrameScrollBar)
S:HandleButton(FriendsFrameAddFriendButton)
FriendsFrameAddFriendButton:SetPoint("BOTTOMLEFT", 17, 102)
S:HandleButton(FriendsFrameSendMessageButton)
S:HandleButton(FriendsFrameRemoveFriendButton)
FriendsFrameRemoveFriendButton:SetPoint("TOP", FriendsFrameAddFriendButton, "BOTTOM", 0, -2)
S:HandleButton(FriendsFrameGroupInviteButton)
FriendsFrameGroupInviteButton:SetPoint("TOP", FriendsFrameSendMessageButton, "BOTTOM", 0, -2)
-- Ignore List Frame
for i = 1, 2 do
local tab = _G["IgnoreFrameToggleTab"..i]
E:StripTextures(tab)
E:CreateBackdrop(tab, "Default", true)
tab.backdrop:SetPoint("TOPLEFT", 3, -7)
tab.backdrop:SetPoint("BOTTOMRIGHT", -2, -1)
tab:SetScript("OnEnter", function() S:SetModifiedBackdrop(this) end)
tab:SetScript("OnLeave", function() S:SetOriginalBackdrop(this) end)
end
S:HandleButton(FriendsFrameIgnorePlayerButton)
S:HandleButton(FriendsFrameStopIgnoreButton)
for i = 1, 20 do
StyleButton(_G["FriendsFrameIgnoreButton"..i])
end
-- Who Frame
for i = 1, 4 do
E:StripTextures(_G["WhoFrameColumnHeader"..i])
E:StyleButton(_G["WhoFrameColumnHeader"..i], nil, true)
end
S:HandleDropDownBox(WhoFrameDropDown)
E:StripTextures(WhoListScrollFrame)
S:HandleScrollBar(WhoListScrollFrameScrollBar)
S:HandleEditBox(WhoFrameEditBox)
WhoFrameEditBox:SetPoint("BOTTOMLEFT", 17, 108)
WhoFrameEditBox:SetWidth(326)
WhoFrameEditBox:SetHeight(18)
S:HandleButton(WhoFrameWhoButton)
WhoFrameWhoButton:ClearAllPoints()
WhoFrameWhoButton:SetPoint("BOTTOMLEFT", 16, 82)
S:HandleButton(WhoFrameAddFriendButton)
WhoFrameAddFriendButton:SetPoint("LEFT", WhoFrameWhoButton, "RIGHT", 3, 0)
WhoFrameAddFriendButton:SetPoint("RIGHT", WhoFrameGroupInviteButton, "LEFT", -3, 0)
S:HandleButton(WhoFrameGroupInviteButton)
-- Guild Frame
for i = 1, GUILDMEMBERS_TO_DISPLAY do
StyleButton(_G["GuildFrameGuildStatusButton"..i])
end
E:StripTextures(GuildFrameLFGFrame)
E:SetTemplate(GuildFrameLFGFrame, "Transparent")
S:HandleCheckBox(GuildFrameLFGButton)
for i = 1, 4 do
E:StripTextures(_G["GuildFrameColumnHeader"..i])
E:StyleButton(_G["GuildFrameColumnHeader"..i], nil, true)
E:StripTextures(_G["GuildFrameGuildStatusColumnHeader"..i])
E:StyleButton(_G["GuildFrameGuildStatusColumnHeader"..i], nil, true)
end
E:StripTextures(GuildListScrollFrame)
S:HandleScrollBar(GuildListScrollFrameScrollBar)
S:HandleNextPrevButton(GuildFrameGuildListToggleButton)
S:HandleButton(GuildFrameGuildInformationButton)
S:HandleButton(GuildFrameAddMemberButton)
S:HandleButton(GuildFrameControlButton)
-- Member Detail Frame
E:StripTextures(GuildMemberDetailFrame)
E:CreateBackdrop(GuildMemberDetailFrame, "Transparent")
GuildMemberDetailFrame:SetPoint("TOPLEFT", GuildFrame, "TOPRIGHT", -31, -13)
S:HandleCloseButton(GuildMemberDetailCloseButton)
S:HandleButton(GuildFrameControlButton)
GuildMemberRemoveButton:SetPoint("BOTTOMLEFT", 8, 7)
S:HandleButton(GuildMemberGroupInviteButton)
GuildMemberGroupInviteButton:SetPoint("LEFT", GuildMemberRemoveButton, "RIGHT", 3, 0)
S:HandleNextPrevButton(GuildFramePromoteButton, true)
S:HandleNextPrevButton(GuildFrameDemoteButton, true)
GuildFrameDemoteButton:SetPoint("LEFT", GuildFramePromoteButton, "RIGHT", 2, 0)
E:SetTemplate(GuildMemberNoteBackground, "Default")
E:SetTemplate(GuildMemberOfficerNoteBackground, "Default")
-- Info Frame
E:StripTextures(GuildInfoFrame)
E:CreateBackdrop(GuildInfoFrame, "Transparent")
GuildInfoFrame.backdrop:SetPoint("TOPLEFT", 3, -6)
GuildInfoFrame.backdrop:SetPoint("BOTTOMRIGHT", -2, 3)
E:SetTemplate(GuildInfoTextBackground, "Default")
S:HandleScrollBar(GuildInfoFrameScrollFrameScrollBar)
S:HandleCloseButton(GuildInfoCloseButton)
S:HandleButton(GuildInfoSaveButton)
GuildInfoSaveButton:SetPoint("BOTTOMLEFT", 104, 11)
S:HandleButton(GuildInfoCancelButton)
GuildInfoCancelButton:SetPoint("LEFT", GuildInfoSaveButton, "RIGHT", 3, 0)
-- S:HandleButton(GuildInfoGuildEventButton)
-- GuildInfoGuildEventButton:SetPoint("RIGHT", GuildInfoSaveButton, "LEFT", -28, 0)
-- GuildEventLog Frame
-- E:StripTextures(GuildEventLogFrame)
-- E:CreateBackdrop(GuildEventLogFrame, "Transparent")
-- GuildEventLogFrame.backdrop:SetPoint("TOPLEFT", 3, -6)
-- GuildEventLogFrame.backdrop:SetPoint("BOTTOMRIGHT", -2, 5)
-- E:SetTemplate(GuildEventFrame, "Default")
-- S:HandleScrollBar(GuildEventLogScrollFrameScrollBar)
-- S:HandleCloseButton(GuildEventLogCloseButton)
-- GuildEventLogCancelButton:SetPoint("BOTTOMRIGHT", -9, 9)
-- S:HandleButton(GuildEventLogCancelButton)
-- Control Frame
E:StripTextures(GuildControlPopupFrame)
E:CreateBackdrop(GuildControlPopupFrame, "Transparent")
GuildControlPopupFrame.backdrop:SetPoint("TOPLEFT", 3, -6)
GuildControlPopupFrame.backdrop:SetPoint("BOTTOMRIGHT", -27, 27)
S:HandleDropDownBox(GuildControlPopupFrameDropDown, 185)
-- GuildControlPopupFrameDropDownButton:Size(16)
GuildControlPopupFrameDropDownButton:SetWidth(16)
GuildControlPopupFrameDropDownButton:SetHeight(16)
local function SkinPlusMinus(f, minus)
f:SetNormalTexture("")
f.SetNormalTexture = E.noop
f:SetPushedTexture("")
f.SetPushedTexture = E.noop
f:SetHighlightTexture("")
f.SetHighlightTexture = E.noop
f:SetDisabledTexture("")
f.SetDisabledTexture = E.noop
f.Text = f:CreateFontString(nil, "OVERLAY")
E:FontTemplate(f.Text, nil, 22)
f.Text:SetPoint("LEFT", 5, 0)
if minus then
f.Text:SetText("-")
else
f.Text:SetText("+")
end
end
GuildControlPopupFrameAddRankButton:SetPoint("LEFT", GuildControlPopupFrameDropDown, "RIGHT", -8, 3)
SkinPlusMinus(GuildControlPopupFrameAddRankButton)
SkinPlusMinus(GuildControlPopupFrameRemoveRankButton, true)
S:HandleEditBox(GuildControlPopupFrameEditBox)
GuildControlPopupFrameEditBox.backdrop:SetPoint("TOPLEFT", 0, -5)
GuildControlPopupFrameEditBox.backdrop:SetPoint("BOTTOMRIGHT", 0, 5)
for i = 1, 17 do
local Checkbox = _G["GuildControlPopupFrameCheckbox"..i]
if Checkbox then
S:HandleCheckBox(Checkbox)
end
end
S:HandleButton(GuildControlPopupAcceptButton)
S:HandleButton(GuildControlPopupFrameCancelButton)
-- Raid Frame
S:HandleButton(RaidFrameConvertToRaidButton)
S:HandleButton(RaidFrameRaidInfoButton)
-- Raid Info Frame
E:StripTextures(RaidInfoFrame, true)
E:SetTemplate(RaidInfoFrame, "Transparent")
HookScript(RaidInfoFrame, "OnShow", function()
if GetNumRaidMembers() > 0 then
RaidInfoFrame:SetPoint("TOPLEFT", RaidFrame, "TOPRIGHT", -14, -12)
else
RaidInfoFrame:SetPoint("TOPLEFT", RaidFrame, "TOPRIGHT", -34, -12)
end
end)
S:HandleCloseButton(RaidInfoCloseButton, RaidInfoFrame)
E:StripTextures(RaidInfoScrollFrame)
S:HandleScrollBar(RaidInfoScrollFrameScrollBar)
end
S:AddCallback("Friends", LoadSkin)
@@ -0,0 +1,59 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local select = select
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.gossip ~= true then return end
E:StripTextures(ItemTextFrame, true)
E:StripTextures(ItemTextScrollFrame)
S:HandleScrollBar(ItemTextScrollFrameScrollBar)
E:CreateBackdrop(ItemTextFrame, "Transparent")
ItemTextFrame.backdrop:SetPoint("TOPLEFT", 13, -13)
ItemTextFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 74)
S:HandleCloseButton(ItemTextCloseButton)
S:HandleNextPrevButton(ItemTextPrevPageButton)
S:HandleNextPrevButton(ItemTextNextPageButton)
ItemTextPageText:SetTextColor(1, 1, 1)
ItemTextPageText.SetTextColor = E.noop
S:HandleScrollBar(GossipGreetingScrollFrameScrollBar, 5)
E:StripTextures(GossipFrameGreetingPanel)
E:Kill(GossipFramePortrait)
S:HandleButton(GossipFrameGreetingGoodbyeButton)
GossipFrameGreetingGoodbyeButton:SetPoint("BOTTOMRIGHT", GossipFrame, -34, 71)
for i = 1, NUMGOSSIPBUTTONS do
local obj = select(3,_G["GossipTitleButton"..i]:GetRegions())
obj:SetTextColor(1,1,1)
end
GossipGreetingText:SetTextColor(1,1,1)
E:CreateBackdrop(GossipFrame, "Transparent")
GossipFrame.backdrop:SetPoint("TOPLEFT", 15, -19)
GossipFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 67)
S:HandleCloseButton(GossipFrameCloseButton)
hooksecurefunc("GossipFrameUpdate", function()
for i=1, NUMGOSSIPBUTTONS do
local button = _G["GossipTitleButton"..i]
if button:GetFontString() then
if button:GetFontString():GetText() and string.gfind(button:GetFontString():GetText(), "|cff000000") then
button:GetFontString():SetText(string.gsub(button:GetFontString():GetText(), "|cff000000", "|cffFFFF00"))
end
end
end
end)
end
S:AddCallback("Gossip", LoadSkin)
@@ -0,0 +1,31 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.greeting ~= true then return end
HookScript(QuestFrameGreetingPanel, "OnShow", function()
E:StripTextures(QuestFrameGreetingPanel)
S:HandleButton(QuestFrameGreetingGoodbyeButton, true)
GreetingText:SetTextColor(1, 1, 1)
CurrentQuestsText:SetTextColor(1, 1, 0)
E:Kill(QuestGreetingFrameHorizontalBreak)
AvailableQuestsText:SetTextColor(1, 1, 0)
S:HandleScrollBar(QuestGreetingScrollFrameScrollBar)
for i=1, MAX_NUM_QUESTS do
local button = _G["QuestTitleButton"..i]
if button:GetFontString() then
if button:GetFontString():GetText() and string.gfind(button:GetFontString():GetText(), "|cff000000") then
button:GetFontString():SetText(string.gsub(button:GetFontString():GetText(), "|cff000000", "|cffFFFF00"))
end
end
end
end)
end
S:AddCallback("Greeting", LoadSkin)
@@ -0,0 +1,42 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local select = select
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.guildregistrar ~= true then return end
E:StripTextures(GuildRegistrarFrame, true)
E:CreateBackdrop(GuildRegistrarFrame, "Transparent")
GuildRegistrarFrame.backdrop:SetPoint("TOPLEFT", 12, -17)
GuildRegistrarFrame.backdrop:SetPoint("BOTTOMRIGHT", -28, 65)
E:StripTextures(GuildRegistrarGreetingFrame)
S:HandleButton(GuildRegistrarFrameGoodbyeButton)
S:HandleButton(GuildRegistrarFrameCancelButton)
S:HandleButton(GuildRegistrarFramePurchaseButton)
S:HandleCloseButton(GuildRegistrarFrameCloseButton)
S:HandleEditBox(GuildRegistrarFrameEditBox)
for i = 1, GuildRegistrarFrameEditBox:GetNumRegions() do
local region = select(i, GuildRegistrarFrameEditBox:GetRegions())
if region and region:GetObjectType() == "Texture" then
if region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right" then
E:Kill(region)
end
end
end
GuildRegistrarFrameEditBox:SetHeight(20)
for i = 1, 2 do
_G["GuildRegistrarButton"..i]:GetFontString():SetTextColor(1, 1, 1)
end
GuildRegistrarPurchaseText:SetTextColor(1, 1, 1)
AvailableServicesText:SetTextColor(1, 1, 0)
end
S:AddCallback("GuildRegistrar", LoadSkin)
@@ -0,0 +1,72 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local getn = table.getn
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.help ~= true then return end
local helpFrameButtons = {
"GeneralBack",
"GeneralButton",
"GeneralButton2",
"GeneralCancel",
"GMBack",
"GMCancel",
"HarassmentBack",
"HarassmentCancel",
"HomeIssues",
"HomeCancel",
"OpenTicketSubmit",
"OpenTicketCancel",
"PhysicalHarassmentButton",
"VerbalHarassmentButton",
}
E:StripTextures(HelpFrame)
E:CreateBackdrop(HelpFrame, "Transparent")
HelpFrame.backdrop:SetPoint("TOPLEFT", 6, -2)
HelpFrame.backdrop:SetPoint("BOTTOMRIGHT", -45, 14)
S:HandleCloseButton(HelpFrameCloseButton)
HelpFrameCloseButton:SetPoint("TOPRIGHT", -42, 0)
for i = 1, getn(helpFrameButtons) do
local helpButton = _G["HelpFrame" .. helpFrameButtons[i]]
S:HandleButton(helpButton)
end
-- hide header textures and move text/buttons.
local BlizzardHeader = {
"KnowledgeBaseFrame"
}
for i = 1, getn(BlizzardHeader) do
local title = _G[BlizzardHeader[i].."Header"]
if title then
title:SetTexture("")
title:ClearAllPoints()
if title == _G["GameMenuFrameHeader"] then
title:SetPoint("TOP", GameMenuFrame, 0, 0)
else
title:SetPoint("TOP", BlizzardHeader[i], -22, -8)
end
end
end
E:StripTextures(HelpFrameOpenTicketDivider)
S:HandleScrollBar(HelpFrameOpenTicketScrollFrame)
S:HandleScrollBar(HelpFrameOpenTicketScrollFrameScrollBar)
HelpFrameOpenTicketSubmit:SetPoint("RIGHT", HelpFrameOpenTicketCancel, "LEFT", -2, 0)
E:Kill(HelpFrameHarassmentDivider)
E:Kill(HelpFrameHarassmentDivider2)
end
S:AddCallback("Help", LoadSkin)
@@ -0,0 +1,92 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local pairs = pairs
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if not E.private.skins.blizzard.enable or not E.private.skins.blizzard.inspect then return end
E:StripTextures(InspectFrame, true)
E:CreateBackdrop(InspectFrame, "Transparent")
InspectFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
InspectFrame.backdrop:SetPoint("BOTTOMRIGHT", -31, 75)
S:HandleCloseButton(InspectFrameCloseButton)
for i = 1, 2 do
S:HandleTab(_G["InspectFrameTab"..i])
end
E:StripTextures(InspectPaperDollFrame)
local slots = {
"HeadSlot",
"NeckSlot",
"ShoulderSlot",
"BackSlot",
"ChestSlot",
"ShirtSlot",
"TabardSlot",
"WristSlot",
"HandsSlot",
"WaistSlot",
"LegsSlot",
"FeetSlot",
"Finger0Slot",
"Finger1Slot",
"Trinket0Slot",
"Trinket1Slot",
"MainHandSlot",
"SecondaryHandSlot",
"RangedSlot"
}
for _, slot in pairs(slots) do
local icon = _G["Inspect"..slot.."IconTexture"]
local slot = _G["Inspect"..slot]
E:StripTextures(slot)
E:StyleButton(slot, false)
E:SetTemplate(slot, "Default", true)
icon:SetTexCoord(unpack(E.TexCoords))
E:SetInside(icon)
end
hooksecurefunc("InspectPaperDollItemSlotButton_Update", function(button)
if(button.hasItem) then
local itemID = GetInventoryItemLink(InspectFrame.unit, button:GetID())
if(itemID) then
local _, _, quality = GetItemInfo(itemID)
if(not quality) then
E:Delay(0.1, function()
if(InspectFrame.unit) then
InspectPaperDollItemSlotButton_Update(button)
end
end)
return
elseif(quality and quality > 1) then
button:SetBackdropBorderColor(GetItemQualityColor(quality))
return
end
end
end
button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end)
S:HandleRotateButton(InspectModelRotateLeftButton)
InspectModelRotateLeftButton:SetPoint("TOPLEFT", 3, -3)
S:HandleRotateButton(InspectModelRotateRightButton)
InspectModelRotateRightButton:SetPoint("TOPLEFT", InspectModelRotateLeftButton, "TOPRIGHT", 3, 0)
E:StripTextures(InspectHonorFrame)
end
S:AddCallbackForAddon("Blizzard_InspectUI", "Inspect", LoadSkin)
@@ -0,0 +1,35 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="AuctionHouse.lua"/>
<Script file="Battlefield.lua"/>
<Script file="BGScore.lua"/>
<Script file="Binding.lua"/>
<Script file="Character.lua"/>
<Script file="Craft.lua"/>
<Script file="Debug.lua"/>
<Script file="DressingRoom.lua"/>
<Script file="Friends.lua"/>
<Script file="Gossip.lua"/>
<Script file="Greeting.lua"/>
<Script file="GuildRegistrar.lua"/>
<Script file="Help.lua"/>
<Script file="Inspect.lua"/>
<Script file="Loot.lua"/>
<Script file="Macro.lua"/>
<Script file="Mail.lua"/>
<Script file="Merchant.lua"/>
<Script file="MirrorTimers.lua"/>
<Script file="Misc.lua"/>
<Script file="Petition.lua"/>
<Script file="Quest.lua"/>
<Script file="QuestTimer.lua"/>
<Script file="SpellBook.lua"/>
<Script file="Stable.lua"/>
<Script file="Tabard.lua"/>
<Script file="Talent.lua"/>
<Script file="Taxi.lua"/>
<Script file="Tooltip.lua"/>
<Script file="Trade.lua"/>
<Script file="Trainer.lua"/>
<Script file="Tutorial.lua"/>
<Script file="WorldMap.lua"/>
</Ui>
@@ -0,0 +1,115 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local select = select
--WoW API / Variables
local UnitName = UnitName
local IsFishingLoot = IsFishingLoot
local GetLootRollItemInfo = GetLootRollItemInfo
local GetItemQualityColor = GetItemQualityColor
local LOOTFRAME_NUMBUTTONS = LOOTFRAME_NUMBUTTONS
local NUM_GROUP_LOOT_FRAMES = NUM_GROUP_LOOT_FRAMES
local LOOT = LOOT
local function LoadSkin()
-- if E.private.general.loot then return end
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.loot ~= true then return end
E:StripTextures(LootFrame)
E:CreateBackdrop(LootFrame, "Transparent")
LootFrame.backdrop:SetPoint("TOPLEFT", 13, -14)
LootFrame.backdrop:SetPoint("BOTTOMRIGHT", -68, 5)
LootFramePortraitOverlay:SetParent(E.HiddenFrame)
S:HandleCloseButton(LootCloseButton)
for i = 1, LootFrame:GetNumRegions() do
local region = select(i, LootFrame:GetRegions())
if region:GetObjectType() == "FontString" then
if region:GetText() == ITEMS then
LootFrame.Title = region
end
end
end
LootFrame.Title:ClearAllPoints()
LootFrame.Title:SetPoint("TOPLEFT", LootFrame.backdrop, "TOPLEFT", 4, -4)
LootFrame.Title:SetJustifyH("LEFT")
for i = 1, LOOTFRAME_NUMBUTTONS do
local button = _G["LootButton" .. i]
S:HandleItemButton(button, true)
end
S:HandleNextPrevButton(LootFrameDownButton)
S:HandleNextPrevButton(LootFrameUpButton)
S:SquareButton_SetIcon(LootFrameUpButton, "UP")
S:SquareButton_SetIcon(LootFrameDownButton, "DOWN")
HookScript(LootFrame, "OnShow", function()
if IsFishingLoot() then
this.Title:SetText(L["Fishy Loot"])
elseif not UnitIsFriend("player", "target") and UnitIsDead("target") then
this.Title:SetText(UnitName("target"))
else
this.Title:SetText(LOOT)
end
end)
end
local function LoadRollSkin()
-- if E.private.general.lootRoll then return end
-- if not E.private.skins.blizzard.enable or not E.private.skins.blizzard.lootRoll then return end
local function OnShow(self)
E:SetTemplate(self, "Transparent")
local cornerTexture = _G[self:GetName() .. "Corner"]
cornerTexture:SetTexture()
local iconFrame = _G[self:GetName() .. "IconFrame"]
local _, _, _, quality = GetLootRollItemInfo(self.rollID)
iconFrame:SetBackdropBorderColor(GetItemQualityColor(quality))
end
for i = 1, NUM_GROUP_LOOT_FRAMES do
local frame = _G["GroupLootFrame" .. i]
frame:SetParent(UIParent)
E:StripTextures(frame)
local frameName = frame:GetName()
local iconFrame = _G[frameName .. "IconFrame"]
E:SetTemplate(iconFrame, "Default")
local icon = _G[frameName .. "IconFrameIcon"]
E:SetInside(icon)
icon:SetTexCoord(unpack(E.TexCoords))
local statusBar = _G[frameName .. "Timer"]
E:StripTextures(statusBar)
E:CreateBackdrop(statusBar, "Default")
statusBar:SetStatusBarTexture(E["media"].normTex)
E:RegisterStatusBar(statusBar)
local decoration = _G[frameName .. "Decoration"]
decoration:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon")
-- decoration:Size(130)
decoration:SetWidth(130)
decoration:SetHeight(130)
decoration:SetPoint("TOPLEFT", -37, 20)
local pass = _G[frameName .. "PassButton"]
S:HandleCloseButton(pass, frame)
HookScript(_G["GroupLootFrame" .. i], "OnShow", OnShow)
end
end
S:AddCallback("Loot", LoadSkin)
S:AddCallback("LootRoll", LoadRollSkin)
@@ -0,0 +1,100 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local getn = table.getn
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.macro ~= true then return end
E:StripTextures(MacroFrame)
E:CreateBackdrop(MacroFrame, "Transparent")
MacroFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
MacroFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 71)
MacroFrame.bg = CreateFrame("Frame", nil, MacroFrame)
E:SetTemplate(MacroFrame.bg, "Transparent", true)
MacroFrame.bg:SetPoint("TOPLEFT", MacroButton1, -10, 10)
MacroFrame.bg:SetPoint("BOTTOMRIGHT", MacroButton18, 10, -10)
E:StripTextures(MacroFrameTextBackground)
E:CreateBackdrop(MacroFrameTextBackground, "Default")
MacroFrameTextBackground.backdrop:SetPoint("TOPLEFT", 6, -3)
MacroFrameTextBackground.backdrop:SetPoint("BOTTOMRIGHT", -2, 3)
local Buttons = {
"MacroFrameTab1",
"MacroFrameTab2",
"MacroDeleteButton",
"MacroNewButton",
"MacroExitButton",
"MacroEditButton",
"MacroPopupOkayButton",
"MacroPopupCancelButton"
}
for i = 1, getn(Buttons) do
E:StripTextures(_G[Buttons[i]])
S:HandleButton(_G[Buttons[i]])
end
for i = 1, 2 do
local tab = _G["MacroFrameTab" .. i]
tab:SetHeight(22)
end
MacroFrameTab1:SetPoint("TOPLEFT", MacroFrame, "TOPLEFT", 85, -39)
MacroFrameTab2:SetPoint("LEFT", MacroFrameTab1, "RIGHT", 4, 0)
S:HandleCloseButton(MacroFrameCloseButton)
S:HandleScrollBar(MacroFrameScrollFrameScrollBar)
S:HandleScrollBar(MacroPopupScrollFrameScrollBar)
MacroEditButton:ClearAllPoints()
MacroEditButton:SetPoint("BOTTOMLEFT", MacroFrameSelectedMacroButton, "BOTTOMRIGHT", 10, 0)
MacroFrameSelectedMacroName:SetPoint("TOPLEFT", MacroFrameSelectedMacroBackground, "TOPRIGHT", -4, -10)
E:StripTextures(MacroFrameSelectedMacroButton)
E:SetTemplate(MacroFrameSelectedMacroButton, "Transparent")
E:StyleButton(MacroFrameSelectedMacroButton, true)
MacroFrameSelectedMacroButton:GetNormalTexture():SetTexture(nil)
MacroFrameSelectedMacroButtonIcon:SetTexCoord(unpack(E.TexCoords))
E:SetInside(MacroFrameSelectedMacroButtonIcon)
MacroFrameCharLimitText:ClearAllPoints()
MacroFrameCharLimitText:SetPoint("BOTTOM", MacroFrameTextBackground, 0, -9)
for i = 1, MAX_MACROS do
local Button = _G["MacroButton"..i]
local ButtonIcon = _G["MacroButton"..i.."Icon"]
if Button then
E:StripTextures(Button)
E:SetTemplate(Button, "Default", true)
E:StyleButton(Button, nil, true)
end
if ButtonIcon then
ButtonIcon:SetTexCoord(unpack(E.TexCoords))
E:SetInside(ButtonIcon)
end
end
S:HandleIconSelectionFrame(MacroPopupFrame, NUM_MACRO_ICONS_SHOWN, "MacroPopupButton", "MacroPopup")
E:CreateBackdrop(MacroPopupScrollFrame, "Transparent")
MacroPopupScrollFrame.backdrop:SetPoint("TOPLEFT", 51, 2)
MacroPopupScrollFrame.backdrop:SetPoint("BOTTOMRIGHT", 0, 4)
MacroPopupFrame:SetPoint("TOPLEFT", MacroFrame, "TOPRIGHT", -41, 1)
end
S:AddCallbackForAddon("Blizzard_MacroUI", "Macro", LoadSkin)
@@ -0,0 +1,231 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack, select = unpack, select
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local GetInboxItem = GetInboxItem
local GetItemInfo = GetItemInfo
local GetItemQualityColor = GetItemQualityColor
local GetSendMailItem = GetSendMailItem
local INBOXITEMS_TO_DISPLAY = INBOXITEMS_TO_DISPLAY
local ATTACHMENTS_MAX_RECEIVE = ATTACHMENTS_MAX_RECEIVE
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.mail ~= true then return end
-- Inbox Frame
E:StripTextures(MailFrame, true)
E:CreateBackdrop(MailFrame, "Transparent")
MailFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
MailFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 74)
for i = 1, INBOXITEMS_TO_DISPLAY do
local mail = _G["MailItem"..i]
local button = _G["MailItem"..i.."Button"]
local icon = _G["MailItem"..i.."ButtonIcon"]
E:StripTextures(mail)
E:CreateBackdrop(mail, "Default")
mail.backdrop:SetPoint("TOPLEFT", 2, 1)
mail.backdrop:SetPoint("BOTTOMRIGHT", -2, 2)
E:StripTextures(button)
E:SetTemplate(button, "Default", true)
E:StyleButton(button)
icon:SetTexCoord(unpack(E.TexCoords))
E:SetInside(icon)
end
hooksecurefunc("InboxFrame_Update", function()
local numItems = GetInboxNumItems()
local index = ((InboxFrame.pageNum - 1) * INBOXITEMS_TO_DISPLAY) + 1
for i = 1, INBOXITEMS_TO_DISPLAY do
if index <= numItems then
local packageIcon, _, _, _, _, _, _, _, _, _, _, _, isGM = GetInboxHeaderInfo(index)
local button = _G["MailItem"..i.."Button"]
button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
if packageIcon and not isGM then
local ItemLink = GetInboxItemLink(index, 1)
if ItemLink then
local quality = select(3, GetItemInfo(ItemLink))
if quality and quality > 1 then
button:SetBackdropBorderColor(GetItemQualityColor(quality))
else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end
elseif isGM then
button:SetBackdropBorderColor(0, 0.56, 0.94)
end
end
index = index + 1
end
end)
S:HandleNextPrevButton(InboxPrevPageButton)
S:HandleNextPrevButton(InboxNextPageButton)
S:HandleCloseButton(InboxCloseButton)
for i = 1, 2 do
local tab = _G["MailFrameTab"..i]
E:StripTextures(tab)
S:HandleTab(tab)
end
-- Send Mail Frame
E:StripTextures(SendMailFrame)
E:StripTextures(SendMailScrollFrame, true)
E:SetTemplate(SendMailScrollFrame, "Default")
-- hooksecurefunc("SendMailFrame_Update", function()
-- for i = 1, ATTACHMENTS_MAX_SEND do
-- local button = _G["SendMailAttachment"..i]
-- local texture = button:GetNormalTexture()
-- local itemName = GetSendMailItem(i)
-- if not button.skinned then
-- E:StripTextures(button)
-- E:SetTemplate(button, "Default", true)
-- E:StyleButton(button, nil, true)
-- button.skinned = true
-- end
-- if itemName then
-- local quality = select(3, GetItemInfo(itemName))
-- if quality and quality > 1 then
-- button:SetBackdropBorderColor(GetItemQualityColor(quality))
-- else
-- button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
-- end
-- texture:SetTexCoord(unpack(E.TexCoords))
-- E:SetInside(texture)
-- else
-- button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
-- end
-- end
-- end)
SendMailBodyEditBox:SetTextColor(1, 1, 1)
S:HandleScrollBar(SendMailScrollFrameScrollBar)
S:HandleEditBox(SendMailNameEditBox)
SendMailNameEditBox.backdrop:SetPoint("BOTTOMRIGHT", 2, 0)
SendMailNameEditBox:SetPoint("TOPLEFT", 79, -46)
S:HandleEditBox(SendMailSubjectEditBox)
SendMailSubjectEditBox.backdrop:SetPoint("BOTTOMRIGHT", 2, 0)
S:HandleEditBox(SendMailMoneyGold)
S:HandleEditBox(SendMailMoneySilver)
S:HandleEditBox(SendMailMoneyCopper)
S:HandleButton(SendMailMailButton)
SendMailMailButton:SetPoint("RIGHT", SendMailCancelButton, "LEFT", -2, 0)
S:HandleButton(SendMailCancelButton)
SendMailCancelButton:SetPoint("BOTTOMRIGHT", -45, 80)
SendMailMoneyFrame:SetPoint("BOTTOMLEFT", 170, 84)
-- Open Mail Frame
E:StripTextures(OpenMailFrame, true)
E:CreateBackdrop(OpenMailFrame, "Transparent")
OpenMailFrame.backdrop:SetPoint("TOPLEFT", 12, -12)
OpenMailFrame.backdrop:SetPoint("BOTTOMRIGHT", -34, 74)
-- for i = 1, 12 do
-- local button = _G["OpenMailAttachmentButton"..i]
-- local icon = _G["OpenMailAttachmentButton"..i.."IconTexture"]
-- local count = _G["OpenMailAttachmentButton"..i.."Count"]
-- E:StripTextures(button)
-- E:SetTemplate(button, "Default", true)
-- E:StyleButton(button)
-- if icon then
-- icon:SetTexCoord(unpack(E.TexCoords))
-- icon:SetDrawLayer("ARTWORK")
-- E:SetInside(icon)
-- count:SetDrawLayer("OVERLAY")
-- end
-- end
-- hooksecurefunc("OpenMailFrame_UpdateButtonPositions", function()
-- for i = 1, ATTACHMENTS_MAX_RECEIVE do
-- local ItemLink = GetInboxItemLink(InboxFrame.openMailID, i)
-- local button = _G["OpenMailAttachmentButton"..i]
-- button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
-- if ItemLink then
-- local quality = select(3, GetItemInfo(ItemLink))
-- if quality and quality > 1 then
-- button:SetBackdropBorderColor(GetItemQualityColor(quality))
-- else
-- button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
-- end
-- end
-- end
-- end)
S:HandleCloseButton(OpenMailCloseButton)
S:HandleButton(OpenMailReplyButton)
OpenMailReplyButton:SetPoint("RIGHT", OpenMailDeleteButton, "LEFT", -2, 0)
S:HandleButton(OpenMailDeleteButton)
OpenMailDeleteButton:SetPoint("RIGHT", OpenMailCancelButton, "LEFT", -2, 0)
S:HandleButton(OpenMailCancelButton)
E:StripTextures(OpenMailScrollFrame, true)
E:SetTemplate(OpenMailScrollFrame, "Default")
S:HandleScrollBar(OpenMailScrollFrameScrollBar)
OpenMailBodyText:SetTextColor(1, 1, 1)
InvoiceTextFontNormal:SetTextColor(1, 1, 1)
OpenMailInvoiceBuyMode:SetTextColor(1, 0.80, 0.10)
E:Kill(OpenMailArithmeticLine)
E:StripTextures(OpenMailLetterButton)
E:SetTemplate(OpenMailLetterButton, "Default", true)
E:StyleButton(OpenMailLetterButton)
OpenMailLetterButtonIconTexture:SetTexCoord(unpack(E.TexCoords))
OpenMailLetterButtonIconTexture:SetDrawLayer("ARTWORK")
E:SetInside(OpenMailLetterButtonIconTexture)
OpenMailLetterButtonCount:SetDrawLayer("OVERLAY")
E:StripTextures(OpenMailMoneyButton)
E:SetTemplate(OpenMailMoneyButton, "Default", true)
E:StyleButton(OpenMailMoneyButton)
OpenMailMoneyButtonIconTexture:SetTexCoord(unpack(E.TexCoords))
OpenMailMoneyButtonIconTexture:SetDrawLayer("ARTWORK")
E:SetInside(OpenMailMoneyButtonIconTexture)
OpenMailMoneyButtonCount:SetDrawLayer("OVERLAY")
end
S:AddCallback("Mail", LoadSkin)
@@ -0,0 +1,137 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local select = select
local unpack = unpack
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.merchant ~= true then return end
E:StripTextures(MerchantFrame, true)
E:CreateBackdrop(MerchantFrame, "Transparent")
MerchantFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
MerchantFrame.backdrop:SetPoint("BOTTOMRIGHT", -28, 60)
S:HandleCloseButton(MerchantFrameCloseButton, MerchantFrame.backdrop)
for i = 1, 12 do
local item = _G["MerchantItem" .. i]
local itemButton = _G["MerchantItem" .. i .. "ItemButton"]
local iconTexture = _G["MerchantItem" .. i .. "ItemButtonIconTexture"]
local altCurrencyTex1 = _G["MerchantItem" .. i .. "AltCurrencyFrameItem1Texture"]
local altCurrencyTex2 = _G["MerchantItem" .. i .. "AltCurrencyFrameItem2Texture"]
E:StripTextures(item, true)
E:CreateBackdrop(item, "Default")
E:StripTextures(itemButton)
E:StyleButton(itemButton)
E:SetTemplate(itemButton, "Default", true)
itemButton:SetPoint("TOPLEFT", item, "TOPLEFT", 4, -4)
iconTexture:SetTexCoord(unpack(E.TexCoords))
E:SetInside(iconTexture)
-- altCurrencyTex1:SetTexCoord(unpack(E.TexCoords))
-- altCurrencyTex2:SetTexCoord(unpack(E.TexCoords))
_G["MerchantItem" .. i .. "MoneyFrame"]:ClearAllPoints()
_G["MerchantItem" .. i .. "MoneyFrame"]:SetPoint("BOTTOMLEFT", itemButton, "BOTTOMRIGHT", 3, 0)
end
S:HandleNextPrevButton(MerchantNextPageButton)
S:HandleNextPrevButton(MerchantPrevPageButton)
E:StyleButton(MerchantRepairItemButton)
E:SetTemplate(MerchantRepairItemButton, "Default", true)
for i = 1, MerchantRepairItemButton:GetNumRegions() do
local region = select(i, MerchantRepairItemButton:GetRegions())
if(region:GetObjectType() == "Texture") then
region:SetTexCoord(0.04, 0.24, 0.06, 0.5)
E:SetInside(region)
end
end
E:StyleButton(MerchantRepairAllButton)
E:SetTemplate(MerchantRepairAllButton, "Default", true)
MerchantRepairAllIcon:SetTexCoord(0.34, 0.1, 0.34, 0.535, 0.535, 0.1, 0.535, 0.535)
E:SetInside(MerchantRepairAllIcon)
E:StripTextures(MerchantBuyBackItem, true)
E:CreateBackdrop(MerchantBuyBackItem, "Transparent")
MerchantBuyBackItem.backdrop:SetPoint("TOPLEFT", -6, 6)
MerchantBuyBackItem.backdrop:SetPoint("BOTTOMRIGHT", 6, -6)
E:StripTextures(MerchantBuyBackItemItemButton)
E:StyleButton(MerchantBuyBackItemItemButton)
E:SetTemplate(MerchantBuyBackItemItemButton, "Default", true)
MerchantBuyBackItemItemButtonIconTexture:SetTexCoord(unpack(E.TexCoords))
E:SetInside(MerchantBuyBackItemItemButtonIconTexture)
for i = 1, 2 do
S:HandleTab(_G["MerchantFrameTab" .. i])
end
hooksecurefunc("MerchantFrame_UpdateMerchantInfo", function()
local numMerchantItems = GetMerchantNumItems()
local index
local itemButton, itemName, itemLink
for i = 1, BUYBACK_ITEMS_PER_PAGE do
index = (((MerchantFrame.page - 1) * MERCHANT_ITEMS_PER_PAGE) + i)
itemButton = _G["MerchantItem" .. i .. "ItemButton"]
itemName = _G["MerchantItem" .. i .. "Name"]
if(index <= numMerchantItems) then
itemLink = GetMerchantItemLink(index)
if(itemLink) then
for id in string.gfind(itemLink, "item:(%d+)") do
itemLink = id
end
local _, _, quality = GetItemInfo(itemLink)
local r, g, b = GetItemQualityColor(quality)
itemName:SetTextColor(r, g, b)
if quality then
itemButton:SetBackdropBorderColor(r, g, b)
else
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end
end
local buybackName, _, _, buybackQuantity = GetBuybackItemInfo(GetNumBuybackItems())
if buybackName and buybackQuantity then
local r, g, b = GetItemQualityColor(buybackQuantity)
MerchantBuyBackItemName:SetTextColor(r, g, b)
MerchantBuyBackItemItemButton:SetBackdropBorderColor(r, g, b)
else
MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end
end)
hooksecurefunc("MerchantFrame_UpdateBuybackInfo", function()
local numBuybackItems = GetNumBuybackItems()
local itemButton, itemName
for i = 1, BUYBACK_ITEMS_PER_PAGE do
itemButton = _G["MerchantItem" .. i .. "ItemButton"]
itemName = _G["MerchantItem" .. i .. "Name"]
if i <= numBuybackItems then
local buybackName, _, _, buybackQuantity = GetBuybackItemInfo(i)
if buybackName and buybackQuantity then
local r, g, b = GetItemQualityColor(buybackQuantity)
itemName:SetTextColor(r, g, b)
itemButton:SetBackdropBorderColor(r, g, b)
end
end
end
end)
end
S:AddCallback("Merchant", LoadSkin)
@@ -0,0 +1,64 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local format = format
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.mirrorTimers ~= true then return end
local function MirrorTimerFrame_OnUpdate(frame, elapsed)
if (frame.paused) then
return
end
if frame.timeSinceUpdate >= 0.3 then
local minutes = frame.value / 60
local seconds = math.mod(frame.value, 60)
local text = frame.label:GetText()
if frame.value > 0 then
frame.TimerText:SetText(format("%s (%d:%02d)", text, minutes, seconds))
else
frame.TimerText:SetText(format("%s (0:00)", text))
end
frame.timeSinceUpdate = 0
else
frame.timeSinceUpdate = frame.timeSinceUpdate + elapsed
end
end
for i = 1, MIRRORTIMER_NUMTIMERS do
local mirrorTimer = _G["MirrorTimer" .. i]
local statusBar = _G["MirrorTimer" .. i .. "StatusBar"]
local text = _G["MirrorTimer" .. i .. "Text"]
E:StripTextures(mirrorTimer)
-- mirrorTimer:Size(222, 18)
mirrorTimer:SetWidth(222)
mirrorTimer:SetHeight(18)
mirrorTimer.label = text
statusBar:SetStatusBarTexture(E["media"].normTex)
E:RegisterStatusBar(statusBar)
E:CreateBackdrop(statusBar)
-- statusBar:Size(222, 18)
statusBar:SetWidth(222)
statusBar:SetHeight(18)
text:Hide()
local TimerText = mirrorTimer:CreateFontString(nil, "OVERLAY")
E:FontTemplate(TimerText)
TimerText:SetPoint("CENTER", statusBar, "CENTER", 0, 0)
mirrorTimer.TimerText = TimerText
mirrorTimer.timeSinceUpdate = 0.3
HookScript(mirrorTimer, "OnUpdate", MirrorTimerFrame_OnUpdate)
E:CreateMover(mirrorTimer, "MirrorTimer" .. i .. "Mover", L["MirrorTimer"] .. i, nil, nil, nil, "ALL,SOLO")
end
end
S:AddCallback("MirrorTimers", LoadSkin)
@@ -0,0 +1,449 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local find = string.find
local getn = table.getn
--WoW API / Variables
local UnitIsUnit = UnitIsUnit
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.misc ~= true then return end
-- Blizzard frame we want to reskin
local skins = {
"GameMenuFrame",
"UIOptionsFrame",
"OptionsFrame",
"OptionsFrameDisplay",
"OptionsFrameBrightness",
"OptionsFrameWorldAppearance",
"OptionsFramePixelShaders",
"OptionsFrameMiscellaneous",
"SoundOptionsFrame",
"TicketStatusFrame",
"StackSplitFrame",
"DropDownList1MenuBackdrop",
"DropDownList2MenuBackdrop",
"DropDownList1Backdrop",
"DropDownList2Backdrop",
}
for i = 1, getn(skins) do
E:SetTemplate(_G[skins[i]], "Transparent")
end
local r, g, b = 0.8, 0.8, 0.8
local function StyleButton(f)
local width, height = (f:GetWidth() * .6), f:GetHeight()
local leftGrad = f:CreateTexture(nil, "HIGHLIGHT")
-- leftGrad:Size(width, height)
leftGrad:SetWidth(width)
leftGrad:SetHeight(height)
leftGrad:SetPoint("LEFT", f, "CENTER")
leftGrad:SetTexture(E.media.blankTex)
leftGrad:SetGradientAlpha("Horizontal", r, g, b, 0.35, r, g, b, 0)
local rightGrad = f:CreateTexture(nil, "HIGHLIGHT")
-- rightGrad:Size(width, height)
rightGrad:SetWidth(width)
rightGrad:SetHeight(height)
rightGrad:SetPoint("RIGHT", f, "CENTER")
rightGrad:SetTexture(E.media.blankTex)
rightGrad:SetGradientAlpha("Horizontal", r, g, b, 0, r, g, b, 0.35)
end
-- Static Popups
for i = 1, STATICPOPUP_NUMDIALOGS do
local staticPopup = _G["StaticPopup"..i]
local itemFrameBox = _G["StaticPopup"..i.."EditBox"]
local closeButton = _G["StaticPopup"..i.."CloseButton"]
local wideBox = _G["StaticPopup"..i.."WideEditBox"]
E:SetTemplate(staticPopup, "Transparent")
S:HandleEditBox(itemFrameBox)
itemFrameBox.backdrop:SetPoint("TOPLEFT", -2, -4)
itemFrameBox.backdrop:SetPoint("BOTTOMRIGHT", 2, 4)
for k = 1, itemFrameBox:GetNumRegions() do
local region = select(k, itemFrameBox:GetRegions())
if(region and region:GetObjectType() == "Texture") then
if region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right" then
E:Kill(region)
end
end
end
E:StripTextures(closeButton)
S:HandleCloseButton(closeButton)
select(8, wideBox:GetRegions()):Hide()
S:HandleEditBox(wideBox)
wideBox:SetHeight(22)
for j = 1, 2 do
S:HandleButton(_G["StaticPopup"..i.."Button"..j])
end
end
-- reskin all esc/menu buttons
local BlizzardMenuButtons = {
"Options",
"SoundOptions",
"UIOptions",
"Keybindings",
"Macros",
"Logout",
"Quit",
"Continue",
}
for i = 1, getn(BlizzardMenuButtons) do
local ElvuiMenuButtons = _G["GameMenuButton"..BlizzardMenuButtons[i]]
if ElvuiMenuButtons then
S:HandleButton(ElvuiMenuButtons)
end
end
-- hide header textures and move text/buttons.
local BlizzardHeader = {
"GameMenuFrame",
"UIOptionsFrame",
"SoundOptionsFrame",
"OptionsFrame",
}
for i = 1, getn(BlizzardHeader) do
local title = _G[BlizzardHeader[i].."Header"]
if title then
title:SetTexture("")
title:ClearAllPoints()
if title == _G["GameMenuFrameHeader"] then
title:SetPoint("TOP", GameMenuFrame, 0, 7)
else
title:SetPoint("TOP", BlizzardHeader[i], 0, 0)
end
end
end
-- here we reskin all "normal" buttons
local BlizzardButtons = {
"OptionsFrameOkay",
"OptionsFrameCancel",
"OptionsFrameDefaults",
"SoundOptionsFrameOkay",
"SoundOptionsFrameCancel",
"SoundOptionsFrameDefaults",
"UIOptionsFrameDefaults",
"UIOptionsFrameOkay",
"UIOptionsFrameCancel",
"ReadyCheckFrameYesButton",
"ReadyCheckFrameNoButton",
"StackSplitOkayButton",
"StackSplitCancelButton",
"RolePollPopupAcceptButton"
}
for i = 1, getn(BlizzardButtons) do
local ElvuiButtons = _G[BlizzardButtons[i]]
if ElvuiButtons then
S:HandleButton(ElvuiButtons)
end
end
-- if a button position is not really where we want, we move it here
OptionsFrameCancel:ClearAllPoints()
OptionsFrameCancel:SetPoint("BOTTOMLEFT",OptionsFrame,"BOTTOMRIGHT",-105,15)
OptionsFrameOkay:ClearAllPoints()
OptionsFrameOkay:SetPoint("RIGHT",OptionsFrameCancel,"LEFT",-4,0)
SoundOptionsFrameOkay:ClearAllPoints()
SoundOptionsFrameOkay:SetPoint("RIGHT",SoundOptionsFrameCancel,"LEFT",-4,0)
UIOptionsFrameOkay:ClearAllPoints()
UIOptionsFrameOkay:SetPoint("RIGHT",UIOptionsFrameCancel,"LEFT", -4,0)
-- ReadyCheckFrameYesButton:SetPoint("RIGHT", ReadyCheckFrame, "CENTER", -1, 0)
-- ReadyCheckFrameNoButton:SetPoint("LEFT", ReadyCheckFrameYesButton, "RIGHT", 3, 0)
-- ReadyCheckFrameText:SetPoint("TOP", ReadyCheckFrame, "TOP", 0, -18)
-- others
ZoneTextFrame:ClearAllPoints()
ZoneTextFrame:SetPoint("TOP", UIParent, 0, -128)
E:StripTextures(CoinPickupFrame)
E:SetTemplate(CoinPickupFrame, "Transparent")
S:HandleButton(CoinPickupOkayButton)
S:HandleButton(CoinPickupCancelButton)
-- ReadyCheckFrame:HookScript("OnShow", function(self) if UnitIsUnit("player", self.initiator) then self:Hide() end end) -- bug fix, don't show it if initiator
StackSplitFrame:GetRegions():Hide()
-- Declension frame
if GetLocale() == "ruRU" then
DeclensionFrame:SetTemplate("Transparent")
S:HandleNextPrevButton(DeclensionFrameSetPrev)
S:HandleNextPrevButton(DeclensionFrameSetNext)
S:HandleButton(DeclensionFrameOkayButton)
S:HandleButton(DeclensionFrameCancelButton)
for i = 1, RUSSIAN_DECLENSION_PATTERNS do
local editBox = _G["DeclensionFrameDeclension"..i.."Edit"]
if editBox then
E:StripTextures(editBox)
S:HandleEditBox(editBox)
end
end
end
-- mac menu/option panel, made by affli.
if IsMacClient() then
S:HandleButton(GameMenuButtonMacOptions)
-- Skin main frame and reposition the header
MacOptionsFrame:SetTemplate("Default", true)
MacOptionsFrameHeader:SetTexture("")
MacOptionsFrameHeader:ClearAllPoints()
MacOptionsFrameHeader:SetPoint("TOP", MacOptionsFrame, 0, 0)
S:HandleDropDownBox(MacOptionsFrameResolutionDropDown)
S:HandleDropDownBox(MacOptionsFrameFramerateDropDown)
S:HandleDropDownBox(MacOptionsFrameCodecDropDown)
S:HandleSliderFrame(MacOptionsFrameQualitySlider)
for i = 1, 8 do
S:HandleCheckBox(_G["MacOptionsFrameCheckButton"..i])
end
--Skin internal frames
MacOptionsFrameMovieRecording:SetTemplate("Default", true)
MacOptionsITunesRemote:SetTemplate("Default", true)
--Skin buttons
S:HandleButton(MacOptionsFrameCancel)
S:HandleButton(MacOptionsFrameOkay)
S:HandleButton(MacOptionsButtonKeybindings)
S:HandleButton(MacOptionsFrameDefaults)
S:HandleButton(MacOptionsButtonCompress)
--Reposition and resize buttons
local tPoint, tRTo, tRP, _, tY = MacOptionsButtonCompress:GetPoint()
MacOptionsButtonCompress:SetWidth(136)
MacOptionsButtonCompress:ClearAllPoints()
MacOptionsButtonCompress:SetPoint(tPoint, tRTo, tRP, 4, tY)
MacOptionsFrameCancel:SetWidth(96)
MacOptionsFrameCancel:SetHeight(22)
tPoint, tRTo, tRP, _, tY = MacOptionsFrameCancel:GetPoint()
MacOptionsFrameCancel:ClearAllPoints()
MacOptionsFrameCancel:SetPoint(tPoint, tRTo, tRP, -14, tY)
MacOptionsFrameOkay:ClearAllPoints()
MacOptionsFrameOkay:SetWidth(96)
MacOptionsFrameOkay:SetHeight(22)
MacOptionsFrameOkay:SetPoint("LEFT",MacOptionsFrameCancel, -99,0)
MacOptionsButtonKeybindings:ClearAllPoints()
MacOptionsButtonKeybindings:SetWidth(96)
MacOptionsButtonKeybindings:SetHeight(22)
MacOptionsButtonKeybindings:SetPoint("LEFT",MacOptionsFrameOkay, -99,0)
MacOptionsFrameDefaults:SetWidth(96)
MacOptionsFrameDefaults:SetHeight(22)
MacOptionsCompressFrame:SetTemplate("Default", true)
MacOptionsCompressFrameHeader:SetTexture("")
MacOptionsCompressFrameHeader:ClearAllPoints()
MacOptionsCompressFrameHeader:SetPoint("TOP", MacOptionsCompressFrame, 0, 0)
S:HandleButton(MacOptionsCompressFrameDelete)
S:HandleButton(MacOptionsCompressFrameSkip)
S:HandleButton(MacOptionsCompressFrameCompress)
MacOptionsCancelFrame:SetTemplate("Default", true)
MacOptionsCancelFrameHeader:SetTexture("")
MacOptionsCancelFrameHeader:ClearAllPoints()
MacOptionsCancelFrameHeader:SetPoint("TOP", MacOptionsCancelFrame, 0, 0)
S:HandleButton(MacOptionsCancelFrameNo)
S:HandleButton(MacOptionsCancelFrameYes)
end
if GetLocale() == "koKR" then
S:HandleButton(GameMenuButtonRatings)
RatingMenuFrame:SetTemplate("Transparent")
RatingMenuFrameHeader:Kill()
S:HandleButton(RatingMenuButtonOkay)
end
E:StripTextures(OpacityFrame)
E:SetTemplate(OpacityFrame, "Transparent")
S:HandleSliderFrame(OpacityFrameSlider)
--DROPDOWN MENU
hooksecurefunc("UIDropDownMenu_Initialize", function()
for i = 1, UIDROPDOWNMENU_MAXLEVELS do
E:SetTemplate(_G["DropDownList"..i.."Backdrop"], "Transparent")
E:SetTemplate(_G["DropDownList"..i.."MenuBackdrop"], "Transparent")
for j = 1, UIDROPDOWNMENU_MAXBUTTONS do
_G["DropDownList"..i.."Button"..j]:SetFrameLevel(_G["DropDownList"..i.."Backdrop"]:GetFrameLevel() + 1)
_G["DropDownList"..i.."Button"..j.."Highlight"]:SetTexture(1, 1, 1, 0.3)
end
end
end)
-- Interface Options
UIOptionsFrame:SetScript("OnShow", function()
UIOptionsFrame_Load()
E:Kill(UIOptionsBlackground)
E:StripTextures(UIOptionsFrame, true)
UIOptionsFrame:EnableMouse(0)
UIOptionsFrame:SetScale(UIParent:GetScale())
end)
local UIOptions = {
"BasicOptions",
"BasicOptionsGeneral",
"BasicOptionsDisplay",
"BasicOptionsCamera",
"BasicOptionsHelp",
"AdvancedOptions",
"AdvancedOptionsActionBars",
"AdvancedOptionsChat",
"AdvancedOptionsRaid",
"AdvancedOptionsCombatText",
}
for i = 1, getn(UIOptions) do
local options = _G[UIOptions[i]]
if options then
E:SetTemplate(options, "Transparent")
end
end
local interfacetab = {
"UIOptionsFrameTab1",
"UIOptionsFrameTab2",
}
for i = 1, getn(interfacetab) do
local itab = _G[interfacetab[i]]
if itab then
E:StripTextures(itab)
S:HandleTab(itab)
E:SetTemplate(itab.backdrop, "Transparent")
itab.backdrop:SetPoint("TOPLEFT", 10, E.PixelMode and -4 or -6)
itab.backdrop:SetPoint("BOTTOMRIGHT", -10, E.PixelMode and -4 or -6)
end
end
OptionsFrameDefaults:ClearAllPoints()
OptionsFrameDefaults:SetPoint("TOPLEFT", OptionsFrame, "BOTTOMLEFT", 15, 36)
for i = 1, 69 do
local UIOptionsFrameCheckBox = _G["UIOptionsFrameCheckButton"..i]
if UIOptionsFrameCheckBox then
S:HandleCheckBox(UIOptionsFrameCheckBox)
end
end
local interfacedropdown ={
"CombatTextDropDown",
"TargetofTargetDropDown",
"CameraDropDown",
"ClickCameraDropDown"
}
for i = 1, getn(interfacedropdown) do
local idropdown = _G["UIOptionsFrame"..interfacedropdown[i]]
if idropdown then
S:HandleDropDownBox(idropdown)
end
end
S:HandleButton(UIOptionsFrameResetTutorials)
local optioncheckbox = {
"OptionsFrameCheckButton1",
"OptionsFrameCheckButton2",
"OptionsFrameCheckButton3",
"OptionsFrameCheckButton4",
"OptionsFrameCheckButton5",
"OptionsFrameCheckButton6",
"OptionsFrameCheckButton7",
"OptionsFrameCheckButton8",
"OptionsFrameCheckButton9",
"OptionsFrameCheckButton10",
"OptionsFrameCheckButton11",
"OptionsFrameCheckButton12",
"OptionsFrameCheckButton13",
"OptionsFrameCheckButton14",
"OptionsFrameCheckButton15",
"OptionsFrameCheckButton16",
"OptionsFrameCheckButton17",
"OptionsFrameCheckButton18",
"OptionsFrameCheckButton19",
"SoundOptionsFrameCheckButton1",
"SoundOptionsFrameCheckButton2",
"SoundOptionsFrameCheckButton3",
"SoundOptionsFrameCheckButton4",
"SoundOptionsFrameCheckButton5",
"SoundOptionsFrameCheckButton6",
"SoundOptionsFrameCheckButton7",
"SoundOptionsFrameCheckButton8",
"SoundOptionsFrameCheckButton9",
"SoundOptionsFrameCheckButton10",
"SoundOptionsFrameCheckButton11"
}
for i = 1, getn(optioncheckbox) do
local ocheckbox = _G[optioncheckbox[i]]
if ocheckbox then
S:HandleCheckBox(ocheckbox)
end
end
SoundOptionsFrameCheckButton1:SetPoint("TOPLEFT", "SoundOptionsFrame", "TOPLEFT", 16, -15)
local optiondropdown = {
"OptionsFrameResolutionDropDown",
"OptionsFrameRefreshDropDown",
"OptionsFrameMultiSampleDropDown",
"SoundOptionsOutputDropDown",
}
for i = 1, getn(optiondropdown) do
local odropdown = _G[optiondropdown[i]]
if odropdown then
S:HandleDropDownBox(odropdown, i == 3 and 195 or 165)
end
end
for i = 1, 4 do
local UIOptionsFrameSlider = _G["UIOptionsFrameSlider"..i]
if UIOptionsFrameSlider then
S:HandleSliderFrame(UIOptionsFrameSlider)
end
end
-- Video Options Sliders
for i = 1, 9 do
S:HandleSliderFrame(_G["OptionsFrameSlider"..i])
end
-- Sound Options Sliders
for i = 1, 4 do
S:HandleSliderFrame(_G["SoundOptionsFrameSlider"..i])
end
end
S:AddCallback("SkinMisc", LoadSkin)
@@ -0,0 +1,39 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.petition ~= true then return end
E:StripTextures(PetitionFrame, true)
E:CreateBackdrop(PetitionFrame, "Transparent")
PetitionFrame.backdrop:SetPoint("TOPLEFT", 12, -17)
PetitionFrame.backdrop:SetPoint("BOTTOMRIGHT", -28, 65)
S:HandleButton(PetitionFrameSignButton)
S:HandleButton(PetitionFrameRequestButton)
S:HandleButton(PetitionFrameRenameButton)
S:HandleButton(PetitionFrameCancelButton)
S:HandleCloseButton(PetitionFrameCloseButton)
PetitionFrameCharterTitle:SetTextColor(1, 1, 0)
PetitionFrameCharterName:SetTextColor(1, 1, 1)
PetitionFrameMasterTitle:SetTextColor(1, 1, 0)
PetitionFrameMasterName:SetTextColor(1, 1, 1)
PetitionFrameMemberTitle:SetTextColor(1, 1, 0)
for i = 1, 9 do
_G["PetitionFrameMemberName" .. i]:SetTextColor(1, 1, 1)
end
PetitionFrameInstructions:SetTextColor(1, 1, 1)
PetitionFrameRenameButton:SetPoint("LEFT", PetitionFrameRequestButton, "RIGHT", 3, 0)
PetitionFrameRenameButton:SetPoint("RIGHT", PetitionFrameCancelButton, "LEFT", -3, 0)
end
S:AddCallback("Petition", LoadSkin)
@@ -0,0 +1,450 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local pairs = pairs
local unpack = unpack
local find = string.find
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.quest ~= true then return end
local QuestStrip = {
"QuestFrame",
"QuestLogFrame",
"EmptyQuestLogFrame",
"QuestFrameDetailPanel",
"QuestDetailScrollFrame",
"QuestDetailScrollChildFrame",
"QuestRewardScrollFrame",
"QuestRewardScrollChildFrame",
"QuestFrameProgressPanel",
"QuestFrameRewardPanel",
"QuestFrameRewardPanel"
}
for _, object in pairs(QuestStrip) do
E:StripTextures(_G[object], true)
end
local QuestButtons = {
"QuestLogFrameAbandonButton",
"QuestFrameExitButton",
"QuestFramePushQuestButton",
"QuestFrameCompleteButton",
"QuestFrameGoodbyeButton",
"QuestFrameCompleteQuestButton",
"QuestFrameCancelButton",
"QuestFrameGreetingGoodbyeButton",
"QuestFrameAcceptButton",
"QuestFrameDeclineButton"
}
for _, button in pairs(QuestButtons) do
E:StripTextures(_G[button])
S:HandleButton(_G[button])
end
for i = 1, MAX_NUM_ITEMS do
local item = _G["QuestLogItem" .. i]
local icon = _G["QuestLogItem" .. i .. "IconTexture"]
local count = _G["QuestLogItem" .. i .. "Count"]
E:StripTextures(item)
E:SetTemplate(item, "Default")
E:StyleButton(item)
item:SetWidth(item:GetWidth() - 4)
item:SetFrameLevel(item:GetFrameLevel() + 2)
icon:SetDrawLayer("OVERLAY")
-- icon:Size(icon:GetWidth() -(E.Spacing*2), icon:GetHeight() -(E.Spacing*2))
icon:SetWidth(icon:GetWidth() -(E.Spacing*2))
icon:SetHeight(icon:GetHeight() -(E.Spacing*2))
icon:SetPoint("TOPLEFT", E.Border, -E.Border)
S:HandleIcon(icon)
count:SetParent(item.backdrop)
count:SetDrawLayer("OVERLAY")
end
for i = 1, 6 do
local item = _G["QuestDetailItem" .. i]
local icon = _G["QuestDetailItem" .. i .. "IconTexture"]
local count = _G["QuestDetailItem" .. i .. "Count"]
E:StripTextures(item)
E:SetTemplate(item, "Default")
E:StyleButton(item)
item:SetWidth(item:GetWidth() - 4)
item:SetFrameLevel(item:GetFrameLevel() + 2)
icon:SetDrawLayer("OVERLAY")
-- icon:Size(icon:GetWidth() -(E.Spacing*2), icon:GetHeight() -(E.Spacing*2))
icon:SetWidth(icon:GetWidth() -(E.Spacing*2))
icon:SetHeight(icon:GetHeight() -(E.Spacing*2))
icon:SetPoint("TOPLEFT", E.Border, -E.Border)
S:HandleIcon(icon)
count:SetParent(item.backdrop)
count:SetDrawLayer("OVERLAY")
end
for i = 1, 6 do
local item = _G["QuestRewardItem" .. i]
local icon = _G["QuestRewardItem" .. i .. "IconTexture"]
local count = _G["QuestRewardItem" .. i .. "Count"]
E:StripTextures(item)
E:SetTemplate(item, "Default")
E:StyleButton(item)
item:SetWidth(item:GetWidth() - 4)
item:SetFrameLevel(item:GetFrameLevel() + 2)
icon:SetDrawLayer("OVERLAY")
-- icon:Size(icon:GetWidth() -(E.Spacing*2), icon:GetHeight() -(E.Spacing*2))
icon:SetWidth(icon:GetWidth() -(E.Spacing*2))
icon:SetHeight(icon:GetHeight() -(E.Spacing*2))
icon:SetPoint("TOPLEFT", E.Border, -E.Border)
S:HandleIcon(icon)
count:SetParent(item.backdrop)
count:SetDrawLayer("OVERLAY")
end
local function QuestQualityColors(frame, text, quality, link)
if link and not quality then
_, _, quality = GetItemInfo(link)
end
if quality and quality > 1 then
if frame then
frame:SetBackdropBorderColor(GetItemQualityColor(quality))
-- frame.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
end
text:SetTextColor(GetItemQualityColor(quality))
else
if frame then
frame:SetBackdropBorderColor(unpack(E["media"].bordercolor))
-- frame.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
text:SetTextColor(1, 1, 1)
end
end
E:StripTextures(QuestRewardItemHighlight)
E:SetTemplate(QuestRewardItemHighlight, "Default", nil, true)
QuestRewardItemHighlight:SetBackdropBorderColor(1, 1, 0)
QuestRewardItemHighlight:SetBackdropColor(0, 0, 0, 0)
-- QuestRewardItemHighlight:Size(142, 40)
QuestRewardItemHighlight:SetWidth(142)
QuestRewardItemHighlight:SetHeight(40)
hooksecurefunc("QuestRewardItem_OnClick", function()
QuestRewardItemHighlight:ClearAllPoints();
E:SetOutside(QuestRewardItemHighlight, this:GetName() .. "IconTexture")
_G[this:GetName() .. "Name"]:SetTextColor(1, 1, 0)
for i = 1, MAX_NUM_ITEMS do
local questItem = _G["QuestRewardItem" .. i]
local questName = _G["QuestRewardItem" .. i .. "Name"]
local link = questItem.type and GetQuestItemLink(questItem.type, questItem:GetID())
if questItem ~= this then
QuestQualityColors(nil, questName, nil, link)
end
end
end)
local function QuestObjectiveTextColor()
local numObjectives = GetNumQuestLeaderBoards()
local objective
local _, type, finished;
local numVisibleObjectives = 0
for i = 1, numObjectives do
_, type, finished = GetQuestLogLeaderBoard(i)
if type ~= "spell" then
numVisibleObjectives = numVisibleObjectives + 1
objective = _G["QuestLogObjective"..numVisibleObjectives]
if finished then
objective:SetTextColor(1, 0.80, 0.10)
else
objective:SetTextColor(0.6, 0.6, 0.6)
end
end
end
end
hooksecurefunc("QuestLog_UpdateQuestDetails", function()
local requiredMoney = GetQuestLogRequiredMoney()
if requiredMoney > 0 then
if requiredMoney > GetMoney() then
QuestLogRequiredMoneyText:SetTextColor(0.6, 0.6, 0.6)
else
QuestLogRequiredMoneyText:SetTextColor(1, 0.80, 0.10)
end
end
end)
hooksecurefunc("QuestFrameItems_Update", function(questState)
local titleTextColor = {1, 0.80, 0.10}
local textColor = {1, 1, 1}
QuestDetailObjectiveTitleText:SetTextColor(unpack(titleTextColor))
QuestDetailRewardTitleText:SetTextColor(unpack(titleTextColor))
QuestLogDescriptionTitle:SetTextColor(unpack(titleTextColor))
QuestLogQuestTitle:SetTextColor(unpack(titleTextColor))
QuestLogTitleText:SetTextColor(unpack(titleTextColor))
QuestLogRewardTitleText:SetTextColor(unpack(titleTextColor))
QuestRewardRewardTitleText:SetTextColor(unpack(titleTextColor))
QuestRewardTitleText:SetTextColor(unpack(titleTextColor))
QuestTitleText:SetTextColor(unpack(titleTextColor))
QuestTitleFont:SetTextColor(unpack(titleTextColor))
QuestTitleFont:SetFont("Fonts\\MORPHEUS.TTF", E.db.general.fontSize + 6)
QuestTitleFont.SetFont = E.noop
QuestDescription:SetTextColor(unpack(textColor))
QuestDetailItemReceiveText:SetTextColor(unpack(textColor))
QuestDetailSpellLearnText:SetTextColor(unpack(textColor))
QuestDetailItemChooseText:SetTextColor(unpack(textColor))
QuestFont:SetTextColor(unpack(textColor))
QuestFontNormalSmall:SetTextColor(unpack(textColor))
QuestLogObjectivesText:SetTextColor(unpack(textColor))
QuestLogQuestDescription:SetTextColor(unpack(textColor))
QuestLogItemChooseText:SetTextColor(unpack(textColor))
QuestLogItemReceiveText:SetTextColor(unpack(textColor))
QuestLogSpellLearnText:SetTextColor(unpack(textColor))
QuestObjectiveText:SetTextColor(unpack(textColor))
QuestRewardItemChooseText:SetTextColor(unpack(textColor))
QuestRewardItemReceiveText:SetTextColor(unpack(textColor))
QuestRewardSpellLearnText:SetTextColor(unpack(textColor))
QuestRewardText:SetTextColor(unpack(textColor))
QuestObjectiveTextColor()
local numQuestRewards, numQuestChoices
if questState == "QuestLog" then
numQuestRewards, numQuestChoices = GetNumQuestLogRewards(), GetNumQuestLogChoices()
else
numQuestRewards, numQuestChoices = GetNumQuestRewards(), GetNumQuestChoices()
end
local rewardsCount = numQuestChoices + numQuestRewards
if rewardsCount > 0 then
local questItem, itemName, link
local questItemName = questState.."Item"
for i = 1, rewardsCount do
questItem = _G[questItemName..i]
itemName = _G[questItemName..i.."Name"]
link = questItem.type and (questState == "QuestLog" and GetQuestLogItemLink or GetQuestItemLink)(questItem.type, questItem:GetID())
QuestQualityColors(questItem, itemName, nil, link)
end
end
end)
QuestLogTimerText:SetTextColor(1, 1, 1)
HookScript(QuestFrameGreetingPanel, "OnShow", function()
GreetingText:SetTextColor(1, 0.80, 0.10)
CurrentQuestsText:SetTextColor(1, 1, 1)
AvailableQuestsText:SetTextColor(1, 1, 1)
end)
E:CreateBackdrop(QuestFrame, "Transparent")
QuestFrame.backdrop:SetPoint("TOPLEFT", 15, -19)
QuestFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 67)
E:CreateBackdrop(QuestLogFrame, "Transparent")
QuestLogFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
QuestLogFrame.backdrop:SetPoint("BOTTOMRIGHT", -1, 8)
E:StripTextures(QuestLogListScrollFrame)
E:CreateBackdrop(QuestLogListScrollFrame, "Default", true)
QuestLogListScrollFrame:SetWidth(334)
E:StripTextures(QuestLogDetailScrollFrame)
E:CreateBackdrop(QuestLogDetailScrollFrame, "Default", true)
QuestLogDetailScrollFrame:SetWidth(334)
QuestLogDetailScrollFrame:SetHeight(296)
QuestLogDetailScrollFrame:ClearAllPoints()
QuestLogDetailScrollFrame:SetPoint("TOPRIGHT", QuestLogListScrollFrame, "BOTTOMRIGHT", 0, -6)
QuestLogNoQuestsText:ClearAllPoints()
QuestLogNoQuestsText:SetPoint("CENTER", EmptyQuestLogFrame, "CENTER", -45, 65)
QuestLogFrameAbandonButton:SetPoint("BOTTOMLEFT", 18, 15)
QuestLogFrameAbandonButton:SetWidth(126)
QuestFramePushQuestButton:ClearAllPoints()
QuestFramePushQuestButton:SetPoint("BOTTOM", QuestFrame, "BOTTOM", 18, 15)
QuestFramePushQuestButton:SetWidth(118)
QuestFrameExitButton:SetPoint("BOTTOMRIGHT", -8, 15)
QuestFrameExitButton:SetWidth(100)
S:HandleScrollBar(QuestLogDetailScrollFrameScrollBar)
S:HandleScrollBar(QuestDetailScrollFrameScrollBar)
S:HandleScrollBar(QuestLogListScrollFrameScrollBar)
S:HandleScrollBar(QuestProgressScrollFrameScrollBar)
S:HandleScrollBar(QuestRewardScrollFrameScrollBar)
S:HandleCloseButton(QuestFrameCloseButton)
S:HandleCloseButton(QuestLogFrameCloseButton)
QuestLogFrameCloseButton:ClearAllPoints()
QuestLogFrameCloseButton:SetPoint("TOPRIGHT", 2, -9)
QuestLogTrack:Hide()
local QuestTrack = CreateFrame("Button", "QuestTrack", QuestLogFrame, "UIPanelButtonTemplate")
S:HandleButton(QuestTrack)
QuestTrack:SetText(TRACK_QUEST)
QuestTrack:SetPoint("TOP", QuestLogFrame, "TOP", -64, -42)
-- QuestTrack:Size(110, 21)
QuestTrack:SetWidth(110)
QuestTrack:SetHeight(21)
HookScript(QuestTrack, "OnClick", function()
if IsQuestWatched(GetQuestLogSelection()) then
RemoveQuestWatch(GetQuestLogSelection())
QuestWatch_Update()
else
if GetNumQuestLeaderBoards(GetQuestLogSelection()) == 0 then
UIErrorsFrame:AddMessage(QUEST_WATCH_NO_OBJECTIVES, 1.0, 0.1, 0.1, 1.0)
return
end
if GetNumQuestWatches() >= MAX_WATCHABLE_QUESTS then
UIErrorsFrame:AddMessage(format(QUEST_WATCH_TOO_MANY, MAX_WATCHABLE_QUESTS), 1.0, 0.1, 0.1, 1.0)
return
end
AddQuestWatch(GetQuestLogSelection())
QuestLog_Update()
QuestWatch_Update()
end
QuestLog_Update()
end)
hooksecurefunc("QuestLog_Update", function()
local numEntries = GetNumQuestLogEntries()
if numEntries == 0 then
QuestTrack:Disable()
else
QuestTrack:Enable()
end
QuestLogListScrollFrame:Show()
end)
for i = 1, 6 do
local item = _G["QuestProgressItem" .. i]
local icon = _G["QuestProgressItem" .. i .. "IconTexture"]
local count = _G["QuestProgressItem" .. i .. "Count"]
E:StripTextures(item)
E:SetTemplate(item, "Default")
E:StyleButton(item)
item:SetWidth(item:GetWidth() - 4)
item:SetFrameLevel(item:GetFrameLevel() + 2)
icon:SetDrawLayer("OVERLAY")
-- icon:Size(icon:GetWidth() -(E.Spacing*2), icon:GetHeight() -(E.Spacing*2))
icon:SetWidth(icon:GetWidth() -(E.Spacing*2))
icon:SetHeight(icon:GetHeight() -(E.Spacing*2))
icon:SetPoint("TOPLEFT", E.Border, -E.Border)
S:HandleIcon(icon)
count:SetParent(item.backdrop)
count:SetDrawLayer("OVERLAY")
end
hooksecurefunc("QuestFrameProgressItems_Update", function()
QuestProgressTitleText:SetTextColor(1, 0.80, 0.10)
QuestProgressText:SetTextColor(1, 1, 1)
QuestProgressRequiredItemsText:SetTextColor(1, 0.80, 0.10)
if GetQuestMoneyToGet() > GetMoney() then
QuestProgressRequiredMoneyText:SetTextColor(0.6, 0.6, 0.6)
else
QuestProgressRequiredMoneyText:SetTextColor(1, 0.80, 0.10)
end
for i = 1, MAX_REQUIRED_ITEMS do
local item = _G["QuestProgressItem"..i]
local name = _G["QuestProgressItem"..i.."Name"]
local link = item.type and GetQuestItemLink(item.type, item:GetID())
QuestQualityColors(item, name, nil, link)
end
end)
-- QUESTS_DISPLAYED = 25
-- for i = 7, 25 do
-- local questLogTitle = CreateFrame("Button", "QuestLogTitle" .. i, QuestLogFrame, "QuestLogTitleButtonTemplate")
-- questLogTitle:SetID(i)
-- questLogTitle:Hide()
-- questLogTitle:SetPoint("TOPLEFT", _G["QuestLogTitle" .. i - 1], "BOTTOMLEFT", 0, 1)
-- end
for i = 1, QUESTS_DISPLAYED do
local questLogTitle = _G["QuestLogTitle" .. i]
questLogTitle:SetNormalTexture("")
questLogTitle.SetNormalTexture = E.noop
_G["QuestLogTitle" .. i .. "Highlight"]:SetTexture("")
_G["QuestLogTitle" .. i .. "Highlight"].SetTexture = E.noop
questLogTitle.Text = questLogTitle:CreateFontString(nil, "OVERLAY")
E:FontTemplate(questLogTitle.Text, nil, 22)
questLogTitle.Text:SetPoint("LEFT", 3, 0)
questLogTitle.Text:SetText("+")
hooksecurefunc(questLogTitle, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
self.Text:SetText("+")
else
self.Text:SetText("")
end
end)
end
E:StripTextures(QuestLogCollapseAllButton)
QuestLogCollapseAllButton:SetNormalTexture("")
QuestLogCollapseAllButton.SetNormalTexture = E.noop
QuestLogCollapseAllButton:SetHighlightTexture("")
QuestLogCollapseAllButton.SetHighlightTexture = E.noop
QuestLogCollapseAllButton:SetDisabledTexture("")
QuestLogCollapseAllButton.SetDisabledTexture = E.noop
QuestLogCollapseAllButton:SetPoint("TOPLEFT", -45, 7)
QuestLogCollapseAllButton.Text = QuestLogCollapseAllButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(QuestLogCollapseAllButton.Text, nil, 22)
QuestLogCollapseAllButton.Text:SetPoint("LEFT", 3, 0)
QuestLogCollapseAllButton.Text:SetText("+")
hooksecurefunc(QuestLogCollapseAllButton, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
else
self.Text:SetText("+")
end
end)
end
S:AddCallback("Quest", LoadSkin)
@@ -0,0 +1,36 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.questtimer ~= true then return end
E:StripTextures(QuestTimerFrame)
E:SetTemplate(QuestTimerFrame, "Transparent")
QuestTimerHeader:SetPoint("TOP", 1, 8)
E:CreateMover(QuestTimerFrame, "QuestTimerFrameMover", QUEST_TIMERS)
QuestTimerFrame:ClearAllPoints()
QuestTimerFrame:SetAllPoints(QuestTimerFrameMover)
local QuestTimerFrameHolder = CreateFrame("Frame", "QuestTimerFrameHolder", E.UIParent)
-- QuestTimerFrameHolder:Size(150, 22)
QuestTimerFrameHolder:SetWidth(150)
QuestTimerFrameHolder:SetHeight(22)
QuestTimerFrameHolder:SetPoint("TOP", QuestTimerFrameMover, "TOP")
hooksecurefunc(QuestTimerFrame, "SetPoint", function(_, _, parent)
if parent ~= QuestTimerFrameHolder then
QuestTimerFrame:ClearAllPoints()
QuestTimerFrame:SetPoint("TOP", QuestTimerFrameHolder, "TOP")
end
end)
end
S:AddCallback("QuestTimer", LoadSkin)
@@ -0,0 +1,90 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local select = select
local getn = table.getn
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.spellbook ~= true then return end
E:StripTextures(SpellBookFrame, true)
E:CreateBackdrop(SpellBookFrame, "Transparent")
SpellBookFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
SpellBookFrame.backdrop:SetPoint("BOTTOMRIGHT", -31, 75)
for i = 1, 3 do
local tab = _G["SpellBookFrameTabButton" .. i]
tab:GetNormalTexture():SetTexture(nil)
tab:GetDisabledTexture():SetTexture(nil)
S:HandleTab(tab)
tab.backdrop:SetPoint("TOPLEFT", 14, E.PixelMode and -17 or -19)
tab.backdrop:SetPoint("BOTTOMRIGHT", -14, 19)
end
S:HandleNextPrevButton(SpellBookPrevPageButton)
S:HandleNextPrevButton(SpellBookNextPageButton)
S:HandleCloseButton(SpellBookCloseButton)
for i = 1, SPELLS_PER_PAGE do
local button = _G["SpellButton" .. i]
local iconTexture = _G["SpellButton" .. i .. "IconTexture"]
local cooldown = _G["SpellButton"..i.."Cooldown"]
button:DisableDrawLayer("BACKGROUND")
button:GetNormalTexture():SetTexture(nil)
button:GetPushedTexture():SetTexture(nil)
if iconTexture then
iconTexture:SetTexCoord(unpack(E.TexCoords))
if not button.backdrop then
E:CreateBackdrop(button, "Default", true)
end
end
if cooldown then
E:RegisterCooldown(cooldown)
end
end
hooksecurefunc("SpellButton_UpdateButton", function()
local name = this:GetName()
local spellName = _G[name.."SpellName"]
local subSpellName = _G[name.."SubSpellName"]
local iconTexture = _G[name.."IconTexture"]
local highlight = _G[name.."Highlight"]
spellName:SetTextColor(1, 0.80, 0.10)
subSpellName:SetTextColor(1, 1, 1)
if iconTexture then
if highlight then
highlight:SetTexture(1, 1, 1, 0.3)
end
end
end)
for i = 1, MAX_SKILLLINE_TABS do
local tab = _G["SpellBookSkillLineTab"..i]
E:StripTextures(tab)
E:StyleButton(tab, nil, true)
E:SetTemplate(tab, "Default", true)
tab:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
E:SetInside(tab:GetNormalTexture())
end
SpellBookPageText:SetTextColor(1, 1, 1)
end
S:AddCallback("SpellBook", LoadSkin)
@@ -0,0 +1,59 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
--WoW API / Variables
local GetPetHappiness = GetPetHappiness
local HasPetUI = HasPetUI
local hooksecurefunc = hooksecurefunc
local UnitExists = UnitExists
function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.stable ~= true then return end
E:StripTextures(PetStableFrame)
E:Kill(PetStableFramePortrait)
E:CreateBackdrop(PetStableFrame, "Transparent")
PetStableFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
PetStableFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 71)
S:HandleButton(PetStablePurchaseButton)
S:HandleCloseButton(PetStableFrameCloseButton)
S:HandleRotateButton(PetStableModelRotateRightButton)
S:HandleRotateButton(PetStableModelRotateLeftButton)
S:HandleItemButton(_G["PetStableCurrentPet"], true)
_G["PetStableCurrentPetIconTexture"]:SetDrawLayer("OVERLAY")
for i = 1, NUM_PET_STABLE_SLOTS do
S:HandleItemButton(_G["PetStableStabledPet" .. i], true)
_G["PetStableStabledPet" .. i .. "IconTexture"]:SetDrawLayer("OVERLAY")
end
PetStablePetInfo:GetRegions():SetTexCoord(0.04, 0.15, 0.06, 0.30)
PetStablePetInfo:SetFrameLevel(PetModelFrame:GetFrameLevel() + 2)
E:CreateBackdrop(PetStablePetInfo, "Default")
-- PetStablePetInfo:Size(24, 24)
PetStablePetInfo:SetWidth(24)
PetStablePetInfo:SetHeight(24)
hooksecurefunc("PetStable_Update", function()
local happiness = GetPetHappiness()
local hasPetUI, isHunterPet = HasPetUI()
if(UnitExists("pet") and hasPetUI and not isHunterPet) then
return
end
local texture = PetStablePetInfo:GetRegions()
if(happiness == 1) then
texture:SetTexCoord(0.41, 0.53, 0.06, 0.30)
elseif(happiness == 2) then
texture:SetTexCoord(0.22, 0.345, 0.06, 0.30)
elseif(happiness == 3) then
texture:SetTexCoord(0.04, 0.15, 0.06, 0.30)
end
end)
end
S:AddCallback("Stable", LoadSkin)
@@ -0,0 +1,57 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.tabard ~= true then return end
E:StripTextures(TabardFrame)
E:Kill(TabardFramePortrait)
E:CreateBackdrop(TabardFrame, "Transparent")
TabardFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
TabardFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 74)
E:CreateBackdrop(TabardModel, "Default")
S:HandleButton(TabardFrameCancelButton)
S:HandleButton(TabardFrameAcceptButton)
S:HandleCloseButton(TabardFrameCloseButton)
S:HandleRotateButton(TabardCharacterModelRotateLeftButton)
S:HandleRotateButton(TabardCharacterModelRotateRightButton)
E:StripTextures(TabardFrameCostFrame)
E:StripTextures(TabardFrameCustomizationFrame)
for i = 1, 5 do
local custom = "TabardFrameCustomization" .. i
E:StripTextures(_G[custom])
S:HandleNextPrevButton(_G[custom .. "LeftButton"])
S:HandleNextPrevButton(_G[custom .. "RightButton"])
if(i > 1) then
_G[custom]:ClearAllPoints()
_G[custom]:SetPoint("TOP", _G["TabardFrameCustomization" .. i-1], "BOTTOM", 0, -6)
else
local point, anchor, point2, x, y = _G[custom]:GetPoint()
_G[custom]:SetPoint(point, anchor, point2, x, y+4)
end
end
TabardCharacterModelRotateLeftButton:SetPoint("BOTTOMLEFT", 4, 4)
TabardCharacterModelRotateRightButton:SetPoint("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0)
hooksecurefunc(TabardCharacterModelRotateLeftButton, "SetPoint", function(self, point, _, _, xOffset, yOffset)
if point ~= "BOTTOMLEFT" or xOffset ~= 4 or yOffset ~= 4 then
self:SetPoint("BOTTOMLEFT", 4, 4)
end
end)
hooksecurefunc(TabardCharacterModelRotateRightButton, "SetPoint", function(self, point, _, _, xOffset, yOffset)
if point ~= "TOPLEFT" or xOffset ~= 4 or yOffset ~= 0 then
self:SetPoint("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0)
end
end)
end
S:AddCallback("Tabard", LoadSkin)
@@ -0,0 +1,58 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
--WoW API / Variables
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.talent ~= true then return end
E:StripTextures(TalentFrame)
E:CreateBackdrop(TalentFrame, "Transparent")
TalentFrame.backdrop:SetPoint("TOPLEFT", 13, -12)
TalentFrame.backdrop:SetPoint("BOTTOMRIGHT", -31, 76)
TalentFramePortrait:Hide()
S:HandleCloseButton(TalentFrameCloseButton)
E:Kill(TalentFrameCancelButton)
for i = 1, 5 do
S:HandleTab(_G["TalentFrameTab"..i])
end
E:StripTextures(TalentFrameScrollFrame)
E:CreateBackdrop(TalentFrameScrollFrame, "Default")
TalentFrameScrollFrame.backdrop:SetPoint("TOPLEFT", -1, 2)
TalentFrameScrollFrame.backdrop:SetPoint("BOTTOMRIGHT", 6, -2)
S:HandleScrollBar(TalentFrameScrollFrameScrollBar)
TalentFrameScrollFrameScrollBar:SetPoint("TOPLEFT", TalentFrameScrollFrame, "TOPRIGHT", 10, -16)
TalentFrameSpentPoints:SetPoint("TOP", 0, -42)
TalentFrameTalentPointsText:SetPoint("BOTTOMRIGHT", TalentFrame, "BOTTOMLEFT", 220, 84)
for i = 1, MAX_NUM_TALENTS do
local talent = _G["TalentFrameTalent"..i]
local icon = _G["TalentFrameTalent"..i.."IconTexture"]
local rank = _G["TalentFrameTalent"..i.."Rank"]
if talent then
E:StripTextures(talent)
E:SetTemplate(talent, "Default")
E:StyleButton(talent)
E:SetInside(icon)
icon:SetTexCoord(unpack(E.TexCoords))
icon:SetDrawLayer("ARTWORK")
rank:SetFont(E.LSM:Fetch("font", E.db["general"].font), 12, "OUTLINE")
end
end
end
S:AddCallbackForAddon("Blizzard_TalentUI", "Talent", LoadSkin)
@@ -0,0 +1,20 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.taxi ~= true then return end
E:CreateBackdrop(TaxiFrame, "Transparent")
TaxiFrame.backdrop:SetPoint("TOPLEFT", 11, -12)
TaxiFrame.backdrop:SetPoint("BOTTOMRIGHT", -34, 75)
E:StripTextures(TaxiFrame)
E:Kill(TaxiPortrait)
S:HandleCloseButton(TaxiCloseButton)
E:CreateBackdrop(TaxiRouteMap, "Default")
end
S:AddCallback("Taxi", LoadSkin)
@@ -0,0 +1,49 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
local TT = E:GetModule("Tooltip");
--Cache global variables
--Lua functions
local _G = getfenv()
local pairs = pairs
--WoW API / Variables
local function LoadSkin()
S:HandleCloseButton(ItemRefCloseButton)
local GameTooltip = _G["GameTooltip"]
local GameTooltipStatusBar = _G["GameTooltipStatusBar"]
local tooltips = {
GameTooltip,
ItemRefTooltip,
ItemRefShoppingTooltip1,
ItemRefShoppingTooltip2,
ItemRefShoppingTooltip3,
AutoCompleteBox,
FriendsTooltip,
ConsolidatedBuffsTooltip,
ShoppingTooltip1,
ShoppingTooltip2,
ShoppingTooltip3,
WorldMapTooltip,
WorldMapCompareTooltip1,
WorldMapCompareTooltip2,
WorldMapCompareTooltip3
}
for _, tt in pairs(tooltips) do
TT:SecureHookScript(tt, "OnShow", "SetStyle")
end
GameTooltipStatusBar:SetStatusBarTexture(E["media"].normTex)
E:RegisterStatusBar(GameTooltipStatusBar)
E:CreateBackdrop(GameTooltipStatusBar, "Transparent")
GameTooltipStatusBar:ClearAllPoints()
GameTooltipStatusBar:SetPoint("TOPLEFT", GameTooltip, "BOTTOMLEFT", E.Border, -(E.Spacing * 3))
GameTooltipStatusBar:SetPoint("TOPRIGHT", GameTooltip, "BOTTOMRIGHT", -E.Border, -(E.Spacing * 3))
TT:SecureHookScript(GameTooltip, "OnSizeChanged", "CheckBackdropColor")
TT:SecureHookScript(GameTooltip, "OnUpdate", "CheckBackdropColor")
TT:RegisterEvent("CURSOR_UPDATE", "CheckBackdropColor")
end
S:AddCallback("SkinTooltip", LoadSkin)
@@ -0,0 +1,125 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local select = select
--WoW API / Variables
local GetItemInfo = GetItemInfo
local GetItemQualityColor = GetItemQualityColor
local GetTradePlayerItemLink = GetTradePlayerItemLink
local GetTradeTargetItemLink = GetTradeTargetItemLink
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.trade ~= true then return end
E:StripTextures(TradeFrame, true)
TradeFrame:SetWidth(400)
E:CreateBackdrop(TradeFrame, "Transparent")
TradeFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
TradeFrame.backdrop:SetPoint("BOTTOMRIGHT", -28, 48)
S:HandleCloseButton(TradeFrameCloseButton, TradeFrame.backdrop)
S:HandleEditBox(TradePlayerInputMoneyFrameGold)
S:HandleEditBox(TradePlayerInputMoneyFrameSilver)
S:HandleEditBox(TradePlayerInputMoneyFrameCopper)
for i = 1, MAX_TRADE_ITEMS do
local player = _G["TradePlayerItem" .. i]
local recipient = _G["TradeRecipientItem" .. i]
local playerButton = _G["TradePlayerItem" .. i .. "ItemButton"]
local playerButtonIcon = _G["TradePlayerItem" .. i .. "ItemButtonIconTexture"]
local recipientButton = _G["TradeRecipientItem" .. i .. "ItemButton"]
local recipientButtonIcon = _G["TradeRecipientItem" .. i .. "ItemButtonIconTexture"]
local playerNameFrame = _G["TradePlayerItem"..i.."NameFrame"]
local recipientNameFrame = _G["TradeRecipientItem"..i.."NameFrame"]
E:StripTextures(player)
E:StripTextures(recipient)
E:StripTextures(playerButton)
E:StyleButton(playerButton)
E:SetTemplate(playerButton, "Default", true)
E:SetInside(playerButtonIcon)
playerButtonIcon:SetTexCoord(unpack(E.TexCoords))
E:StripTextures(recipientButton)
E:StyleButton(recipientButton)
E:SetTemplate(recipientButton, "Default", true)
E:SetInside(recipientButtonIcon)
recipientButtonIcon:SetTexCoord(unpack(E.TexCoords))
playerButton.bg = CreateFrame("Frame", nil, playerButton)
E:SetTemplate(playerButton.bg, "Default")
playerButton.bg:SetPoint("TOPLEFT", playerButton, "TOPRIGHT", 4, 0)
playerButton.bg:SetPoint("BOTTOMRIGHT", playerNameFrame, "BOTTOMRIGHT", -5, 14)
playerButton.bg:SetFrameLevel(playerButton:GetFrameLevel() - 4)
recipientButton.bg = CreateFrame("Frame", nil, recipientButton)
E:SetTemplate(recipientButton.bg, "Default")
recipientButton.bg:SetPoint("TOPLEFT", recipientButton, "TOPRIGHT", 4, 0)
recipientButton.bg:SetPoint("BOTTOMRIGHT", recipientNameFrame, "BOTTOMRIGHT", -5, 14)
recipientButton.bg:SetFrameLevel(recipientButton:GetFrameLevel() - 4)
end
TradePlayerItem1:SetPoint("TOPLEFT", 24, -104)
TradeHighlightPlayerTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerEnchantTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerEnchantBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightPlayerEnchantMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientMiddle:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientEnchantTop:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientEnchantBottom:SetTexture(0, 1, 0, 0.2)
TradeHighlightRecipientEnchantMiddle:SetTexture(0, 1, 0, 0.2)
S:HandleButton(TradeFrameTradeButton)
TradeFrameTradeButton:SetPoint("BOTTOMRIGHT", -120, 55)
S:HandleButton(TradeFrameCancelButton)
hooksecurefunc("TradeFrame_UpdatePlayerItem", function(id)
local link = GetTradePlayerItemLink(id)
local tradeItemButton = _G["TradePlayerItem" .. id .. "ItemButton"]
local tradeItemName = _G["TradePlayerItem" .. id .. "Name"]
if(link) then
local quality = select(3, GetItemInfo(link))
tradeItemName:SetTextColor(GetItemQualityColor(quality))
if(quality and quality > 1) then
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
end
else
tradeItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end)
hooksecurefunc("TradeFrame_UpdateTargetItem", function(id)
local link = GetTradeTargetItemLink(id)
local tradeItemButton = _G["TradeRecipientItem" .. id .. "ItemButton"]
local tradeItemName = _G["TradeRecipientItem" .. id .. "Name"]
if(link) then
local quality = select(3, GetItemInfo(link))
tradeItemName:SetTextColor(GetItemQualityColor(quality))
if(quality and quality > 1) then
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
end
else
tradeItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
end)
end
S:AddCallback("Trade", LoadSkin)
@@ -0,0 +1,94 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
local unpack = unpack
local find = string.find
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.trainer ~= true then return end
E:CreateBackdrop(ClassTrainerFrame, "Transparent")
ClassTrainerFrame.backdrop:SetPoint("TOPLEFT", 10, -11)
ClassTrainerFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 74)
E:StripTextures(ClassTrainerFrame, true)
E:StripTextures(ClassTrainerExpandButtonFrame)
S:HandleDropDownBox(ClassTrainerFrameFilterDropDown)
ClassTrainerFrameFilterDropDown:SetPoint("TOPRIGHT", -40, -64)
E:StripTextures(ClassTrainerListScrollFrame)
S:HandleScrollBar(ClassTrainerListScrollFrameScrollBar)
E:StripTextures(ClassTrainerDetailScrollFrame)
S:HandleScrollBar(ClassTrainerDetailScrollFrameScrollBar)
E:StripTextures(ClassTrainerSkillIcon)
S:HandleButton(ClassTrainerTrainButton)
S:HandleButton(ClassTrainerCancelButton)
S:HandleCloseButton(ClassTrainerFrameCloseButton)
hooksecurefunc("ClassTrainer_SetSelection", function()
local skillIcon = ClassTrainerSkillIcon:GetNormalTexture()
if skillIcon then
E:SetInside(skillIcon)
skillIcon:SetTexCoord(unpack(E.TexCoords))
E:SetTemplate(ClassTrainerSkillIcon, "Default")
end
end)
for i = 1, CLASS_TRAINER_SKILLS_DISPLAYED do
local skillButton = _G["ClassTrainerSkill" .. i]
skillButton:SetNormalTexture("")
skillButton.SetNormalTexture = E.noop
_G["ClassTrainerSkill" .. i .. "Highlight"]:SetTexture("")
_G["ClassTrainerSkill" .. i .. "Highlight"].SetTexture = E.noop
skillButton.Text = skillButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(skillButton.Text, nil, 22)
skillButton.Text:SetPoint("LEFT", 3, 0)
skillButton.Text:SetText("+")
hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
self.Text:SetText("+")
else
self.Text:SetText("")
end
end)
end
ClassTrainerCollapseAllButton:SetNormalTexture("")
ClassTrainerCollapseAllButton.SetNormalTexture = E.noop
ClassTrainerCollapseAllButton:SetHighlightTexture("")
ClassTrainerCollapseAllButton.SetHighlightTexture = E.noop
ClassTrainerCollapseAllButton:SetDisabledTexture("")
ClassTrainerCollapseAllButton.SetDisabledTexture = E.noop
ClassTrainerCollapseAllButton.Text = ClassTrainerCollapseAllButton:CreateFontString(nil, "OVERLAY")
E:FontTemplate(ClassTrainerCollapseAllButton.Text, nil, 22)
ClassTrainerCollapseAllButton.Text:SetPoint("LEFT", 3, 0)
ClassTrainerCollapseAllButton.Text:SetText("+")
hooksecurefunc(ClassTrainerCollapseAllButton, "SetNormalTexture", function(self, texture)
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
self.Text:SetText("-")
else
self.Text:SetText("+")
end
end)
end
S:AddCallbackForAddon("Blizzard_TrainerUI", "Trainer", LoadSkin)
@@ -0,0 +1,34 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = getfenv()
--WoW API / Variables
local MAX_TUTORIAL_ALERTS = MAX_TUTORIAL_ALERTS
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.tutorial ~= true then return end
for i = 1, MAX_TUTORIAL_ALERTS do
local button = _G["TutorialFrameAlertButton"..i]
local icon = button:GetNormalTexture()
-- button:Size(35, 45)
button:SetWidth(35)
button:SetHeight(45)
E:SetTemplate(button, "Default", true)
E:StyleButton(button, nil, true)
E:SetInside(icon)
icon:SetTexCoord(0.09, 0.40, 0.11, 0.56)
end
E:SetTemplate(TutorialFrame, "Transparent")
S:HandleCheckBox(TutorialFrameCheckButton)
S:HandleButton(TutorialFrameOkayButton)
end
S:AddCallback("Tutorial", LoadSkin)
@@ -0,0 +1,23 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins");
local function LoadSkin()
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.worldmap ~= true then return end
E:StripTextures(WorldMapFrame)
E:CreateBackdrop(WorldMapPositioningGuide, "Transparent")
S:HandleDropDownBox(WorldMapContinentDropDown, 170)
S:HandleDropDownBox(WorldMapZoneDropDown, 170)
WorldMapZoneDropDown:SetPoint("LEFT", WorldMapContinentDropDown, "RIGHT", -24, 0)
WorldMapZoomOutButton:SetPoint("LEFT", WorldMapZoneDropDown, "RIGHT", -4, 3)
S:HandleButton(WorldMapZoomOutButton)
S:HandleCloseButton(WorldMapFrameCloseButton)
E:CreateBackdrop(WorldMapDetailFrame, "Default")
end
S:AddCallback("SkinWorldMap", LoadSkin)
@@ -0,0 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Skins.lua"/>
<Include file="Blizzard\Load_Blizzard.xml"/>
</Ui>
+607
View File
@@ -0,0 +1,607 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0");
local _G = getfenv();
local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall;
local tinsert, wipe = table.insert, table.wipe;
local lower = string.lower
local CreateFrame = CreateFrame;
local SetDesaturation = SetDesaturation;
local hooksecurefunc = hooksecurefunc;
local IsAddOnLoaded = IsAddOnLoaded;
local GetCVarBool = GetCVarBool;
E.Skins = S;
S.addonsToLoad = {};
S.nonAddonsToLoad = {};
S.allowBypass = {};
S.addonCallbacks = {};
S.nonAddonCallbacks = {["CallPriority"] = {}};
local find = string.find;
S.SQUARE_BUTTON_TEXCOORDS = {
["UP"] = { 0.45312500, 0.64062500, 0.01562500, 0.20312500};
["DOWN"] = { 0.45312500, 0.64062500, 0.20312500, 0.01562500};
["LEFT"] = { 0.23437500, 0.42187500, 0.01562500, 0.20312500};
["RIGHT"] = { 0.42187500, 0.23437500, 0.01562500, 0.20312500};
["DELETE"] = { 0.01562500, 0.20312500, 0.01562500, 0.20312500}
};
function S:SquareButton_SetIcon(self, name)
local coords = S.SQUARE_BUTTON_TEXCOORDS[strupper(name)];
if(coords) then
self.icon:SetTexCoord(coords[1], coords[2], coords[3], coords[4]);
end
end
function S:SetModifiedBackdrop(self)
if(self.backdrop) then self = self.backdrop; end
self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor));
end
function S:SetOriginalBackdrop(self)
if(self.backdrop) then self = self.backdrop; end
self:SetBackdropBorderColor(unpack(E["media"].bordercolor));
end
function S:HandleButton(f, strip)
local name = f:GetName();
if(name) then
local left = _G[name .."Left"];
local middle = _G[name .."Middle"];
local right = _G[name .."Right"];
if(left) then E:Kill(left); end
if(middle) then E:Kill(middle); end
if(right) then E:Kill(right); end
end
if(f.Left) then E:Kill(f.Left); end
if(f.Middle) then E:Kill(f.Middle); end
if(f.Right) then E:Kill(f.Right); end
if(f.SetNormalTexture) then f:SetNormalTexture(""); end
if(f.SetHighlightTexture) then f:SetHighlightTexture(""); end
if(f.SetPushedTexture) then f:SetPushedTexture(""); end
if(f.SetDisabledTexture) then f:SetDisabledTexture(""); end
if(strip) then E:StripTextures(f); end
E:SetTemplate(f, "Default", true)
HookScript(f, "OnEnter", function() S:SetModifiedBackdrop(this) end)
HookScript(f, "OnLeave", function() S:SetOriginalBackdrop(this) end)
end
function S:HandleScrollBar(frame, thumbTrim)
local name = frame:GetName()
if _G[name.."BG"] then _G[name.."BG"]:SetTexture(nil) end
if _G[name.."Track"] then _G[name.."Track"]:SetTexture(nil) end
if _G[name.."Top"] then _G[name.."Top"]:SetTexture(nil) end
if _G[name.."Bottom"] then _G[name.."Bottom"]:SetTexture(nil) end
if _G[name.."Middle"] then _G[name.."Middle"]:SetTexture(nil) end
if _G[name.."ScrollUpButton"] and _G[name.."ScrollDownButton"] then
E:StripTextures(_G[name.."ScrollUpButton"])
if not _G[name.."ScrollUpButton"].icon then
S:HandleNextPrevButton(_G[name.."ScrollUpButton"])
S:SquareButton_SetIcon(_G[name.."ScrollUpButton"], "UP")
_G[name.."ScrollUpButton"]:SetWidth(_G[name.."ScrollUpButton"]:GetWidth() + 7)
_G[name.."ScrollUpButton"]:SetHeight(_G[name.."ScrollUpButton"]:GetHeight() + 7)
end
E:StripTextures(_G[name .."ScrollDownButton"])
if not _G[name.."ScrollDownButton"].icon then
S:HandleNextPrevButton(_G[name.."ScrollDownButton"])
S:SquareButton_SetIcon(_G[name.."ScrollDownButton"], "DOWN")
_G[name.."ScrollDownButton"]:SetWidth(_G[name.."ScrollDownButton"]:GetWidth() + 7)
_G[name.."ScrollDownButton"]:SetHeight(_G[name.."ScrollDownButton"]:GetHeight() + 7)
end
if not frame.trackbg then
frame.trackbg = CreateFrame("Frame", nil, frame)
frame.trackbg:SetPoint("TOPLEFT", _G[name .."ScrollUpButton"], "BOTTOMLEFT", 0, -1)
frame.trackbg:SetPoint("BOTTOMRIGHT", _G[name .."ScrollDownButton"], "TOPRIGHT", 0, 1)
E:SetTemplate(frame.trackbg, "Transparent")
end
if frame:GetThumbTexture() then
if not thumbTrim then thumbTrim = 3 end
frame:GetThumbTexture():SetTexture(nil)
if not frame.thumbbg then
frame.thumbbg = CreateFrame("Frame", nil, frame)
frame:GetThumbTexture():SetHeight(24)
frame.thumbbg:SetPoint("TOPLEFT", frame:GetThumbTexture(), "TOPLEFT", 1, -thumbTrim)
frame.thumbbg:SetPoint("BOTTOMRIGHT", frame:GetThumbTexture(), "BOTTOMRIGHT", -1, thumbTrim)
E:SetTemplate(frame.thumbbg, "Default", true, true)
frame.thumbbg:SetBackdropColor(0.6, 0.6, 0.6)
if frame.trackbg then
frame.thumbbg:SetFrameLevel(frame.trackbg:GetFrameLevel() + 1)
end
end
end
end
end
local tabs = {
"LeftDisabled",
"MiddleDisabled",
"RightDisabled",
"Left",
"Middle",
"Right"
}
function S:HandleTab(tab)
local name = tab:GetName()
for _, object in pairs(tabs) do
local tex = _G[name..object]
if tex then
tex:SetTexture(nil)
end
end
if tab.GetHighlightTexture and tab:GetHighlightTexture() then
tab:GetHighlightTexture():SetTexture(nil)
else
E:StripTextures(tab)
end
tab.backdrop = CreateFrame("Frame", nil, tab)
E:SetTemplate(tab.backdrop, "Default")
tab.backdrop:SetFrameLevel(tab:GetFrameLevel() - 1)
tab.backdrop:SetPoint("TOPLEFT", 10, E.PixelMode and -1 or -3)
tab.backdrop:SetPoint("BOTTOMRIGHT", -10, 3)
end
function S:HandleNextPrevButton(btn, buttonOverride)
local inverseDirection
if btn:GetName() then
for k in string.gfind(lower(btn:GetName()), "left") do
inverseDirection = k
end
for k in string.gfind(lower(btn:GetName()), "prev") do
inverseDirection = k
end
for k in string.gfind(lower(btn:GetName()), "decrement") do
inverseDirection = k
end
for k in string.gfind(lower(btn:GetName()), "promote") do
inverseDirection = k
end
end
E:StripTextures(btn)
btn:SetNormalTexture(nil)
btn:SetPushedTexture(nil)
btn:SetHighlightTexture(nil)
btn:SetDisabledTexture(nil)
if not btn.icon then
btn.icon = btn:CreateTexture(nil, "ARTWORK")
btn.icon:SetWidth(13)
btn.icon:SetHeight(13)
btn.icon:SetPoint("CENTER", 0, 0)
btn.icon:SetTexture("Interface\\AddOns\\ElvUI\\Media\\Textures\\SquareButtonTextures.blp")
btn.icon:SetTexCoord(0.01562500, 0.20312500, 0.01562500, 0.20312500)
btn:SetScript("OnMouseDown", function()
if btn:IsEnabled() == 1 then
this.icon:SetPoint("CENTER", -1, -1)
end
end)
btn:SetScript("OnMouseUp", function()
this.icon:SetPoint("CENTER", 0, 0)
end)
hooksecurefunc(btn, "Disable", function(self)
SetDesaturation(self.icon, true)
self.icon:SetAlpha(0.5)
end)
hooksecurefunc(btn, "Enable", function(self)
SetDesaturation(self.icon, false)
self.icon:SetAlpha(1.0)
end)
if btn:IsEnabled() == 0 then
SetDesaturation(btn.icon, true)
btn.icon:SetAlpha(0.5)
end
end
if buttonOverride then
if inverseDirection then
S:SquareButton_SetIcon(btn, "UP")
else
S:SquareButton_SetIcon(btn, "DOWN")
end
else
if inverseDirection then
S:SquareButton_SetIcon(btn, "LEFT")
else
S:SquareButton_SetIcon(btn, "RIGHT")
end
end
S:HandleButton(btn)
btn:SetWidth(btn:GetWidth() - 7)
btn:SetHeight(btn:GetHeight() - 7)
end
function S:HandleRotateButton(btn)
E:SetTemplate(btn, "Default")
btn:SetWidth(btn:GetWidth() - 14)
btn:SetHeight(btn:GetHeight() - 14)
btn:GetNormalTexture():SetTexCoord(0.27, 0.73, 0.27, 0.68)
btn:GetPushedTexture():SetTexCoord(0.27, 0.73, 0.27, 0.68)
btn:GetHighlightTexture():SetTexture(1, 1, 1, 0.3)
E:SetInside(btn:GetNormalTexture())
btn:GetPushedTexture():SetAllPoints(btn:GetNormalTexture())
btn:GetHighlightTexture():SetAllPoints(btn:GetNormalTexture())
end
function S:HandleEditBox(frame)
if not frame then return end
E:CreateBackdrop(frame, "Default")
frame.backdrop:SetFrameLevel(frame:GetFrameLevel())
if frame:GetName() then
if _G[frame:GetName() .."Left"] then E:Kill(_G[frame:GetName() .."Left"]) end
if _G[frame:GetName() .."Middle"] then E:Kill(_G[frame:GetName() .."Middle"]) end
if _G[frame:GetName() .."Right"] then E:Kill(_G[frame:GetName() .."Right"]) end
if _G[frame:GetName() .."Mid"] then E:Kill(_G[frame:GetName() .."Mid"]) end
--if(frame:GetName():find("Silver") or frame:GetName():find("Copper")) then
-- frame.backdrop:SetPoint("BOTTOMRIGHT", -12, -2);
--end
end
end
function S:HandleDropDownBox(frame, width)
local button = _G[frame:GetName().."Button"]
if not button then return end
if not width then width = 155 end
E:StripTextures(frame)
frame:SetWidth(width)
if _G[frame:GetName().."Text"] then
_G[frame:GetName().."Text"]:ClearAllPoints()
_G[frame:GetName().."Text"]:SetPoint("RIGHT", button, "LEFT", -2, 0)
end
if button then
button:ClearAllPoints()
button:SetPoint("RIGHT", frame, "RIGHT", -10, 3)
self:HandleNextPrevButton(button, true)
end
E:CreateBackdrop(frame, "Default")
frame.backdrop:SetPoint("TOPLEFT", 20, -2)
frame.backdrop:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 2, -2)
frame.backdrop:SetFrameLevel(frame:GetFrameLevel())
end
function S:HandleCheckBox(frame, noBackdrop)
frame:SetNormalTexture(nil)
frame:SetPushedTexture(nil)
frame:SetHighlightTexture(nil)
frame:SetDisabledTexture(nil)
if noBackdrop then
E:SetTemplate(frame, "Default")
frame:SetWidth(16)
frame:SetHeight(16)
else
E:CreateBackdrop(frame, "Default")
E:SetInside(frame.backdrop, nil, 4, 4)
frame.backdrop:SetFrameLevel(frame:GetFrameLevel())
end
end
function S:HandleIcon(icon, parent)
parent = parent or icon:GetParent()
icon:SetTexCoord(unpack(E.TexCoords))
E:CreateBackdrop(parent, "Default")
icon:SetParent(parent.backdrop)
E:SetOutside(parent.backdrop, icon)
end
function S:HandleItemButton(b, shrinkIcon)
if(b.isSkinned) then return; end
local icon = b.icon or b.IconTexture or b.iconTexture;
local texture;
if b:GetName() and _G[b:GetName() .."IconTexture"] then
icon = _G[b:GetName() .."IconTexture"]
elseif b:GetName() and _G[b:GetName() .."Icon"] then
icon = _G[b:GetName() .."Icon"]
end
if icon and icon:GetTexture() then
texture = icon:GetTexture()
end
E:StripTextures(b)
E:CreateBackdrop(b, "Default", true)
E:StyleButton(b)
if icon then
icon:SetTexCoord(unpack(E.TexCoords))
if shrinkIcon then
b.backdrop:SetAllPoints()
E:SetInside(icon, b)
else
E:SetOutside(b.backdrop, icon)
end
icon:SetParent(b.backdrop)
if texture then
icon:SetTexture(texture)
end
end
b.isSkinned = true
end
function S:HandleCloseButton(f, point, text)
E:StripTextures(f)
if f:GetNormalTexture() then f:SetNormalTexture("") f.SetNormalTexture = E.noop end
if f:GetPushedTexture() then f:SetPushedTexture("") f.SetPushedTexture = E.noop end
if not f.backdrop then
E:CreateBackdrop(f, "Default", true)
f.backdrop:SetPoint("TOPLEFT", 7, -8)
f.backdrop:SetPoint("BOTTOMRIGHT", -8, 8)
HookScript(f, "OnEnter", function() S:SetModifiedBackdrop(this) end)
HookScript(f, "OnLeave", function() S:SetOriginalBackdrop(this) end)
end
if not text then text = "x" end
if not f.text then
f.text = f:CreateFontString(nil, "OVERLAY")
f.text:SetFont([[Interface\AddOns\ElvUI\Media\Fonts\PT_Sans_Narrow.ttf]], 16, "OUTLINE")
f.text:SetText(text)
f.text:SetJustifyH("CENTER")
f.text:SetPoint("CENTER", f, "CENTER", -1, 1)
end
if point then
f:SetPoint("TOPRIGHT", point, "TOPRIGHT", 2, 2)
end
end
function S:HandleSliderFrame(frame)
local orientation = frame:GetOrientation()
local SIZE = 12
E:StripTextures(frame)
E:CreateBackdrop(frame, "Default")
frame.backdrop:SetAllPoints()
hooksecurefunc(frame, "SetBackdrop", function(_, backdrop)
if backdrop ~= nil then
frame:SetBackdrop(nil)
end
end)
frame:SetThumbTexture(E["media"].blankTex)
frame:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
frame:GetThumbTexture():SetWidth(SIZE-2)
frame:GetThumbTexture():SetHeight(SIZE-2)
if orientation == "VERTICAL" then
frame:SetWidth(SIZE)
else
frame:SetHeight(SIZE)
--[[for i = 1, frame:GetNumRegions() do
local region = select(i, frame:GetRegions())
if region and region:GetObjectType() == "FontString" then
local point, anchor, anchorPoint, x, y = region:GetPoint()
if anchorPoint:find("BOTTOM") then
region:SetPoint(point, anchor, anchorPoint, x, y - 4)
end
end
end]]
end
end
function S:HandleIconSelectionFrame(frame, numIcons, buttonNameTemplate, frameNameOverride)
assert(frame, "HandleIconSelectionFrame: frame argument missing")
assert(numIcons and type(numIcons) == "number", "HandleIconSelectionFrame: numIcons argument missing or not a number")
assert(buttonNameTemplate and type(buttonNameTemplate) == "string", "HandleIconSelectionFrame: buttonNameTemplate argument missing or not a string")
local frameName = frameNameOverride or frame:GetName() --We need override in case Blizzard fucks up the naming (guild bank)
local scrollFrame = _G[frameName.."ScrollFrame"]
local editBox = _G[frameName.."EditBox"]
local okayButton = _G[frameName.."OkayButton"] or _G[frameName.."Okay"]
local cancelButton = _G[frameName.."CancelButton"] or _G[frameName.."Cancel"]
E:StripTextures(frame)
E:StripTextures(scrollFrame)
editBox:DisableDrawLayer("BACKGROUND") --Removes textures around it
E:CreateBackdrop(frame, "Transparent")
frame.backdrop:SetPoint("TOPLEFT", frame, "TOPLEFT", 10, -12)
frame.backdrop:SetPoint("BOTTOMRIGHT", cancelButton, "BOTTOMRIGHT", 5, -5)
S:HandleButton(okayButton)
S:HandleButton(cancelButton)
S:HandleEditBox(editBox)
for i = 1, numIcons do
local button = _G[buttonNameTemplate..i]
local icon = _G[button:GetName().."Icon"]
E:StripTextures(button)
E:SetTemplate(button, "Default")
E:StyleButton(button, nil, true)
E:SetInside(icon)
icon:SetTexCoord(unpack(E.TexCoords))
end
end
function S:ADDON_LOADED()
if self.allowBypass[arg1] then
if self.addonsToLoad[arg1] then
--Load addons using the old deprecated register method
self.addonsToLoad[arg1]()
self.addonsToLoad[arg1] = nil
elseif self.addonCallbacks[arg1] then
--Fire events to the skins that rely on this addon
for index, event in ipairs(self.addonCallbacks[arg1]["CallPriority"]) do
self.addonCallbacks[arg1][event] = nil
self.addonCallbacks[arg1]["CallPriority"][index] = nil
E.callbacks:Fire(event)
end
end
return
end
if not E.initialized then return; end
if self.addonsToLoad[arg1] then
self.addonsToLoad[arg1]()
self.addonsToLoad[arg1] = nil
elseif self.addonCallbacks[arg1] then
for index, event in ipairs(self.addonCallbacks[arg1]["CallPriority"]) do
self.addonCallbacks[arg1][event] = nil
self.addonCallbacks[arg1]["CallPriority"][index] = nil
E.callbacks:Fire(event)
end
end
end
--Old deprecated register function. Keep it for the time being for any plugins that may need it.
function S:RegisterSkin(name, loadFunc, forceLoad, bypass)
if bypass then
self.allowBypass[name] = true
end
if forceLoad then
loadFunc()
self.addonsToLoad[name] = nil
elseif name == "ElvUI" then
tinsert(self.nonAddonsToLoad, loadFunc)
else
self.addonsToLoad[name] = loadFunc
end
end
--Add callback for skin that relies on another addon.
--These events will be fired when the addon is loaded.
function S:AddCallbackForAddon(addonName, eventName, loadFunc, forceLoad, bypass)
if not addonName or type(addonName) ~= "string" then
E:Print("Invalid argument #1 to S:AddCallbackForAddon (string expected)")
return
elseif not eventName or type(eventName) ~= "string" then
E:Print("Invalid argument #2 to S:AddCallbackForAddon (string expected)")
return
elseif not loadFunc or type(loadFunc) ~= "function" then
E:Print("Invalid argument #3 to S:AddCallbackForAddon (function expected)")
return
end
if bypass then
self.allowBypass[addonName] = true
end
--Create an event registry for this addon, so that we can fire multiple events when this addon is loaded
if not self.addonCallbacks[addonName] then
self.addonCallbacks[addonName] = {["CallPriority"] = {}}
end
if self.addonCallbacks[addonName][eventName] or E.ModuleCallbacks[eventName] or E.InitialModuleCallbacks[eventName] then
--Don't allow a registered callback to be overwritten
E:Print("Invalid argument #2 to S:AddCallbackForAddon (event name:", eventName, "is already registered, please use a unique event name)")
return
end
--Register loadFunc to be called when event is fired
E.RegisterCallback(E, eventName, loadFunc);
if forceLoad then
E.callbacks:Fire(eventName)
else
--Insert eventName in this addons' registry
self.addonCallbacks[addonName][eventName] = true
self.addonCallbacks[addonName]["CallPriority"][getn(self.addonCallbacks[addonName]["CallPriority"]) + 1] = eventName
end
end
--Add callback for skin that does not rely on a another addon.
--These events will be fired when the Skins module is initialized.
function S:AddCallback(eventName, loadFunc)
if not eventName or type(eventName) ~= "string" then
E:Print("Invalid argument #1 to S:AddCallback (string expected)")
return
elseif not loadFunc or type(loadFunc) ~= "function" then
E:Print("Invalid argument #2 to S:AddCallback (function expected)")
return;
end
if self.nonAddonCallbacks[eventName] or E.ModuleCallbacks[eventName] or E.InitialModuleCallbacks[eventName] then
--Don't allow a registered callback to be overwritten
E:Print("Invalid argument #1 to S:AddCallback (event name:", eventName, "is already registered, please use a unique event name)")
return
end
--Add event name to registry
self.nonAddonCallbacks[eventName] = true
self.nonAddonCallbacks["CallPriority"][getn(self.nonAddonCallbacks["CallPriority"]) + 1] = eventName
--Register loadFunc to be called when event is fired
E.RegisterCallback(E, eventName, loadFunc)
end
function S:Initialize()
self.db = E.private.skins
--Fire events for Blizzard addons that are already loaded
for addon in pairs(self.addonCallbacks) do
if IsAddOnLoaded(addon) then
for index, event in ipairs(self.addonCallbacks[addon]["CallPriority"]) do
self.addonCallbacks[addon][event] = nil
self.addonCallbacks[addon]["CallPriority"][index] = nil
E.callbacks:Fire(event)
end
end
end
--Fire event for all skins that doesn't rely on a Blizzard addon
for index, event in ipairs(self.nonAddonCallbacks["CallPriority"]) do
self.nonAddonCallbacks[event] = nil
self.nonAddonCallbacks["CallPriority"][index] = nil
E.callbacks:Fire(event)
end
--Old deprecated load functions. We keep this for the time being in case plugins make use of it.
for addon, loadFunc in pairs(self.addonsToLoad) do
if IsAddOnLoaded(addon) then
self.addonsToLoad[addon] = nil
local _, catch = pcall(loadFunc)
if catch and GetCVarBool("scriptErrors") == "1" then
ScriptErrorsFrame_OnError(catch, false)
end
end
end
for _, loadFunc in pairs(self.nonAddonsToLoad) do
local _, catch = pcall(loadFunc)
if catch and GetCVarBool("scriptErrors") == "1" then
ScriptErrorsFrame_OnError(catch, false)
end
end
wipe(self.nonAddonsToLoad);
end
S:RegisterEvent("ADDON_LOADED");
local function InitializeCallback()
S:Initialize()
end
E:RegisterModule(S:GetName(), InitializeCallback)
@@ -0,0 +1,3 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Tooltip.lua"/>
</Ui>
@@ -0,0 +1,42 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local TT = E:NewModule("Tooltip", "AceHook-3.0", "AceEvent-3.0");
--Cache global variables
--Lua functions
local unpack = unpack
--WoW API / Variables
function TT:SetStyle(tt)
E:SetTemplate(this, "Transparent", nil, true)
local r, g, b = this:GetBackdropColor()
this:SetBackdropColor(r, g, b, self.db.colorAlpha)
end
function TT:CheckBackdropColor()
if not GameTooltip:IsShown() then return end
local r, g, b = GameTooltip:GetBackdropColor()
if r and g and b then
r = E:Round(r, 1)
g = E:Round(g, 1)
b = E:Round(b, 1)
local red, green, blue = unpack(E.media.backdropfadecolor)
if r ~= red or g ~= green or b ~= blue then
GameTooltip:SetBackdropColor(red, green, blue, self.db.colorAlpha)
end
end
end
function TT:Initialize()
self.db = E.db.tooltip
if E.private.tooltip.enable ~= true then return end
E.Tooltip = TT
end
local function InitializeCallback()
TT:Initialize()
end
E:RegisterModule(TT:GetName(), InitializeCallback)