Thread Tools Display Modes
02-21-09, 04:59 AM   #1
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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
  Reply With Quote
02-21-09, 05:42 AM   #2
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
/script _G.ChatFrame1:SetFrameStrata("blabla")

ChatFrame goes from ChatFrame1 to ChatFrame7 maximum.
  Reply With Quote
02-21-09, 07:15 AM   #3
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
awesome thank you worked perfectly =D
  Reply With Quote
02-21-09, 07:23 AM   #4
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
actually, one more question about this. that line works perfectly ingame, but doesn't work in an lua. what would i change?
  Reply With Quote
02-21-09, 08:39 AM   #5
Miralen
A Rage Talon Dragon Guard
 
Miralen's Avatar
Join Date: Dec 2006
Posts: 341
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.
__________________
Never hold discussions with the monkey when the organ grinder is in the room.

- Winston Churchill
  Reply With Quote
02-21-09, 12:29 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The _G is the global table of all of the variables in that global scope. It's not needed in the script either.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-21-09, 12:40 PM   #7
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
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.
  Reply With Quote
02-21-09, 03:41 PM   #8
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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 =(
  Reply With Quote
02-21-09, 06:59 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-22-09, 01:23 AM   #10
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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?
  Reply With Quote
02-22-09, 06:14 AM   #11
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
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)
	for i = 1, 7 do
		local j = _G["ChatFrame"..i]
		if j then j:SetFrameStrata("HIGH") end
	end
end

local event = CreateFrame("Frame")
event:SetScript("OnEvent", Load)
event:RegisterEvent("PLAYER_LOGIN")
note that this does not work with chatter because it resets stratas on load, to tweak it with chatter or another mod do this

Code:
local function Load(_, event, addon)
	if addon == "Chatter" then
		for i = 1, 7 do
			local j = _G["ChatFrame"..i]
			if j then j:SetFrameStrata("HIGH") end
		end
	end
end

local event = CreateFrame("Frame")
event:SetScript("OnEvent", Load)
event:RegisterEvent("ADDON_LOADED")
nor just change the name "Chatter" with any Chatmod, it should work as long as the chat mod does not rename default frames to something other.

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
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 02-22-09 at 07:00 AM. Reason: some explanations
  Reply With Quote
02-22-09, 05:54 PM   #12
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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
  Reply With Quote
02-23-09, 06:10 AM   #13
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
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:
  • "PARENT" (very low)
  • "BACKGROUND"
  • "LOW"
  • "MEDIUM"
  • "HIGH"
  • "DIALOG"
  • "FULLSCREEN"
  • "FULLSCREEN_DIALOG"
  • "TOOLTIP" (very high)
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 02-23-09 at 06:15 AM.
  Reply With Quote
02-23-09, 03:18 PM   #14
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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?
  Reply With Quote
02-23-09, 04:05 PM   #15
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
probably a code mistake of basicminimap, you can report that thread link to the mod author so he can provide fix
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)
  Reply With Quote
02-27-09, 12:18 AM   #16
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
have yet to hear back from funkydude, anyone else have a moment to give basicminimap code a quick scan?
  Reply With Quote
03-11-09, 01:52 AM   #17
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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 =(
  Reply With Quote
03-12-09, 08:35 PM   #18
funkydude
A Deviate Faerie Dragon
 
funkydude's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 14
I'm not exactly sure what you're trying to say, BasicMinimap has nothing to do with the chatframe.
  Reply With Quote
03-13-09, 10:44 AM   #19
khurzog
A Frostmaul Preserver
 
khurzog's Avatar
Join Date: Dec 2007
Posts: 266
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

Last edited by khurzog : 03-13-09 at 10:51 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » chat window strata


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