Thread Tools Display Modes
08-04-18, 03:40 AM   #1
7strm
A Murloc Raider
Join Date: Aug 2016
Posts: 9
Manipulating ChatFrame2

I'm changing a few things on ChatFrame1, like simply repositioning the background for example. However, when I'm trying to do the same for ChatFrame2, nothing gets applied.

Code:
 
  ChatFrame1Background:ClearAllPoints()
  ChatFrame1Background:SetPoint("TOPLEFT", ChatFrame1, "TOPLEFT", -3, 3)
  ChatFrame1Background:SetPoint("BOTTOMRIGHT", ChatFrame1, "BOTTOMRIGHT", 3, -20)

  ChatFrame2Background:ClearAllPoints()
  ChatFrame2Background:SetPoint("TOPLEFT", ChatFrame2, "TOPLEFT", -3, 3)
  ChatFrame2Background:SetPoint("BOTTOMRIGHT", ChatFrame2, "BOTTOMRIGHT", 3, -20)
Do I need to call it at some specific later points for ChatFrame2?
  Reply With Quote
08-04-18, 04:05 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by 7strm View Post
I'm changing a few things on ChatFrame1, like simply repositioning the background for example. However, when I'm trying to do the same for ChatFrame2, nothing gets applied.

Code:
 
  ChatFrame1Background:ClearAllPoints()
  ChatFrame1Background:SetPoint("TOPLEFT", ChatFrame1, "TOPLEFT", -3, 3)
  ChatFrame1Background:SetPoint("BOTTOMRIGHT", ChatFrame1, "BOTTOMRIGHT", 3, -20)

  ChatFrame2Background:ClearAllPoints()
  ChatFrame2Background:SetPoint("TOPLEFT", ChatFrame2, "TOPLEFT", -3, 3)
  ChatFrame2Background:SetPoint("BOTTOMRIGHT", ChatFrame2, "BOTTOMRIGHT", 3, -20)
Do I need to call it at some specific later points for ChatFrame2?
Make sure you test if the addon "Blizzard_CombatLog" is loaded and load it if it isn't when your own addon is loaded.

And set up wise this is what nUI does to place the combat log in a special location. It might be over zealous but it sounds about right based on my own foray into customizing chat frames. nUI does a few other bits and pieces afterwards but I don't think they are that relevant to your situation.

Lua Code:
  1. FCF_SetLocked( COMBAT_LOG, nil );
  2. if COMBAT_LOG.isDocked then
  3.     FCF_UnDockFrame( COMBAT_LOG );
  4. end
  5. .. Any changes to the parts of ChatFrame2 you want to change
  6.  
  7. -- Stop it from resetting the ChatFrame2 background
  8. ChatFrame2Background.SetPoint       = function() end;
  9.  
  10. -- And then we tell the CombatLog where to move and resize to
  11. COMBAT_LOG:SetClampedToScreen( nil );
  12. COMBAT_LOG:SetMovable( true );
  13. COMBAT_LOG:SetResizable( true );
  14. COMBAT_LOG:SetParent( parent );
  15. COMBAT_LOG:ClearAllPoints();
  16. .. Set Positioning Details here
  17. COMBAT_LOG:Show();
  18.  
  19. -- We reset the messaging it receives just in case
  20. ChatFrame_RemoveAllChannels( COMBAT_LOG );
  21. ChatFrame_RemoveAllMessageGroups( COMBAT_LOG );
  22. ChatFrame_ActivateCombatMessages( COMBAT_LOG );
  23.  
  24. -- Then afterward
  25. COMBAT_LOG:SetUserPlaced( true );              
  26. FCF_SetLocked( COMBAT_LOG, 1 );
  27. FCF_SetWindowAlpha( COMBAT_LOG, 0 );
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Manipulating ChatFrame2

Thread Tools
Display Modes

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