WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Tutorials & Other Helpful Info. (http://www.wowinterface.com/forums/forumdisplay.php?f=12)
-   -   How to skin Deadly Boss Mods (without rewriting) (http://www.wowinterface.com/forums/showthread.php?t=33235)

Wildbreath 06-17-10 05:49 AM

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 :)

Haleth 06-18-10 05:20 AM

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?

sacrife 06-18-10 07:49 AM

Now this is interesting :)

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

Wildbreath 06-19-10 12:01 AM

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 :))

Haleth 06-19-10 05:17 AM

Ah yeah, I got it now. Good job, this is a really easy way to restyle DBM. :)

Seerah 06-19-10 10:20 AM

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


ladyofdragons 09-09-10 07:30 AM

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. ^__^

nin 09-09-10 08:04 AM

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)

Quote:

Also what is "fsize" for?
fontsize

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

-_-v

nin 09-18-10 04:53 PM

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 :D

thanks.

Zagrei 09-18-10 08:41 PM

Quote:

Originally Posted by nin (Post 206593)
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 :D

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 ;)

Wimpface 09-19-10 12:15 AM

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! :eek:

Haleth 09-19-10 02:47 AM

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?

Haleth 10-23-10 02:55 AM

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.

Wildbreath 11-10-10 06:38 AM

Ouch :eek:

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.

Haleth 11-20-10 12:51 PM

Good to hear. :)

Any news on it?

sacrife 01-14-11 03:51 PM

Does anyone have something similar for Bigwigs?

sacrife 02-09-11 12:28 AM

Anyone figured out how to do it with the newest DBM yet?

Zagrei 02-09-11 09:15 AM

Quote:

Originally Posted by sacrife (Post 226736)
Does anyone have something similar for Bigwigs?

Quote:

Originally Posted by sacrife (Post 229090)
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

Unkn 02-09-11 09:46 AM

1 Attachment(s)
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.

nin 02-09-11 12:19 PM

Quote:

Originally Posted by Zagrei (Post 229134)
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.


All times are GMT -6. The time now is 07:14 PM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC