local adjustCastbars = function()
for i, castbar in pairs(NN_ARENABARS) do
castbar:SetScale(aura_env.config.scale)
castbar:SetPoint("TOPRIGHT", aura_env.region, "TOPLEFT",0,-(i-1)*aura_env.config.gap)
end
end
I wanted to add a custom option like
castbar:SetColorTexture( r, g, b, a)
but Im not sure if I also need to add (aura_env.config.color) somewhere. I guess I do but now sure where exactly.
color is the option key I put into my custom options. I have created a color picker there.
entire code looks like this:
local refreshMembers = function()
for index, castbar in pairs(NN_ARENABARS) do
castbar:SetUnit("arena"..index)
end
end
local createCastbars = function()
NN_ARENABARS = {}
for i=1,5 do
local castbar = CreateFrame("StatusBar", "CustomArena"..i.."SpellBar", UIParent, "ArenaUnitFrameCastingBarTemplate");
castbar:SetUnit("player")
tinsert(NN_ARENABARS, castbar)
end
end
if not NN_ARENA_CASTBARS_CREATED then
hooksecurefunc(CompactArenaFrame, "RefreshMembers", function(self)
refreshMembers()
end)
createCastbars()
refreshMembers()
NN_ARENA_CASTBARS_CREATED = true
end
--adjust scale and position from custom options
adjustCastbars()
I tried a few different approaches. But I dont even know if the SetColorTexture is correct. I tried removing custom options and replace rgb with numbers. Didnt work either. If i could put a color code in here somewhere I wouldnt need a color picker although I would prefer one.
Also im not sure how to link it here to show code colors. This code works 100% for me without any bugs. It has custom option for scaling and spacing. It cant be that hard to add coloring too. Any help is greatly appreciated. Cheers
thank you very much for this. I tested it and it changes the color. But this affects only the background of the progress bar.
I did use /fstack for my player cast bar (doesnt matter I assume because its the same textures for target/player/party etc.). The default cast bar consists of many layers.
I will try to add an additional line instead that replaces background with Border and see how it goes.
I also removed the custom color option and will change colors from now on directly in the code.
Thanks for leading me to the right track by putting Background in that line. I was using castbar:Set… before.
Thanks for helping, youve helped me before with other things which you probably dont remember but I appreciate it a lot that youre hanging out here and helping the community