Originally Posted by 7strm
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:
FCF_SetLocked( COMBAT_LOG, nil );
if COMBAT_LOG.isDocked then
FCF_UnDockFrame( COMBAT_LOG );
end
.. Any changes to the parts of ChatFrame2 you want to change
-- Stop it from resetting the ChatFrame2 background
ChatFrame2Background.SetPoint = function() end;
-- And then we tell the CombatLog where to move and resize to
COMBAT_LOG:SetClampedToScreen( nil );
COMBAT_LOG:SetMovable( true );
COMBAT_LOG:SetResizable( true );
COMBAT_LOG:SetParent( parent );
COMBAT_LOG:ClearAllPoints();
.. Set Positioning Details here
COMBAT_LOG:Show();
-- We reset the messaging it receives just in case
ChatFrame_RemoveAllChannels( COMBAT_LOG );
ChatFrame_RemoveAllMessageGroups( COMBAT_LOG );
ChatFrame_ActivateCombatMessages( COMBAT_LOG );
-- Then afterward
COMBAT_LOG:SetUserPlaced( true );
FCF_SetLocked( COMBAT_LOG, 1 );
FCF_SetWindowAlpha( COMBAT_LOG, 0 );