View Single Post
11-27-10, 10:00 AM   #1
.SkyBreaker
A Murloc Raider
 
.SkyBreaker's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 5
Help with Scripting - kgPanels

Hey all out there,

I think I need some help with scripting for the addon kgPanels...

For my interface I want to set up kgPanels for in and out vehicle use.
I want to show up a specific Panel if you're not in a vehicle, and another panel if you're in one.

For now, the script I use... work... sometimes. That suck... Looks like this now:

OnLoad (Panel 1 and 2):
self:RegisterEvent ("UNIT_ENTERED_VEHICLE")
self:RegisterEvent ("UNIT_EXITED_VEHICLE")


OnEvent (Panel 1):
if event == "UNIT_ENTERED_VEHICLE" then
self:Hide()
elseif event == "UNIT_EXITED_VEHICLE" then
self:Show()
end


OnEvent (Panel 2):
if event == "UNIT_ENTERED_VEHICLE" then
self:Show()
elseif event == "UNIT_EXITED_VEHICLE" then
self:Hide()
end


Sometimes it's just inversed... Or just switch in mid fight in Battlegrounds (when someone else uses a vehicle?)
I was thinking about something about "in" or "not in" vehilce instead of "entered" or "exited" or something that only counts for my self... Don't know, but I don't find anything related to that.

Maybe you know something about that...
  Reply With Quote