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) |
Yes! I can't believe I didn't change that, especially after the problems I had between panels and borders, I'm an idiot.
Thank you very much, hero, you've made my evening~ :banana: :banana: :banana: :banana: :banana: |
I hate to ask, Nibleheim, seeing as you've already repaired everything that I was unable to in my personal ui......but, would you happen to know the script, to call a panel based on stance? I.e., bear form, cat form, prot spec/ret spec, aspect of the suck (cheetah) etc? I would be ever so grateful, and would send loads of cookies. :D
|
Quote:
To set color based on stance: -- OnLoad Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
if not self.StanceTable then To show a panel based on stance: -- OnLoad Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD") Code:
local DefaultFrame = kgPanels:FetchFrame("MyDefaultPanelName") Edit: All this is completely untested, but hopefully it works and/or it'll provide a base for you to get it to work. I think I'm out of here :) |
Perfect! Thanks Nibelheim that was exactly what I was looking for.Not Moving with a target.Idle no targetMoving. Much love...many cookies!
|
Quote:
ive found you scripts google'ing xD i want to ask if this code can be done also for party/raid members. i mean the classcolor border for each player in party or raid. it is possible? :) ty very much ^^ |
Just change the part where it says "target" (UnitExists("target"), UnitClass("target")), to "party1", "party2", "party3", "party4", and then raid1 thru raid40 (or however high you want to go).
|
Quote:
so, are something like that in the On Event section: if UnitExists("party1") then local _, Class = UnitClass("party1") local Color = RAID_CLASS_COLORS[Class] or {r = 1, g = 1, b = 1} self:SetBackdropBorderColor(Color.r, Color.g, Color.b, self.bg:GetAlpha()) end and in On Load Section? local _,class = UnitClass("party1") ? ^^' EDIT: its work, but only with party1 frame :| what's wrong? |
All times are GMT -6. The time now is 11:51 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI