KuiNameplates Pandemic Mod

Pimp your interface.

Moderator: Forum Administrators

Post Reply
Kojiyama
Revered
Posts: 478
Joined: Mon Jan 19, 2015 1:47 pm

KuiNameplates Pandemic Mod

Post by Kojiyama » Fri Mar 11, 2016 9:26 pm

Couple people have asked me for this on Discord, so just posting here.

This is a very simple Lua mod for KuiNameplates that will make the duration text turn red on the spell pandemic rather than on the arbitrary 5 second time used for all auras by default.

Since this is a custom change, you will have to re-apply whenever the addon is updated--but it should be very simple. Note: This mod is intended to be for easy C&P and isn't really totally optimized.

Open the following file in a text editor: Interface\AddOns\Kui_Nameplates_Auras\auras.lua

Search for "red text" or go to ~line 230. There should be a code block that looks like:

Code: Select all

            if timeLeft <= 5 then
                -- red text
                self.time:SetTextColor(1,0,0)
            elseif timeLeft <= 20 then
                -- yellow text
                self.time:SetTextColor(1,1,0)
            else
                -- white text
                self.time:SetTextColor(1,1,1)
            end
All you need to do is change this top bit to:

Code: Select all

            local spellPandemics = { [155625]=4.2, [155722]=4.5, [1079]=7.2, [106830]=4.5 }
            if spellPandemics[self.spellId] ~= nil then
                if timeLeft <= spellPandemics[self.spellId] then
                    self.time:SetTextColor(1,0,0)
                else
                    self.time:SetTextColor(1,1,1)
                end
            elseif timeLeft <= 5 then
                -- red text
                self.time:SetTextColor(1,0,0)
                ...
Pretty straightforward. If you are into performance and are comfortable, you can instead move the array containing the list of values up a few lines to:

Code: Select all

local spellPandemics = { [155625]=4.2, [155722]=4.5, [1079]=7.2, [106830]=4.5 }
local function OnAuraUpdate(self, elapsed)
Not the biggest deal in the universe, though.

Hope that helps! :)
Image

Post Reply