WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   TellMeWhen - Strata/Framelevel (https://www.wowinterface.com/forums/showthread.php?t=41558)

zoktar 10-08-11 05:05 PM

TellMeWhen - Strata/Framelevel
 
As the title suggests, im having difficulty with strata and framelevels regarding tmw. Theres a place in group settings/position that lets you change Relative To, that currently says UIParent. Im thinking thats the strata right?. And on bottom theres a Frame Level selector from 1-100. So thats the sublevel right?.

It doesnt seem to recognize any other strata lines like BACKGROUND, LOW etc

Seerah 10-08-11 06:52 PM

No, the relative to line would be the anchor frame for positioning. (The x,y coordinates would be relative to that frame.) UIParent is the main frame of your entire UI that spans the whole screen.

SDPhantom 10-08-11 08:12 PM

Frame strata is set by frame:SetFrameStrata() and if undefined defaults to MEDUIM. Framelevel by default is relative to how many parents the frame has. The higher this number, the later the frame is rendered, meaning it draws on top of all the lower frames in the same strata. For example, UIParent has no parent and gets a default framelevel of 1. PlayerFrame has UIParent as its parent, and gets a default frame level of 2, etc. Like frame strata, framelevel can be manually set as well by calling frame:SetFrameLevel(). It's advised to not have 2 frames of the same strata and framelevel overlap each other. The rendering engine is known to mesh elements of such frames together or simply randomly choose one to draw over the other.

Xinhuan 10-08-11 09:02 PM

The rendering engine:

There are 7 stratas. Each strata is completely above the next strata. Frames need to belong to a strata, defaulting to MEDIUM.

Frames further have a frame level. Frame levels determine the rendering order of frames with respect to its parent frame.

Within each frame, there are several layers. Layers determine the rendering order of children textures and fontstrings.


Strata differences override frame levels. So frameA on MEDIUM parented to frameB on HIGH, will cause B to be drawn above A, regardless of framelevels. But visibility, alpha and scaling are controlled by frame parents, so whether A is visible depends entirely on B's visbility/alpha/scaling.

Anchoring of frames is on a totally different hierarchy from parent-child hierarchy. That is, frame positioning is independent of parent-child relationships.

zoktar 10-09-11 10:56 AM

Now i feel bad for not learning lua. Thanks anyway.

zoktar 10-11-11 03:47 AM

alright had another look at this seems

/script TellMeWhen_Group44:SetFrameStrata("BACKGROUND")

works just fine, however when im trying to add it to an addon

TellMeWhen_Group44:SetFrameStrata("BACKGROUND")

and i get

1x Hideframes-v1.0\hideframes.lua:20: attempt to index global 'TellMeWhen_Group44' (a nil value)

and does not change the strata.

Ekaterina 10-11-11 04:55 AM

Your addon is probably being loaded and trying to call the 'TellMeWhen_Group44' before it exits.

You will need to add a check to see if Tell Me When is loaded, and probably register for the addon loaded event.

Torhal 10-11-11 08:02 AM

Quote:

Originally Posted by Ekaterina (Post 245712)
Your addon is probably being loaded and trying to call the 'TellMeWhen_Group44' before it exits.

You will need to add a check to see if Tell Me When is loaded, and probably register for the addon loaded event.

Or you could just do this in your AddOn's ToC file:

Code:

## OptionalDeps: TellMeWhen
This ensures that TellMeWhen will be loaded first, if it exists - if not, your AddOn will load normally.

zoktar 10-11-11 10:41 AM

Quote:

Originally Posted by Torhal (Post 245716)
Or you could just do this in your AddOn's ToC file:

Code:

## OptionalDeps: TellMeWhen
This ensures that TellMeWhen will be loaded first, if it exists - if not, your AddOn will load normally.

added

## OptionalDeps: TellMeWhen

to the toc, still get index null and no strata change.
toc
-------
---------------------------------------------------------------
## Interface: 40200
## Title: RhozacTweak
## Notes: Various Tweaks
## Author: rhozac
## Version: v1.0
## OptionalDeps: TellMeWhen
## SavedVariables: RhozacTweak

RhozacTweak.lua
----------------------------------------------------------------
the lua
---------
TellMeWhen_Group44:SetFrameStrata("BACKGROUND")

--------------------------------------------------------------------
1x RhozacTweak-v1.0\RhozacTweak.lua:1: attempt to index global 'TellMeWhen_Group44' (a nil value)

nil

Locals:
---------------------------------------------------------------------
So what am i missing here?
edit: tried adding TellMeWhen_Options aswell, no change.
-----------------------------------------------------------------
edit2: im looking into this registering stuff atm. So my current guess is that blizz has frames registered globally somehow and are allowed to be config'ed anyware?. So i must register TellMeWhen_Group44 to be able to set the strata?. How far off am i ? =P

Torhal 10-11-11 04:01 PM

Ok, I looked at the code: TellMeWhen dynamically creates its group frames when they're needed. Your best bet is to hook "TMW:Group_Update()" (which is where the group frames are created) and check for the existence of that frame when it is called. However, are you absolutely sure you'll always need Group44? Since the creation is dynamic, the contents may be anything.

Phanx 10-11-11 04:07 PM

If the frames are all named using the same pattern, and you want them all to be in the background, you could just loop through all possible frame names and check for existence:

Lua Code:
  1. for i = 1, 100 do
  2.      local f = _G["TellMeWhen_Group"..i]
  3.      if f then
  4.           f:SetFrameStrata("BACKGROUND")
  5.      end
  6. end


All times are GMT -6. The time now is 03:51 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI