From 3a6438dd514610b9fce2a3292e28006401127cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Sat, 28 Jul 2018 11:55:02 +0200 Subject: [PATCH] Initial commit --- Gio_ElvUI.toc | 12 +++++++++++ README.md | 7 +++++++ main.lua | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 Gio_ElvUI.toc create mode 100644 README.md create mode 100644 main.lua diff --git a/Gio_ElvUI.toc b/Gio_ElvUI.toc new file mode 100644 index 0000000..805585c --- /dev/null +++ b/Gio_ElvUI.toc @@ -0,0 +1,12 @@ +## Interface: 80000 +## Title: Gio |cff00ffffElvUI|r +## Author: Gio +## Credit: Blazeflack, Elv, WA Discord +## Version: 1.0 +## Notes: Cosas nasis de la ElvUI +## RequiredDeps: ElvUI +## LoadOnDemand: 1 +## LoadWith: ElvUI +## X-eMail: xergio@gmail.com + +main.lua diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce7d172 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ + +ElvUI: https://git.tukui.org/elvui/elvui + +My Mod: + +- Player power bar color + bg +- Class bar color + bg diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..c068968 --- /dev/null +++ b/main.lua @@ -0,0 +1,55 @@ + +local E, L, V, P, G = unpack(ElvUI) +local _G = _G +local UF = E:GetModule("UnitFrames") +local hooksecurefunc = hooksecurefunc +local MAX_COMBO_POINTS = MAX_COMBO_POINTS + +local color = { + r = 1, + g = 1, + b = 1 +} + +local bgColor = { + r = 0.1, + g = 0.1, + b = 0.1 +} + +-- PowerBar +local function hook_PostUpdatePower(self) + self:SetStatusBarColor(color.r, color.g, color.b) + self.bg:SetVertexColor(bgColor.r, bgColor.g, bgColor.b) +end + +local f = CreateFrame("Frame") +f:RegisterEvent("PLAYER_ENTERING_WORLD") +f:SetScript("OnEvent", function(self) + self:UnregisterEvent("PLAYER_ENTERING_WORLD") + + local unitframe = _G["ElvUF_Player"] + + local power = unitframe and unitframe.Power + if power then + hooksecurefunc(power, "PostUpdate", hook_PostUpdatePower) + end +end) + +-- ClassBar +local function hook_Configure_ClassBar(self, frame) + local bars = frame[frame.ClassBar] + if not bars then return end + + if (frame.ClassBar == 'ClassPower' or frame.ClassBar == 'Runes') then + local maxClassBarButtons = max(UF.classMaxResourceBar[E.myclass] or 0, MAX_COMBO_POINTS) + for i = 1, maxClassBarButtons do + if i <= frame.MAX_CLASS_BAR and bars[i].bg then + bars[i]:SetStatusBarColor(color.r, color.g, color.b) + bars[i].bg:SetVertexColor(bgColor.r, bgColor.g, bgColor.b) + end + end + end +end + +hooksecurefunc(UF, "Configure_ClassBar", hook_Configure_ClassBar)