Thread Tools Display Modes
11-25-09, 04:43 PM   #1
Shanyn
A Deviate Faerie Dragon
Join Date: Nov 2009
Posts: 16
Quartz - setting castingcolor externally. How?

I was browsing UIs when I came across LUI, which does something interesting with Quartz--it uses a kgpanels script to set the Latency indicator color to your class color. "Cool," I thought. "I want to adapt that to set the whole bar the class color."

So here's what I have in my kgpanels script, adapted from the LUI compilation:

Code:
local class = UnitClass("player")
lagVertexColor = {RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, 1}

local db = Quartz:AcquireDBNamespace("Latency")
db.profile.lagcolor=lagVertexColor
db.profile.lagalpha=1
Quartz.ApplySettings()
This works just fine--it changes the LATENCY indicator color as intended.

Now, I'm not all that incredible with scripting just yet, but I poked around Quartz's code to see how I could change this to change castingcolor (the variable name for the regular casting bar color). I can't figure it out. It doesn't seem to be working with the AcquireDBNamespace, because this particular variable is NOT stored in any particular namespace at all in the SavedVariables. So, I'm stumped and would really appreciate if I could get a bit of help.

Teach a lady to fish and all that.

Thanks in advance.
  Reply With Quote
11-25-09, 05:02 PM   #2
Marroc
Premium Member
Premium Member
Join Date: Aug 2008
Posts: 3
Code:
local class = UnitClass("player")
playerVertexColor = {RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, 1}

local db = Quartz:AcquireDBNamespace("Player")
db.profile.playercolor=playerVertexColor
db.profile.playeralpha=1
Quartz.ApplySettings()
Should do it.

edit:
on second thought, maybe not... After looking around in Quartz's code, it appears that there are no color options for the player cast bar at all. (ie. the Quartz_Latency addon has a color variable, but Quartz_Player does not).

Last edited by Marroc : 11-25-09 at 05:05 PM.
  Reply With Quote
11-25-09, 05:07 PM   #3
Shanyn
A Deviate Faerie Dragon
Join Date: Nov 2009
Posts: 16
Thanks! Sadly, no. There is no such variable as playercolor in Quartz.

Here is how the player cast bar is colored in Quartz's Player.lua:
Code:
castBar:SetStatusBarColor(unpack(Quartz.db.profile.castingcolor))
I'm absolutely certain that the variable I want is called castingcolor (i.e. not playercolor), but so far no variation of db.profile.castingcolor = lagVertexColor has worked at all. My only guess is because castingcolor is NOT defined under any namespace in the SavedVariables file, therefore none of the local db = Quartz:AcquireDBNamespace("StuffGoesHere") gives me the castingcolor variable to play with. This is what I'm looking for help on. ^^;

Edit: To show what I mean about castingcolor not being defined under a namespace, here's a very abbreviated sampling of the SavedVariables--
Code:
QuartzDB = {
   ["namespaces"] = {
      ["Latency"] = {
         ["profiles"] = {
            ["profilename"] = {
               lagcolor = some numbers
            }
         }
      }
   }
   ["profiles"] = {
      ["profilename"] = {
         ["castingcolor"] = some numbers
      }
   }
}

Last edited by Shanyn : 11-25-09 at 05:11 PM.
  Reply With Quote
11-25-09, 06:16 PM   #4
harrellj
A Flamescale Wyrmkin
Join Date: Jul 2009
Posts: 132
As a coder, but not LUA capable or having a copy of Quartz's code to look at, instead of using AcquireDBNamespace, what about AcquireDBProfile("Player")?
  Reply With Quote
11-25-09, 06:21 PM   #5
Shanyn
A Deviate Faerie Dragon
Join Date: Nov 2009
Posts: 16
Tried it and a bunch of variations. Nothing. I don't believe the function exists. Thanks for the shot in the dark, at any rate!

Edit: Problem solved. On a whim, I decided to try deleting the AcquireDBNamespace bit altogether and just tried Quartz.db.profiles.castingcolor = my variable. It worked. I'm not sure if there's any particular downside to doing it this way--by all means, yell as me if it's going to break wow--but it seems I fixed it. Thanks to Marroc and harrellj for offering opinions!

Last edited by Shanyn : 11-25-09 at 06:32 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Quartz - setting castingcolor externally. How?


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