Thread Tools Display Modes
02-10-19, 06:17 PM   #1
Wolryr
A Deviate Faerie Dragon
Join Date: Dec 2017
Posts: 16
Question Getting an AddOn frame to hide on VehicleUI

Hello everyone.

Sorry in advance if this is posted in the wrong forum.

I'm looking for a way to hide an AddOn feature, specifically, the Marks Bar from ExorsusRaidTools (that one with the skull, star marks, etc) when my character enters a vehicleUI.

The AddOn has a feature to have that bar hidden during a Pet Battle for example, in its own .lua file: MarksBar.lua

Lua Code:
  1. module.frame:SetBackdrop({bgFile = ExRT.F.barImg})
  2. module.frame:SetBackdropColor(0,0,0,0.8)
  3. module.frame:Hide()
  4. module:RegisterHideOnPetBattle(module.frame)

Since my knowledge in LUA coding is super limited right now, I'm just trying to randomly mess with the .lua file for said MarksBar without luck. Honestly, I don't really know what I'm doing... trying to copy paste pieces of the same code that worked and recreate that, but without luck:

Lua Code:
  1. module.frame:SetBackdrop({bgFile = ExRT.F.barImg})
  2. module.frame:SetBackdropColor(0,0,0,0.8)
  3. module.frame:Hide()
  4. module:RegisterHideOnVehicleUI(module.frame)

I was hoping maybe some of you guys know that AddOn or can lend me a hand. I would really appreciate it if anybody knows how to approach this kind of thing. Just to make so that bar hides itself when entering a vehicleUI and then shows right after leaving it.

(I'm talking about that vehicleUI you get during some bosses or WQ, like that one turtle World Quest from Nola, from when you shot sand out of)

I'm talking about this: https://imgur.com/v7S8mJF



Thanks!

I can upload the original LUA file if needed. I just don't know if I can attach files here, or how.
  Reply With Quote
02-10-19, 07:50 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Code:
RegisterStateDriver(frame, "visibility", "[petbattle][vehicleui] hide; show")
You can either hard code the frame in there or type /fstack to get the frame name and apply the code somewhere else outside of the actual addon.
__________________
AddOns: Tim @ WoWInterface
Characters: Mage, Priest, Devoker, Pally
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List

Last edited by Tim : 02-11-19 at 01:15 PM.
  Reply With Quote
02-10-19, 08:39 PM   #3
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
Wouldn't that code make it show only when the vehicle or pet battle UI is open? And then hide it when he's not pet battling/in a vehicle?
  Reply With Quote
02-10-19, 09:23 PM   #4
Wolryr
A Deviate Faerie Dragon
Join Date: Dec 2017
Posts: 16
Thank you guys for your answers. Will definitely be testing that.
  Reply With Quote
02-11-19, 01:16 PM   #5
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Originally Posted by Terenna View Post
Wouldn't that code make it show only when the vehicle or pet battle UI is open? And then hide it when he's not pet battling/in a vehicle?
Yes, I forgot to adjust it to do the opposite. My post is altered now.
__________________
AddOns: Tim @ WoWInterface
Characters: Mage, Priest, Devoker, Pally
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
02-11-19, 04:36 PM   #6
Wolryr
A Deviate Faerie Dragon
Join Date: Dec 2017
Posts: 16
Originally Posted by Tim View Post
Yes, I forgot to adjust it to do the opposite. My post is altered now.
Awesome, thanks!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Getting an AddOn frame to hide on VehicleUI

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