chat window strata
i need to change the strata of certain chat windows, i use chatter but didn't see an option for it, if someone can work up some simple code, i'll just make a simple mod for it. thanks =D
|
/script _G.ChatFrame1:SetFrameStrata("blabla")
ChatFrame goes from ChatFrame1 to ChatFrame7 maximum. |
awesome thank you worked perfectly =D
|
actually, one more question about this. that line works perfectly ingame, but doesn't work in an lua. what would i change?
|
I would assume:
ChatFrame1:SetFrameStrata("blabla") would be all you need in an lua for it to work, though im not 100% sure as I dont know what the _G. means. |
The _G is the global table of all of the variables in that global scope. It's not needed in the script either.
|
Probably your addon isn't working because it's running too early. I suggest creating a frame, registering for VARIABLES_LOADED and running the code then.
|
doing it meras way in an lua brings up an error not liking the slashes, changing it to miralens way causes no errors but has no effect =(
|
Mera's way is a script to use in a macro or to enter in the chat frame (hence the /script). Miralen's way will work in an addon. You need to replace "blabla" with the valid strata that you want your chat frame to have, though.
http://wowprogramming.com/docs/widge...SetFrameStrata |
this is my coding...
----ChatStrata.toc------------- ## Interface: 30000 ## Title: ChatStrata ## Version: 1.0 ## Author: khurzog ## Credits: Mera, Miralen ChatStrata.lua ------------------------------- ----ChatStrata.lua------------------- ChatFrame1:SetFrameStrata("high") ChatFrame3:SetFrameStrata("high") ChatFrame4:SetFrameStrata("high") ChatFrame7:SetFrameStrata("high") ------------------------------------- loads fine but does nothing. so what am i doing wrong? |
the delay is not good you are trying to change the strata while the chat frame arent built yet, the code below should work if you aren't using a chat mod, _G would have worked too but when the client loads your mod there is nothing called ChatFrame inside _G, basically that is safer to always delay mods that are "automatically" calling globals or wow apis always after the event PLAYER_LOGIN because you are sure then almost all is loaded client side or ADDON_LOADED might help you to delay it after a specific mod otherwise your code executes when nothing is ready in the client and the client is not ready too to send you a simple error notification:
Code:
local function Load(_, event) Code:
local function Load(_, event, addon) so to mod only visible chatframe you can change if j then j:SetFrameStrata("HIGH") end to if j and j:IsVisible() then j:SetFrameStrata("HIGH") end etc That's a good to practice writing mods, I'm sure you'll be mod author soon or later hehe, btw no requirement to credits us, these codes samples are so simple they have probably been used and reused millions of times ;) |
thank you for the help, its almost working now.
btw i am using chatter, and also Chicchai (which is why the strata matters) anyways the problem i have now is that my text in frame 1 is now under the background, which wasn't a problem before, nor when i used the macro to change the strata. all the other texts show up fine on my other 3 frames. also the last change about the visability broke the whole thing for me, but not sure if that is needed. the visable chat frames are 1,3,4,7. frame 2 is the real combat log which is hidden, 5 and 6 don't exist, and 7 is hitsmode. any idea how to fix the text? ill put up a screen shot... p.s. giving other people credit is a great way to remember who to ask if i have a problem later on =D |
probably your background that have a higher strata than HIGH nor they use the same so the last modified strata is kept up the other I think thats probably why it worked with a macro and not in a script because seems you have something other than Chatter modding these stratas, try with a "TOOLTIP" strata that is the highest, nor something between HIGH and TOOLTIP should be fine
Stratas:
|
so i did some testing, and it turns out the text appearing behind the background (only in frame 1) only happens when BasicMinimap is running. that seemed unlikely, but i switched Chatter with BasicMinimap in the code, and it solved the text issue, but broke the strata. so obviously it need to stay delayed until chatter loads. so how any why is BasicMinimap interfering?
|
probably a code mistake of basicminimap, you can report that thread link to the mod author so he can provide fix
|
have yet to hear back from funkydude, anyone else have a moment to give basicminimap code a quick scan?
|
bump, still having this minor yet annoying issue of the strata not applying to chatframe1 (or at least its not staying) and only with basicminimap running, no response from the author funkydude yet =(
|
I'm not exactly sure what you're trying to say, BasicMinimap has nothing to do with the chatframe.
|
i had a long drawn out explanation with screen shots and everything, then i fell asleep, woke up, and the kids rebooted the computer, so here's the short version.
i needed to make the very simple addon as seen above, solely to make all my chatframe stratas be high (or as it turned out fullscreen) because this feature was left out of chatter, and with the used with Chicchai, my buffs from pitbull4 were overlapping my chatframes when they extended. the example provided by mera worked fine for all the chat frames except chatframe1, which the text went under the background. after a long process of narrowing down addons i discovered it works as intended without basicminimap loaded. further testing with only the two mods confirms somehow basicminimap is preventing the above example mod from correctly changing the strata of chatframe1. i have no idea how or why but that is whats happening. i'll show some screenshots to explain better when i'm home from work, thanks |
All times are GMT -6. The time now is 01:42 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI