Thread Tools Display Modes
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.
  Reply With Quote
06-18-10, 05:20 AM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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?
  Reply With Quote
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
__________________

  Reply With Quote
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 )
  Reply With Quote
06-19-10, 05:17 AM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote
06-19-10, 10:20 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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

  Reply With Quote
09-09-10, 07:30 AM   #7
ladyofdragons
A Kobold Labourer
 
ladyofdragons's Avatar
Join Date: Apr 2009
Posts: 1
Question

This is really great to see and I really want to put it into practice. I'm totally new to LUA though, can anyone give an example of what this looks like with the media names added? I'm not quite sure which text exactly to swap out and for what to put in. EG, Do I remove "settings.font" entirely (or just "font") and put the font name there, and if file locations are required is there a specific format?

Also what is "fsize" for? Thanks. ^__^
  Reply With Quote
09-09-10, 08:04 AM   #8
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
Depends a little on how you assign media too your addon(s).

I and a lot of users have a folder for media wich we direct most addons too... or sharedmedia (im not gonna give you any suggestion on sharedmedia since i dont use it myself) but you can use sharedmedia in combination with this.

with the way i do it, It would look something like this..(i use gxMedia from guardix because i use some of his addons and wanted my dbm the same style)

Code:
local gxMedia = gxMedia or {
	bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
	buttonOverlay = [=[Interface\Buttons\UI-ActionButton-Border]=],
	edgeFile = [=[Interface\Addons\gxMedia\media\backdropedge]=],
	font = [=[Fonts\FRIZQT__.TTF]=],
	statusBar = [=[Interface\AddOns\gxMedia\media\statusbar]=],
}
so assigning the statusbar too say progress would look like this

Code:
progress:SetStatusBarTexture(gxMedia.statusBar)
and font

Code:
name:SetFont(gxMedia.font, 14)
You can also assign fonts/statusbars etc like this

Code:
local font = "path to font"
local statusbar = "path to texture"
then the code too assign them would look like this.

Code:
progress:SetStatusBarTexture(statusbar)
and font

Code:
name:SetFont(font, 14)
another example of doing it..

Code:
progress:SetStatusBarTexture(Interface\\AddOns\\!media\\statusbar)
and font

Code:
name:SetFont(Interface\\AddOns\\!media\\fonts\\font.ttf, 14)

Also what is "fsize" for?
fontsize

Hope it was of some help, sorry for the wall of text.

-_-v
  Reply With Quote
09-18-10, 04:53 PM   #9
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
This way of skinning dbm is causing me MASSIVE performance issues in raids. on some encounters i can't even move and today i finally found out that this was the cause..

Anyone else experienced this or know why its causing my game too lag like crazy...because i like being able too skin dbm without updating.. lazy as i am

thanks.
  Reply With Quote
09-18-10, 08:41 PM   #10
Zagrei
A Cobalt Mageweaver
 
Zagrei's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2009
Posts: 246
Originally Posted by nin View Post
This way of skinning dbm is causing me MASSIVE performance issues in raids. on some encounters i can't even move and today i finally found out that this was the cause..

Anyone else experienced this or know why its causing my game too lag like crazy...because i like being able too skin dbm without updating.. lazy as i am

thanks.
I have the same problem. I had to turn it off and just use ugly ol' DBM because it's kinda hard to tank Sindragosa when your screen is frozen for 5+ seconds at a time
__________________
  Reply With Quote
09-19-10, 12:15 AM   #11
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
I've noticed this exact same problem. It was so bad it wiped our ICC10 group twice on Blood Queen when she flew up into the air, due to me completely freezing.

I loved this modification and can barely live without it, we need a fix to this!
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-19-10, 02:47 AM   #12
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
It's the same for me, a couple of FreeUI users have pointed out this was the cause.

I'm thinking some sort of CPU leak because of a part of the code that loops, but I'm not sure.

Anyone have any ideas?
  Reply With Quote
10-23-10, 02:55 AM   #13
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Bump. Nobody have any ideas as to what to do to fix this?

DBM looks fugly without it, I don't want to have to switch to DXE.
  Reply With Quote
11-10-10, 07:38 AM   #14
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Ouch

I wasnt raiding more than 4 months, just pvping, maybe author of DBM was updated it - that why alot of lags. Will check DBM code and rewrite script soon.
  Reply With Quote
11-20-10, 01:51 PM   #15
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Good to hear.

Any news on it?
  Reply With Quote
01-14-11, 04:51 PM   #16
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Does anyone have something similar for Bigwigs?
__________________

  Reply With Quote
02-09-11, 01:28 AM   #17
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
Anyone figured out how to do it with the newest DBM yet?
__________________

  Reply With Quote
02-09-11, 10:15 AM   #18
Zagrei
A Cobalt Mageweaver
 
Zagrei's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2009
Posts: 246
Originally Posted by sacrife View Post
Does anyone have something similar for Bigwigs?
Originally Posted by sacrife View Post
Anyone figured out how to do it with the newest DBM yet?
I'm interested as well, my bossmods are the only thing not completely skinned in my UI... it bothers my OCD tendencies o_O
__________________
  Reply With Quote
02-09-11, 10:46 AM   #19
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Necro... but I've got an edit of the template I made that I've been using for a few months with DBM.

http://pastebin.com/URAhJpqw

Pic showing the bars. I do not use the right icon so it hasn't been moved. But thats not hard to do.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_020911_114324.jpg
Views:	2030
Size:	321.3 KB
ID:	5725  
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"

Last edited by Unkn : 02-09-11 at 03:19 PM. Reason: added the "with DBM" part :)
  Reply With Quote
02-09-11, 01:19 PM   #20
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
Originally Posted by Zagrei View Post
I'm interested as well, my bossmods are the only thing not completely skinned in my UI... it bothers my OCD tendencies o_O
For bigwigs you can create a style as a seperate addon.
  Reply With Quote

WoWInterface » 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