WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   OpenChatWindow (https://www.wowinterface.com/forums/showthread.php?t=43431)

10leej 05-11-12 03:06 AM

OpenChatWindow
 
So using this code

Code:

--Right Chat Frame (if it exists)
    FCF_SetLocked(ChatFrame3, nil)
        FCF_SetChatWindowFontSize(self, ChatFrame3, fontsize2)
    ChatFrame3:ClearAllPoints()
    ChatFrame3:SetPoint(unpack(def_position2))
    ChatFrame3:SetWidth(chat_width2)
    ChatFrame3:SetHeight(chat_height2)
    ChatFrame3:SetFrameLevel(8)
    ChatFrame3:SetUserPlaced(true)
        for i=1,10 do local cf = _G["ChatFrame"..i] FCF_SetWindowAlpha(cf, 0) end
    FCF_SavePositionAndDimensions(ChatFrame3)
        FCF_SetLocked(ChatFrame3, 1)
end

gives this error here

Code:

Message: Interface\AddOns\BobUI\chat.lua:79: Frame ChatFrame3 is not movable or resizable
Time: 05/11/12 05:02:27
Count: 1
Stack: [C]: in function `SetUserPlaced'
Interface\AddOns\BobUI\chat.lua:79: in function `SetChat'
Interface\AddOns\BobUI\chat.lua:91: in function <Interface\AddOns\BobUI\chat.lua:91>

Locals: (*temporary) = ChatFrame3 {
 0 = <userdata>
 checkedGMOTD = true
 flashTimer = 0
 isInitialized = 1
 tellTimer = 49803.928
 resizeButton = ChatFrame3ResizeButton {
 }
 buttonFrame = ChatFrame3ButtonFrame {
 }
 oldAlpha = 0
 channelList = <table> {
 }
 clickAnywhereButton = ChatFrame3ClickAnywhereButton {
 }
 isDocked = 1
 editBox = ChatFrame3EditBox {
 }
 name = "G,S,W"
 AddMessage = <function> defined @Interface\AddOns\BobUI\chat.lua:350
 buttonSide = "right"
 zoneChannelList = <table> {
 }
 defaultLanguage = "Common"
 messageTypeList = <table> {
 }
}
(*temporary) = true


What I would like to do is since this error only shows up if ChatWindow3 is locked or docked with the main chat window is undock/unlock it and move it to the proper place.

Unfortunately, I'm an .lua novice and I feel that I'm in over my head here atm since FCF_UnDockFrame(ChatFrame3) doesn't work.

if you want a more in depth look at what I'm working on the file I'm working on is the chat.lua file in my UI package (Interface>Addons>BobUI>chat.lua)
http://www.wowinterface.com/download...502-BobUI.html

Xrystal 05-11-12 06:01 AM

There are a set of FCF commands for the chat windows and I believe Lock and Dock versions exist but I can't recall at moment. If no one replies by the time I get back home tonight I'll look up my chat window function list and list them.

Otherwise you could take a look at my nUI_Infopanel_Chat addon to see what commands I used to add chat windows to a new location.

I am still trying to create a new dock frame but I don't think Blizzards docking functions are fully designed for more than the general dock frame at present.

Phanx 05-11-12 08:35 PM

For questions like this, looking at the Blizzard UI code should generally be your first step.

All of the functions related to docking, moving, resizing, and otherwise manipulating the chat frames are used and/or defined in FloatingChatFrame.lua.

Xrystal 05-12-12 01:12 AM

Yep, many an hour I have trawled through that code while working on my chat plugins... *sigh* but alas the docking system isn't that well documented or exampled clear enough.

These are some of the functions I have used with my chat plugins. But definitely worth reading though those files Phanx mentioned.

local _, _, _, _, _, _, shown = FCF_GetChatWindowInfo(i);

Locking Functions
FCF_SetLocked( cframe, nil );
FCF_SetLocked( cframe, 1 );

Docking Functions
FCF_UnDockFrame( cframe );
FCF_DockFrame( cframe, #FCFDock_GetChatFrames(GENERAL_CHAT_DOCK)+1, true );

SetChatWindowShown(cframe:GetID(), 1);

10leej 05-12-12 02:57 AM

Quote:

Originally Posted by Phanx (Post 256302)
For questions like this, looking at the Blizzard UI code should generally be your first step.

All of the functions related to docking, moving, resizing, and otherwise manipulating the chat frames are used and/or defined in FloatingChatFrame.lua.

>.<


Quote:

but alas the docking system isn't that well documented or exampled clear enough.
tis my issue

Xrystal 05-12-12 04:52 AM

Yeah, my attempts have got as far as getting the docking bar and the chat tab and frame to appear I want as the main always docked frame like the GENERAL one for the blizzard version but looking at their floating chat frame code they haven't object orientated all of the docking code to allow non GENERAL dockable frames to be used. Some of the functions aren't hardcoded to the GENERAL one but some are. It might have to be the case of literally writing a FloatingChatFrame lua file that does the same sort of thing but for a non GENERAL dock system. That is one thing I am considering looking into when I next get 5 hrs to sit down and spend time on it haha.


All times are GMT -6. The time now is 08:28 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI