WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Hiding custon UI when in vehicle! (https://www.wowinterface.com/forums/showthread.php?t=36324)

TuLe 10-27-10 04:08 PM

Hiding custon UI when in vehicle!
 
Hey guys heres my question is there a way to hide my custon UI (kgpanels, bartender etc) and have blizz original default vehicle UI (the one with original artwork for dragons or machines) pop up? All i can have is bartender goin single bar when that hapens! Any mod or scripts that can do this?
Thx a bunch! :banana:

Xubera 10-28-10 12:38 AM

i thought the newest version of bartender allowed you to use the default vehicle bar


either way, if you select the bar you want keybound to your vehicle, lets say that bar has all keys bound '1' through '=' (top of the keyboard). Just select that bar in your Bartender config, and click the tab that says State Configuration. There is a checkbox to make that bar switch to Vehicle assignments when in a vehicle

TuLe 10-29-10 12:27 PM

Thx friend and yes bartender now has an neat function to hide its bars when u jump onto a vehicle but still i need to hide my KGpanels as well. Anyone know how to do this via an script maybe!
Thx

Quokka 10-29-10 01:04 PM

Quote:

Originally Posted by TuLe (Post 215048)
Thx friend and yes bartender now has an neat function to hide its bars when u jump onto a vehicle but still i need to hide my KGpanels as well. Anyone know how to do this via an script maybe!
Thx

you could use
Code:

[vehicleui]hide;show
if it know default macro commands

Seerah 10-29-10 01:13 PM

Not for kgPanels. ;)

You'll need to register for the proper events in your OnLoad script, and in the OnEvent, tell whether to hide or show accordingly.

Alternately, you can parent your textures to the bartender bar/button, if they have altered frame names from the default UI.

Quokka 10-29-10 01:53 PM

The events are

Code:

Panel1:SetScript("OnEvent", function(self, event, ...)
if event == "UNIT_ENTERED_VEHICLE" then
  -- some kg panel command here to hide
else
  -- some kg panel command here to show
end


Panel1:RegisterEvent('UNIT_ENTERED_VEHICLE')
Panel1:RegisterEvent('UNIT_EXITED_VEHICLE')

than something like this should work

If i understood Seerah right

Rilgamon 10-29-10 02:54 PM

Setting the parent of the frames to hide to UIParent should work, too.

Seerah 10-29-10 06:17 PM

UIParent doesn't hide when you enter a vehicle.

Rilgamon 10-30-10 01:48 AM

Quote:

Originally Posted by Seerah (Post 215111)
UIParent doesn't hide when you enter a vehicle.

In the beginning I had a bug in ProcWatch that it did not hide when entering
a vehicle or switching to fullscreen. After changing the main frames parent to
UIParent the problem was gone ... so I thought this was related.

Garual 10-30-10 05:35 AM

Quote:

Originally Posted by Quokka (Post 215065)
than something like this should work

If i understood Seerah right

Yep your right. For every panel set OnLoad:
Code:

self:RegisterEvent('UNIT_ENTERED_VEHICLE')
self:RegisterEvent('UNIT_EXITED_VEHICLE')

and in OnEvent:
Code:

if event == "UNIT_ENTERED_VEHICLE" then
 self:Hide()
else
 self:Show()
end


Wolryr 02-10-19 09:41 PM

Quote:

Originally Posted by Garual (Post 215180)
Yep your right. For every panel set OnLoad:
Code:

self:RegisterEvent('UNIT_ENTERED_VEHICLE')
self:RegisterEvent('UNIT_EXITED_VEHICLE')

and in OnEvent:
Code:

if event == "UNIT_ENTERED_VEHICLE" then
 self:Hide()
else
 self:Show()
end


Sorry to necro this post, but I was just recently testing this as my custom kg panels were having the same issue. I wanted to say Garual's code works fine, but it also makes it so the panels would hide on EVERY unit (party or raid member) entering the vehicleUI state, not only the player.

Do you guys know how to make it so it only hides the panels on PLAYER vehicle ui?

Thanks, and sorry again.

Terenna 02-10-19 10:47 PM

Instead of self:RegisterEvent use self:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player') etc

Wolryr 02-11-19 12:24 PM

Quote:

Originally Posted by Terenna (Post 331548)
Instead of self:RegisterEvent use self:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player') etc

Many thanks! Seems to be working just fine now.

Seerah 02-11-19 12:41 PM

To clarify, this is due to a change in the API in the last 8+ years. ;)


All times are GMT -6. The time now is 12:42 AM.

vBulletin © 2019, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI