Thread Tools Display Modes
02-27-12, 06:30 PM   #1
LogicRx
A Murloc Raider
Join Date: Oct 2011
Posts: 5
Quick Question:

Alright so my question pertains to a couple things one involving kgpanels and the other towards the map shape without a huge bulky addon(currently my mem use isn't really an issue but I like to keep things small and its at 5 or 6 mb total for addon use)



^visually, how does it rate so far? I'm no where near being done....due to issues I keep getting held up on lol

so; kgpanels, how would I go about changing the color schemes for border color and gradient background color per class? I tried to find something about it but I couldn't find anything pertinent to these 2 color definitions...

I know it would start in the onLoad function:
Code:
local _, class = UnitClass("player");
	if class == "DEATHKNIGHT" then
          self.bg:SetVertexColor(0.6, 0, 0, self.bg:GetAlpha())
	elseif class == "MAGE" then
          self.bg:SetVertexColor(0.00, 1, 1, self.bg:GetAlpha())
        elseif class == "ROGUE" then
          self.bg:SetVertexColor(1, 0.94, 0.16, self.bg:GetAlpha())
        end
however this doesn't set the right color that I want to change, I'm not sure of the value VertexColor needs to be to change the other 2 values...I'm also pretty sure that self.bg also needs to be self.* for whatever value the * needs to be as well.

As to the map, I don't care about flash or any other fancy nonsense, I just want something to change the shape to a square.

Thanks for the help, these 2 issues have been driving me most of the last week
  Reply With Quote
02-27-12, 09:40 PM   #2
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Check Here (a sample script from the "kgPanels Sample Scripts" page on WoWAce) for class-colored frames.

For your minimap you might try Squeenix. Making the minimap square is about all it does.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
02-27-12, 09:52 PM   #3
LogicRx
A Murloc Raider
Join Date: Oct 2011
Posts: 5
Originally Posted by jeffy162 View Post
Check Here (a sample script from the "kgPanels Sample Scripts" page on WoWAce) for class-colored frames.

For your minimap you might try Squeenix. Making the minimap square is about all it does.
Look at the code in my code box and tell me its not the exact same code that you linked me too man...........
  Reply With Quote
02-28-12, 12:26 AM   #4
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Originally Posted by LogicRx View Post
Look at the code in my code box and tell me its not the exact same code that you linked me too man...........
Yeah, it is. Didn't realize it. Sorry 'bout that. I did notice that it's only supposed to set the color for the frames, though, unless "frame" means everything including the backdrop........
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
02-28-12, 12:26 AM   #5
Othgar
"That" Guy
 
Othgar's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 228
You can also use RAID_CLASS_COLORS to define the color by class. Check out this thread. It's not KG panles but I'm fairly certain that the method I use to define class colors can be used in KG.
__________________


  Reply With Quote
02-28-12, 02:20 AM   #6
Ekaterina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 65
Logic,

I think you're using the wrong method to try and change the background colour.

Try:
Code:
local class = select(2, UnitClass("player"))   -- get the player class
local classColour = CUSTOM_CLASS_COLORS[class] or  RAID_CLASS_COLORS[class] -- get the class colour
local gradientEndColour = { 
	r = 0, 
	g = 0, 
	b = 0, 
	a = 1,
} -- define the 2nd colour for the gradient

self.bg:SetGradientAlpha("VERTICAL", gradientEndColour.r, gradientEndColour.g, gradientEndColour.b, gradientEndColour.a, classColour.r, classColour.g, classColour.b, self.bg:GetAlpha()))  -- To reverse the gradient, swap the gradientEndColour and classColours.
self:SetBackdropBorderColor(classColour.r, classColour.g, classColour.b, self.bg:GetAlpha()))
The source for this was the wonderful Seerah, from the below discussions.

http://www.wowinterface.com/forums/s...ad.php?t=27572
http://saanlem.wowinterface.com/foru...ad.php?t=40240
  Reply With Quote
02-28-12, 03:02 AM   #7
LogicRx
A Murloc Raider
Join Date: Oct 2011
Posts: 5
thank you very much for the help. i have 1 more question; how would i go about setting the show and hide setting of skada, i use the dps main window and threat secondary window, to base off of what these panels do? because as it stands skada still shows after combat has ended but i want it to disappear, not clear just disappear with the frame...i've seen people do it with recount, would it be the same way?

also, doing this method could i have certain frames show for certain classes while they are hidden if another class is active, i think i can using this same method but in the event handler as well...

thanks for your help and i'll post a screen of in combat and out of combat once i'm done.
  Reply With Quote
02-29-12, 04:19 AM   #8
Ekaterina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 65
Hiding Skada out of combat needs to be done via scripting, although there are configuration options to hide while in combat & when solo.

Make sure you have your kgpanels parented to the skada frame. Use /framestack to findout exactly what this is called.

In your kgpanels onload section:
Code:
-- register frame to listen to enter/leave combat
self:RegisterEvent("PLAYER_REGEN_DISABLED")
self:RegisterEvent("PLAYER_REGEN_ENABLED")

Then in the OnEvent section:

Code:
if event == "PLAYER_REGEN_DISABLED" then
-- player has entered combat
  Skada:SetActive(true)
else
  Skada:SetActive(false)
end
Hope that helps
  Reply With Quote
02-29-12, 04:56 AM   #9
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
And, seconding Ekatrina, in OnLoad, don't forget
self:RegisterEvent("PLAYER_ENTERING_WORLD")
__________________
  Reply With Quote
02-29-12, 06:19 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you add PLAYER_ENTERING_WORLD, you should also change the OnEvent script to read:
Code:
if UnitAffectingCombat("player") then
	-- in combat
	Skada:SetActive(true)
else
	-- not in combat
	Skada:SetActive(false)
end
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » UI Screenshots, Feedback and Design Discussion » Quick Question:

Thread Tools
Display Modes

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