Hiya guys, Im brand new to oUF and working with .lua in general and I've gotten some small probs I cant solve myself. One of em is to add sparkle to oUF_Lolzen and the other one is to shrink the size of the bars but only on the sides(lack of english there) I mean like from a bar with the "wight"
Yep, when I looked abit closer to the codes that I putted into my lua I found this "spark:SetTexture"Interface\\CastingBar\\UI-CastingBar-Spark"" wich might point to the wrong dir? Im not sure since its 2 \\ and Im used to 1.
Yep, when I looked abit closer to the codes that I putted into my lua I found this "spark:SetTexture"Interface\\CastingBar\\UI-CastingBar-Spark"" wich might point to the wrong dir? Im not sure since its 2 \\ and Im used to 1.
Nope, dir is just right.
local spark = pp:CreateTexture(nil, "OVERLAY")
that line means that it anchors and creates the text on pp (which is a local to the powerbar)
in other words, you need to put the stuff further down than the powerbar code.
local spark = pp:CreateTexture(nil, "OVERLAY")
that line means that it anchors and creates the text on pp (which is a local to the powerbar)
in other words, you need to put the stuff further down than the powerbar code.
ah! okay, I'll try that :)
Edit: Put it at the buttom of the lua, now I can see my bars etc but I still get the error message and I dont get any "tick"
Interface\AddOns\oUF_Lolzen\layout.lua:104:bad argument #1 to 'strsub' (string expected, got nil)
It's hard to help you without any code, but the error tells you which line it happened on. Do you actually verify that you give string.sub a string? UnitName() can return nil :).
It's not really related to strings, the error you made is related to understanding of the API.
gooxen, we'll need the whole code for that part of your layout, not just those 2 lines. The problem is that |name| is nil, which can happen in any number of cases.
local updateName = function(self, event, unit)
if(self.unit == unit or (not unit and self.unit)) then
local unit = unit or self.unit
local name = UnitName(unit)
local index = GetRaidTargetIndex(self.unit)
if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) or not UnitIsConnected(unit)) then
self.Name:SetTextColor(.6, .6, .6)
else
self.Name:SetTextColor(1, 1, 1)
end
if(unit ~= "targettarget") then
updateLevel(self, event, unit);
end
if(unit == "target") then
if(index) then
self.Name:SetText(ICON_LIST[index].."22|t"..name)
else
self.Name:SetText(name)
end
elseif(self:GetParent():GetName():sub(1, 8) =="oUF_Raid") then
self.Name:SetText(strsub(name,0,4))
else
self.Name:SetText(name)
end
end
end
local updateName = function(self, event, unit)
if(self.unit == unit or (not unit and self.unit)) then
local u = unit or self.unit
local name = UnitName(u)
if not name then return end
if UnitIsTapped(u) and not UnitIsTappedByPlayer(u) or not UnitIsConnected(u) then
self.Name:SetTextColor(.6, .6, .6)
else
self.Name:SetTextColor(1, 1, 1)
end
if u ~= "targettarget" then
updateLevel(self, event, u)
end
if u == "target" then
local index = GetRaidTargetIndex(u)
if index then
self.Name:SetText(ICON_LIST[index].."22|t"..name)
else
self.Name:SetText(name)
end
elseif self:GetParent():GetName():sub(1, 8) == "oUF_Raid" then
self.Name:SetText(name:sub(1,4))
else
self.Name:SetText(name)
end
end
end
attribute:
Code:
"showRaid", true"
Can you specify where in the lua to put that? thanks
---------------
to
---------
does anyone understand that? xD
What I've done with the sparkle problem so far is to add oUF_Sparkle to my interface/addon (D:\spel\World of Warcraft\Interface\Addons) then I copied the code from wowinterface (http://www.wowinterface.com/downloads/info8744-oUF_Spark.html)
local spark = pp:CreateTexture(nil, "OVERLAY")
spark:SetTexture"Interface\\CastingBar\\UI-CastingBar-Spark"
spark:SetBlendMode"ADD"
spark:SetHeight(pp:GetHeight())
spark:SetWidth(pp:GetHeight() * 4)
self.Spark = spark
When that's done and Im starting or /reloadui WoW I get this error message ingame.
Interface\AddOns\oUF_Lolzen\layout.lua:5:attempt to index global 'pp' (a nil value)
What have I done wrong?
also, for the width, change this
where as the number 200 is the width, change that
its found at the top of the lua file
Yep, when I looked abit closer to the codes that I putted into my lua I found this "spark:SetTexture"Interface\\CastingBar\\UI-CastingBar-Spark"" wich might point to the wrong dir? Im not sure since its 2 \\ and Im used to 1.
Thanks!
Nope, dir is just right.
local spark = pp:CreateTexture(nil, "OVERLAY")
that line means that it anchors and creates the text on pp (which is a local to the powerbar)
in other words, you need to put the stuff further down than the powerbar code.
ah! okay, I'll try that :)
Edit: Put it at the buttom of the lua, now I can see my bars etc but I still get the error message and I dont get any "tick"
Updated on WoWI, just wait a bit ;D Wanted to do it Yesterday but couldn't test it due some weird Internetprobs :S
did say further down, not all the way. Anyways, lolzen made it for ya, just update it from his layout.
Anyways, haste, could you fix so the auras can be filtered please?
ye :]
I've gotten like everything to work except when I left the bg this error message came up. Anyone know what it might be?
Interface\AddOns\oUF_Lolzen\layout.lua:104:bad argument #1 to 'strsub' (string expected, got nil)
most be something with this:
elseif(self:GetParent():GetName():sub(1, 8 ) =="oUF_Raid") then
self.Name:SetText(strsub(name,0,4))
because I cant find anything else with strsub in it :p if it helps some?
thats the correct one
It's hard to help you without any code, but the error tells you which line it happened on. Do you actually verify that you give string.sub a string? UnitName() can return nil :).
No it's not.
also, haste, he changed his post
It's not really related to strings, the error you made is related to understanding of the API.
gooxen, we'll need the whole code for that part of your layout, not just those 2 lines. The problem is that |name| is nil, which can happen in any number of cases.
I would like a fix too, of course :O
Btw, how do you do the "Code-Quote"? ^^
Tested and updated on WoWI as well.
[ code ] blablabla [ /code ]