Thread Tools Display Modes
04-07-11, 04:38 PM   #1
Remsaa
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 19
wanting to load different artwork per character...

I currently have oUF_Diablo for unit frames and it works quite well with my rogue artwork/UI

However,

I am making new artwork for my Paladin and have also created new target, targettarget, and castbar backgrounds and want them to load instead.

Its easy enough to just go in and change the path that the background is looking for, but how can I add a statement that says "if characters name is" then "load this art/path"

example in the target.lua;

--actionbar background
local createArtwork = function(self)
local t = self:CreateTexture(nil,"BACKGROUND",nil,-8)
t:SetAllPoints(self)
t:SetTexture("Interface\\AddOns\\rTextures\\target")
end

can i just add a "check for character name" before this?

Thanks a bunch guys
  Reply With Quote
04-07-11, 05:00 PM   #2
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
pretty much

if UnitName("player") == "Kraftman" then
--do stuff
else
--do other stuff
end
  Reply With Quote
04-07-11, 06:04 PM   #3
Remsaa
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 19
So would it end up looking like this?

Originally Posted by Remsaa View Post

if UnitName("player") == "Kraftman" then
--actionbar background
local createArtwork = function(self)
local t = self:CreateTexture(nil,"BACKGROUND",nil,-8)
t:SetAllPoints(self)
t:SetTexture("Interface\\AddOns\\rTextures\\target2")
else
--actionbar background
local createArtwork = function(self)
local t = self:CreateTexture(nil,"BACKGROUND",nil,-8)
t:SetAllPoints(self)
t:SetTexture("Interface\\AddOns\\rTextures\\target")
end
Is it that easy or am i missing something?

and thanks so much for your help, great and fast response!

** edit **

didn't work for me, instead it reverted to Blizz's default frame for my target : /

Last edited by Remsaa : 04-07-11 at 06:25 PM.
  Reply With Quote
04-08-11, 08:51 AM   #4
Remsaa
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 19
I also tried;


--actionbar background
local createArtwork = function(self)
local t = self:CreateTexture(nil,"BACKGROUND",nil,-8)
t:SetAllPoints(self)
if UnitName("player") == "Kraftman" then
t:SetTexture("Interface\\AddOns\\rTextures\\target2")
else
t:SetTexture("Interface\\AddOns\\rTextures\\target")
end

Anyone else have a suggestion?
  Reply With Quote
04-08-11, 10:16 AM   #5
Canities
A Wyrmkin Dreamwalker
Join Date: Oct 2007
Posts: 54
Originally Posted by Remsaa View Post
I also tried;


--actionbar background
local createArtwork = function(self)
local t = self:CreateTexture(nil,"BACKGROUND",nil,-8)
t:SetAllPoints(self)
if UnitName("player") == "Kraftman" then
t:SetTexture("Interface\\AddOns\\rTextures\\target2")
else
t:SetTexture("Interface\\AddOns\\rTextures\\target")
end

Anyone else have a suggestion?
Just for clarification, don't forget to change Kraftman to your characters name. If you don't it will not work, unless you actually have a character called Kraftman.
  Reply With Quote
04-08-11, 10:32 AM   #6
Remsaa
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 19
Originally Posted by Canities View Post
Just for clarification, don't forget to change Kraftman to your characters name. If you don't it will not work, unless you actually have a character called Kraftman.
Yea I made sure that was changed to my character name, it apparently broke it because even when not on the character name listed it defaulted to bliz's target frame

I am at work now but I will try taking out the "else" so it looks like this;

--actionbar background
local createArtwork = function(self)
local t = self:CreateTexture(nil,"BACKGROUND",nil,-8)
t:SetAllPoints(self)
t:SetTexture("Interface\\AddOns\\rTextures\\target2")
if UnitName("player") == "Kraftman" then
t:SetTexture("Interface\\AddOns\\rTextures\\target")
end


but I don't know...
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » wanting to load different artwork per character...


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