1. #1

    Change ChatFrame for Addon msg

    Silly Question :P

    I Dl Bedazzler, http://files.wowace.com/Bedazzler/Bedazzler-r52472.zip and it Prints the Final Link in chat frame 1 with self:Print, but I want it To /w me or send the link in Chat frame 3/4

    So I search for an Addon the let me change the ChatFrame in with Addon Print there msg :>

    or someone how know what i have to change in the lua, to Print it elsewhere :P


    thx

  2. #2

    Re: Change ChatFrame for Addon msg

    try posting the function that print, not only the "self:Print", if you want us to help you

  3. #3

    Re: Change ChatFrame for Addon msg

    Code:
     if(self.db.char.Sets[set] == nil) then
      self:Print("No sets defined")
      return
    	end
    for example

  4. #4

    Re: Change ChatFrame for Addon msg

    the print function is part of Ace2 (AceConsole-2.0) and uses the global variable DEFAULT_CHAT_FRAME to determine the chatframe for output (all other non ace2 addons use this as well I guess).
    Code:
    local function print(text, name, r, g, b, frame, delay)
    ...
    		(frame or DEFAULT_CHAT_FRAME):AddMessage(last_color and "|cff" .. last_color .. t or t, r, g, b, nil, delay or 5)
    ...
    end
    This variable is set in Blizzards ChatFrame.lua (part of the default UI)
    Code:
    "DEFAULT_CHAT_FRAME = ChatFrame1;"
    So try to write a small addon, that changes it or add the line to any addon to change it to ChatFrame2 or any Frame you want (if it doesn't exist, you get tons of errors )

  5. #5

    Re: Change ChatFrame for Addon msg

    Quote Originally Posted by emTee
    Code:
     if(self.db.char.Sets[set] == nil) then
      self:Print("No sets defined")
      return
    	end
    for example
    if you want to only change that addon messages. just change the "self:Print("No sets defined")" for
    "ChatFrame2:AddMessage("No Sets defined")". change chatframe2 but whatever chat frame.

    if you want to change the whole /print function. change the "(frame or DEFAULT_CHAT_FRAME)" by whatever chatframe you want
    Code:
    local function print(text, name, r, g, b, frame, delay)
    ...
    		ChatFrame2:AddMessage(last_color and "|cff" .. last_color .. t or t, r, g, b, nil, delay or 5)
    ...
    end


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •