Thread: Chat Code Help
View Single Post
08-16-19, 03:47 PM   #2
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
Some notes without looking into all the details; also i dont have a active wow subscription right now so it could be that i am not 100% right with what i am saying. i could read up some Blizzard Code but thats the hard way and i am a bit lazy to do it this way right now

I feel like it could be way way easier instead of hiding all this textures (ButtonFrameBottomTexture, BottomTexture etc) to hide their parent frame, if one exists ofc.

How to get a parent frame? frame:GetParent()
if its the same parent for all your textures just hide your parent, will be much easier todo

Hiding the parent frame will hide all childrens aswell. (Note: difference of frame:IsVisible() and frame:IsShown(). https://wow.gamepedia.com/API_Region_IsShown )

Also I couldnt figure out how to call my number table for "SetupHooks" so I had to put the individual frame number. Maybe there is a way to fix that.
two ways of accessing frames:
1. accesing it via the global Variable. for example: ChatFrame1
2. accessing it in the global table _G. for example _G["ChatFrame1"]. this way also allows you to do all kinds of string manipulation or use a string variable inside the [] .
So in your case the second way would be the prefered one.

Also you need to look up the differnce between global variables and local ones. DHBT is a global variable in your code which means this variable could be accessed and mofified from every other addon by typing _G["DBHT"] or just DHBT = "haha, i have just changed your variable"
If a variable should only exist in a single file define it like this at the beginning of your file: local DHBT = "whatever" if it should only exist inside a function and not even be visible inside the whole file define it the same way but inside the function


i guess thats all i have to say for now. If there is anything else let me know
  Reply With Quote