Go to Page... |
Updated: | 08-10-09 11:52 AM |
Created: | 01-05-09 08:38 PM |
Downloads: | 5,638 |
Favorites: | 24 |
MD5: |
oUF_DruidHots is an oUF extension that adds a set of colored box "indicators" to the top of enabled frames to show you all of your current Druid heal-over-time spells.
As a healer I missed the indicators I used to use in Grid. Since I now use a custom oUF layout instead of Grid or Pitbull, I decided to hack something together. What started out as a quick little lifebloom timer quickly blossomed into a full blown Druid HOT timer.
The image shows how it looks and what they each mean. It attaches the indicators to the top left of the Health bar.
There are a few things I still want to implement:
* Some kind of indication when the Hot is about to expire. I’m going to play with blinking, fades, borders, etc. to see what works best.
* Better configuration for layout authors. Right now everything (indicator size, color, offset, spacing, ordering) are all hard-coded. I’ll put the config in a table an oUF layout author can embed in his layout code.
As with all oUF extensions, it requires that you have oUF (the base frame framework) and an oUF layout (the definition of how you want your player/party/raid frames to look) installed.
Comment Options |
PProvost |
View Public Profile |
Send a private message to PProvost |
Visit PProvost's homepage! |
Find More Posts by PProvost |
Add PProvost to Your Buddy List |
01-15-10, 10:56 AM | |||
A Kobold Labourer
Forum posts: 0
File comments: 2
Uploads: 0
|
if j==3 then anchor, anchorPoint, x, y = object.Health, "TOPLEFT", offsetX, offsetY-5 else anchor, anchorPoint, x, y = tex, "TOPRIGHT", spacing, 0 end it´s not the best way to do that but works for now. i wanna add two more indicators, one for thorns and another for gift of the wild or mark of the wild, where can i start searching for the name of those textures?
Last edited by mandaji : 01-15-10 at 10:58 AM.
|
||
|
mandaji |
View Public Profile |
Send a private message to mandaji |
Visit mandaji's homepage! |
Find More Posts by mandaji |
Add mandaji to Your Buddy List |
01-15-10, 11:25 AM | ||
A Kobold Labourer
Forum posts: 0
File comments: 2
Uploads: 0
|
here the entire code now: --[[ Name: oUF_DruidHots Description: Provides Druid HoT indicators across the top of the unit frame To disable the indicators for a given frame, set ignoreDruidHots to any non-nil value, e.g.: frame.ignoreDruidHots = true Copyright 2008 Quaiche Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]] local parent = debugstack():match[[\AddOns\(.-)\]] local global = GetAddOnMetadata(parent, 'X-oUF') local oUF = _G[global] or oUF local UnitBuff = _G.UnitBuff local GetTime = _G.GetTime assert(oUF, 'oUF not loaded') if select(2,UnitClass("player")) ~= "DRUID" then return end local debugf = tekDebug and tekDebug:GetFrame("oUF_DruidHots") local function Debug(...) if debugf then debugf:AddMessage(string.join(", ", tostringall(...))) end end -- Icon textures for local-neutral identification of buffs local LIFEBLOOM = "Interface\\Icons\\INV_Misc_Herb_Felblossom" local REGROWTH = "Interface\\Icons\\Spell_Nature_ResistNature" local REJUVENATION = "Interface\\Icons\\Spell_Nature_Rejuvenation" local WILDGROWTH = "Interface\\Icons\\Ability_Druid_Flourish" local THORNS = "Interface\\Icons\\Spell_Nature_Thorns" local MARK = "Interface\\Icons\\Spell_Nature_Regeneration" local GIFT = "Interface\\Icons\\Spell_Nature_GiftoftheWild" -- Configuration local width, height = 4, 3 local offsetX, offsetY = 5, -2 local spacing = 2 local order = {WILDGROWTH , REGROWTH, REJUVENATION , LIFEBLOOM, THORNS, MARK, GIFT } local hots = { [LIFEBLOOM] = { count = 3, color = { r=0, g=1.0, b=0 }, }, [REGROWTH] = { count = 1, color = { r=0, g=0, b=1 }, }, [REJUVENATION] = { count = 1, color = { r=1, g=1, b=0 }, }, [WILDGROWTH] = { count = 1, color = { r=1, g=0.5, b=0 }, }, [THORNS] = { count = 1, color = { r=.1, g=1, b=.1 }, }, [MARK] = { count = 1, color = { r=1, g=0, b=1 }, }, [GIFT] = { count = 1, color = { r=1, g=0, b=1 }, }, } local function SetStatus(object, texture, count, remaining) for i=1,hots[texture].count do if hots[texture].count > 1 and count >= i then object.druidHotsIndicators[texture][i]:Show() else object.druidHotsIndicators[texture][i]:Hide() end end end local state = {} -- Temp table to avoid memory thrashing local function Update(object, event, unit) if object.unit ~= unit then return end local i = 1 state[LIFEBLOOM] = 0 state[REGROWTH] = 0 state[REJUVENATION] = 0 state[WILDGROWTH] = 0 state[THORNS] = 0 state[MARK] = 0 state[GIFT] = 0 while true do local name, _, texture, count, _, _, expirationTime, caster = UnitBuff(unit, i, true) local isMine = (caster == "player") if not name then break end if isMine and hots[texture] then local timeleft = expirationTime - GetTime() if texture == LIFEBLOOM then state[texture] = count else state[texture] = 1 end end i = i + 1 end for k,v in pairs(state) do for i=1,hots[k].count do if i <= state[k] then object.druidHotsIndicators[k][i]:Show() else object.druidHotsIndicators[k][i]:Hide() end end end end local function initialize(object) if object.ignoreDruidHots or object.druidHotsIndicators then return end local i,j,k local tex local anchor, anchorPoint, x, y = object.Health, "TOPLEFT", offsetX, offsetY object.druidHotsIndicators = {} for j = 1,#order do k = order[j] object.druidHotsIndicators[k] = {} for i = 1,hots[k].count do tex = object.Health:CreateTexture(nil, "OVERLAY") tex:SetPoint("TOPLEFT", anchor, anchorPoint, x, y) tex:SetTexture(hots[k].color.r, hots[k].color.g, hots[k].color.b) tex:SetHeight(height) tex:SetWidth(width) tex:Hide() if j==3 then anchor, anchorPoint, x, y = object.Health, "TOPLEFT", offsetX, offsetY-5 else anchor, anchorPoint, x, y = tex, "TOPRIGHT", spacing, 0 end table.insert(object.druidHotsIndicators[k],tex) end end object:RegisterEvent("UNIT_AURA", Update) end -- Initialize the extension for existing frames and register for subsequent frames for k, object in ipairs(oUF.objects) do initialize(object) end oUF:RegisterInitCallback(initialize) |
|
|
mandaji |
View Public Profile |
Send a private message to mandaji |
Visit mandaji's homepage! |
Find More Posts by mandaji |
Add mandaji to Your Buddy List |
04-28-10, 09:34 PM | ||
A Cyclonian
Forum posts: 40
File comments: 195
Uploads: 0
|
Hi to you mate, will you be kind enough to show us how to add abolish poison too? thanks =)
|
|
|
strickland |
View Public Profile |
Send a private message to strickland |
Visit strickland's homepage! |
Find More Posts by strickland |
Add strickland to Your Buddy List |
04-30-10, 08:31 PM | |
A Cyclonian
Forum posts: 40
File comments: 195
Uploads: 0
|
No Duration for the hots? please can someone explain how to enable duration if there is anyway to do it
|
|
strickland |
View Public Profile |
Send a private message to strickland |
Visit strickland's homepage! |
Find More Posts by strickland |
Add strickland to Your Buddy List |