KGPanels Scripts target
HIyas, Im trying to make a panel (for target UF to be class colored). Meaning, does anyone know the script to make a panel the TARGETS class color? My thanks, in advance for any and all help~
Fake edit: I tried the page at wowace, but no one ever answers questions there >.< |
Writing one, just a sec.
Edit: Code:
-- OnLoad |
Quote:
/edit: you also need to change the OnEvent (btw, checking for the event isn't needed since we're only registering for one event anyway) Code:
-- OnEvent |
Pssh :P Thanks Seerah
|
My thanks, ever so much, both of you~ :banana::rolleyes::D:banana:
|
Quote:
|
A bit more compact, should work:
-- OnEvent Code:
local _, Class = UnitClass("target") -- OnEvent Code:
local _, Class = UnitClass("target") |
How lame is it that I spent 2.5 hours trying to figure this out, lol?
My thanks, Nibleheim, it's much appreciated~ |
This is doing the same thing.....it's fine if I click on target to target, but everytime I DEselect a target (no target at all) it throws a huge error >.<
Message: [string "a_OnEvent"]:3: attempt to index local 'Color' (a nil value) Time: 01/27/11 00:57:24 Count: 3 Stack: [string "a_OnEvent"]:3: in function <[string "a_OnEvent"]:1> [C]: in function `CameraOrSelectOrMoveStop' [string "CAMERAORSELECTORMOVE"]:4: in function <[string "CAMERAORSELECTORMOVE"]:1> Locals: self = kgPanel1 { 0 = <userdata> missing_parent_at_load = false missing_anchor_at_load = false text = <unnamed> { } bg = <unnamed> { } scripts_loaded = false Is the gist of it. |
Quote:
Code:
if UnitExists("target") then |
You know, may as well go all the way :p
Colored by Pet, Player, Hostility. Code:
local Color = {r = 1, g = 1, b = 1}; |
That worked perfectly. You have my thanks, and my gratitude, hero~
|
Rofl, now this got me thinking if theres a script to show pets happiness?
Edit: To change a panels color depending on pets happiness, i.e red/yellow/green. |
Quote:
Code:
local Color = {r = 1, g = 1, b = 1} |
Quote:
Code:
if movementspeed == 0 then |
Quote:
Code:
local FrameToHide = Minimap Reason you need another panel, is that when you hide a frame, it's OnUpdate scripts no longer work. Adjust MovementTimer.ToggleDelay to your liking. It's how long in seconds after you stop to hide the Minimap. |
The pet panel didnt work ( in onload/onevent/onupdate) but it showed no errors, so it was ME that did something wrong, lol. I'm not getting it, and that frustrates me SOOOO much, rofl. Anyhow, I did want to say thank you, the time and effort was MUCH appreciated =)
|
Quote:
-- OnLoad Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local Color = {r = 1, g = 1, b = 1} |
Simply said, you rock. Thanks again! :eek:
Still can't get it to fire, tho. >.< Was going to put a cropped screenie here to show you, but am not intelligent to figure out how~ |
Quote:
Code:
self.bg:SetVertexColor(Color.r, Color.g, Color.b, 1) |
All times are GMT -6. The time now is 12:55 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI