|
||||||
| Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding]. | ||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Newbie
Join Date: Jul 2009
Posts: 6
|
frame:RegisterEvent("CHAT_MSG_LOOT")
frame:SetScript("OnEvent", function(self, event, ...) In the function that followed this I am taking only messages that concern loot being received and putting them in another chat window, a loot window. I discard roll messages and other assorted crapola and do nothing with them. I expected my loot window to only have messages concerning loot received. That is exactly what I got. However, since I did literally nothing will all other messages on this event, even the main chat window, that normally tells you all about stupid rolling information no longer contained roll information, except of course the loot received messages. I posit that the normal chat_loot_msg handler that I must be overwriting would do that. Please don't ask for my bad embarrassing code, it is merely implementation of exactly what I describe here. psuedo version if (received_flag) then send message to window3 else do nothing endif The question I am asking is does my included code for registering this function as chat_loot_msg event handler overwrite the normal code that would send those roll messages to the primary chat window? Thanks in advance. =) |
|
|
|
|
|
#2 |
|
Amazing Member
Join Date: Feb 2005
Posts: 1,076
|
It depends on what 'frame' is. One that you created, or one of the existing ChatFrameN windows?
__________________
In wizardry, one must often be willing to consider serendipitous events as unqualified successes. -Vaarsuvius |
|
|
|
|
|
#3 | |
|
Seal Cub Clubbing Club
Join Date: May 2005
Location: California, US
Posts: 7,755
|
Quote:
__________________
& Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge Troubleshoot an addon | Turn any code into an addon | More addon resources Need help with your code? Attach or paste your whole, real files. Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead! |
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jul 2009
Posts: 6
|
Farmbuyer, this line preceded the code I had posted last time.
local frame = CreateFrame("Frame") frame:RegisterEvent("CHAT_MSG_LOOT") frame:SetScript("OnEvent", function(self, event, ...) This frame is my locally created one for my first attempt at designing an addon to accomplish something simple, apparently however I must be simple in more ways than one. The moderator unlike Jimmy Stewart in Harvey prefers smart to pleasant. Wish I was either. Thank you however for seeing I was not asking about the implementation or functionality of my "missing" function. As to your question, the frame is one I created. |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2006
Location: Sweden
Posts: 352
|
Well, I'm going to have to go with Phanx. Based on your description and pseudo code; no, what you're saying is not what is happening. That, or this unexpected behaviour is not actually related to your code. No one will be able to tell you anything else, I'm afraid.
If you don't care for comments about bad code formatting and/or habits, that's fine. People may or may not disregard that per your request, but like Phanx said, we need to know exactly what you're doing, not just what you think you're doing. To answer your question; no, making a new frame and registering a chat event will not affect other chat frames.
__________________
Grab your sword and fight the Horde! Shattered Hand-EU |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Jul 2009
Posts: 6
|
Lombra,
Thank you so much for your take on my question. I appreciate your and Phanx's take on that nature of my query and will think long on it. Your answer at the end matches what I already I had heard from some other authors who weirdly did not require or care about seeing a properly formatted, sorry Ketho, version of that function, they said I had not posited a query that necessitated evaluating that code. I think it more likely after reading the responses here that my question does require what you request. I shall be back often with better questions. Again, thanks. Last edited by phillydave; 02-06-2012 at 05:07 PM. |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 01:13 PM.
WowAce Forums






