Reply
 
Thread Tools Display Modes
Unread 06-17-10, 05:49 AM   #1
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
How to skin Deadly Boss Mods (without rewriting)

lua Code:
  1. if DBM then
  2.       hooksecurefunc(DBT, "CreateBar", function(self)
  3.          for bar in self:GetBarIterator() do            
  4.             local frame = bar.frame
  5.             frame:SetScale(UIParent:GetScale())            
  6.             local tbar = getglobal(frame:GetName().."Bar")
  7.             local texture = getglobal(frame:GetName().."BarTexture")
  8.             local icon1 = getglobal(frame:GetName().."BarIcon1")
  9.             local icon2 = getglobal(frame:GetName().."BarIcon2")
  10.             local name = getglobal(frame:GetName().."BarName")
  11.             local timer = getglobal(frame:GetName().."BarTimer")
  12.             tbar:SetHeight(16)
  13.             texture:SetTexture(settings.texture)
  14.             texture.SetTexture = function() end
  15.             icon1:SetTexCoord(.1,.9,.1,.9)
  16.             icon2:SetTexCoord(.1,.9,.1,.9)
  17.             name:SetPoint("CENTER")
  18.             name:SetPoint("LEFT", 4, 0)
  19.             name:SetFont(settings.font, settings.fsize, "OUTLINE")
  20.             name.SetFont = function() end
  21.             timer:SetPoint("CENTER")
  22.             timer:SetPoint("RIGHT", -4, 0)
  23.             timer:SetFont(settings.font, settings.fsize, "OUTLINE")
  24.             timer.SetFont = function() end
  25.          end
  26.       end)
  27.  
  28.       hooksecurefunc(DBM.BossHealth, "AddBoss", function(cId, name)
  29.          local i = 1
  30.          while (_G[format("DBM_BossHealth_Bar_%d", i)]) do
  31.             local bar = _G[format("DBM_BossHealth_Bar_%d", i)]
  32.             local background = _G[bar:GetName().."BarBorder"]
  33.             local progress = _G[bar:GetName().."Bar"]
  34.             local name = _G[bar:GetName().."BarName"]
  35.             local timer = _G[bar:GetName().."BarTimer"]
  36.             bar:SetScale(UIParent:GetScale())
  37.             bar:SetHeight(16)
  38.             background:SetNormalTexture(nil)
  39.             progress:SetStatusBarTexture(settings.texture)
  40.             progress:SetPoint("TOPLEFT", bar, "TOPLEFT", 2, -2)
  41.             progress:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -2, 2)
  42.             progress:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -2, 2)
  43.             name:SetPoint("CENTER")
  44.             name:SetPoint("LEFT", 4, 0)
  45.             name:SetFont(settings.font, settings.fsize, "OUTLINE")
  46.             timer:SetPoint("CENTER")
  47.             timer:SetPoint("RIGHT", -4, 0)
  48.             timer:SetFont(settings.font, settings.fsize, "OUTLINE")
  49.             i = i + 1
  50.          end
  51.       end)
  52.    end
where settings.font, fsize, texture - own media
enjoy

Last edited by Wildbreath : 09-05-10 at 10:40 PM.
Wildbreath is offline   Reply With Quote
Unread 06-18-10, 05:20 AM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Mod
Featured
Join Date: Sep 2008
Posts: 1,168
Is this meant as a seperate addon or somewhere in the DBM code?

And could you post a screenie of what it might look like?
Haleth is offline   Reply With Quote
Unread 06-18-10, 07:49 AM   #3
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Now this is interesting

Now do the same for tinydps, cargbags, hBar, nBuffs :P
__________________

sacrife is offline   Reply With Quote
Unread 06-19-10, 12:01 AM   #4
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
1. yes, is separate addon (before need to check DBM loaded)
(да это кусок кода отдельного аддона, не модифицирование ДБМ)

2. sacrife, im lazy, i just show how to do it in DBM
(sacrife, я слишком ленив чтобы делать это в куче других аддонов, я лишь показал как это можно сделать на примере ДБМ)

(soz for my stupid english )
Wildbreath is offline   Reply With Quote
Unread 06-19-10, 05:17 AM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Mod
Featured
Join Date: Sep 2008
Posts: 1,168
Ah yeah, I got it now. Good job, this is a really easy way to restyle DBM.

Last edited by Haleth : 06-19-10 at 05:21 AM.
Haleth is offline   Reply With Quote
Unread 06-19-10, 10:20 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,597
I highly suggest replacing the (deprecated) getglobal() calls with _G table lookups.

getglobal is just this anyway:
Code:
function getglobal(frame)
   return _G[frame]
end
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » How to skin Deadly Boss Mods (without rewriting)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off