Thread Tools Display Modes
07-29-11, 08:24 AM   #1
barbol12
A Cyclonian
 
barbol12's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 42
chat addon, whats wrong

hello all. have this chat addon i put directly into my UI... it sorta works, lol

at first(not all the time) when i first login, it works 100% perfect.. but when i reload, the chat tabs + chat frame just kinda seem to just disappear... cant see anything, but when i copy it shows it all.

other times, the chat tabs get all screwed up.. and when i unlock and try to move i get a floating chat frame error( from WoW )...

if someone could help me to figure out the problem, that would be great.
-- heres the coding
lua Code:
  1. if not BarbolUI["chatt"].enable == true then return end
  2.  
  3. local Chat = CreateFrame("Frame")
  4. local tabalpha = 1
  5. local tabnoalpha = 0
  6. local _G = _G
  7. local origs = {}
  8. local type = type
  9. hidecombat = false
  10. local FONT = "Interface\\AddOns\\textures\\Prototype.ttf"
  11.  
  12. function UIScale()
  13.     if BarbolUI["General"].autoscaleUI == true then
  14.     BarbolUI["General"].uiscale = min(2, max(.64, 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)")))
  15.     end
  16. end
  17. UIScale()
  18. -- pixel perfect script of custom ui scale.
  19. local mult = 768/string.match(GetCVar("gxResolution"), "%d+x(%d+)")/BarbolUI["General"].uiscale
  20. local function scale(x)
  21.     return mult*math.floor(x/mult+.5)
  22. end
  23. function Scale(x) return scale(x) end
  24. mult = mult
  25.  
  26. function CreatePanel(f, w, h, a1, p, a2, x, y)
  27.     local _, class = UnitClass("player")
  28.     local r, g, b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b
  29.     sh = Scale(h)
  30.     sw = Scale(w)
  31.     f:SetFrameLevel(1)
  32.     f:SetHeight(sh)
  33.     f:SetWidth(sw)
  34.     f:SetFrameStrata("BACKGROUND")
  35.     f:SetPoint(a1, p, a2, x, y)
  36.     f:SetBackdrop({
  37.       bgFile =  [=[Interface\ChatFrame\ChatFrameBackground]=],
  38.       edgeFile = "Interface\\Buttons\\WHITE8x8",
  39.       tile = false, tileSize = 0, edgeSize = mult,
  40.       insets = { left = -mult, right = -mult, top = -mult, bottom = -mult}
  41.     })
  42.     f:SetBackdropColor(.05,.05,.05,0)
  43.     f:SetBackdropBorderColor(.15,.15,.15,0)
  44. end
  45.  
  46.  
  47.  
  48. Anchorchatbgdummy = CreateFrame("Frame","Move_chatbgdummy",UIParent)
  49. Anchorchatbgdummy:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 20, 36)
  50.  
  51. local chatbgdummy = CreateFrame("Frame", "ChatBackground", UIParent)
  52. CreatePanel(chatbgdummy, 376, 120, "BOTTOMLEFT", Anchorchatbgdummy)
  53.  
  54.  
  55.  
  56. local function Kill(object)
  57.     if object.UnregisterAllEvents then
  58.         object:UnregisterAllEvents()
  59.     end
  60.     object.Show = dummy
  61.     object:Hide()
  62. end
  63.  
  64. for i = 1, 10 do
  65.     local x=({_G["ChatFrame"..i.."EditBox"]:GetRegions()})
  66.     x[9]:SetAlpha(0)
  67.     x[10]:SetAlpha(0)
  68.     x[11]:SetAlpha(0)
  69. end
  70. for i = 1, NUM_CHAT_WINDOWS do
  71.     if ( i ~= 2 ) then
  72.       local f = _G["ChatFrame"..i]
  73.       local am = f.AddMessage
  74.       f.AddMessage = function(frame, text, ...)
  75.         return am(frame, text:gsub('|h%[(%d+)%. .-%]|h', '|h[%1]|h'), ...)
  76.       end
  77.     end
  78. end
  79. _G.CHAT_BATTLEGROUND_GET = "|Hchannel:Battleground|h".."[BG]".."|h %s:\32"
  80. _G.CHAT_BATTLEGROUND_LEADER_GET = "|Hchannel:Battleground|h".."[BG]".."|h %s:\32"
  81. _G.CHAT_BN_WHISPER_INFORM_GET = "T: %s "
  82. _G.CHAT_BN_WHISPER_GET = "F: %s "
  83. _G.CHAT_GUILD_GET = "|Hchannel:Guild|h".."[G]".."|h %s:\32"
  84. _G.CHAT_OFFICER_GET = "|Hchannel:o|h".."[O]".."|h %s:\32"
  85. _G.CHAT_PARTY_GET = "|Hchannel:Party|h".."[P]".."|h %s:\32"
  86. _G.CHAT_PARTY_GUIDE_GET = "|Hchannel:party|h".."[P]".."|h %s:\32"
  87. _G.CHAT_PARTY_LEADER_GET = "|Hchannel:party|h".."[P]".."|h %s:\32"
  88. _G.CHAT_RAID_GET = "|Hchannel:raid|h".."[R]".."|h %s:\32"
  89. _G.CHAT_RAID_LEADER_GET = "|Hchannel:raid|h".."[R]".."|h %s:\32"
  90. _G.CHAT_RAID_WARNING_GET = "[W]".." %s:\32"
  91. _G.CHAT_SAY_GET = "%s:\32"
  92. _G.CHAT_WHISPER_GET = "Fr".." %s:\32"
  93. _G.CHAT_WHISPER_INFORM_GET = "To %s "
  94. _G.CHAT_YELL_GET = "%s:\32"
  95.  
  96. _G.CHAT_FLAG_AFK = "|cffFF0000".."[AFK]".."|r "
  97. _G.CHAT_FLAG_DND = "|cffE7E716".."[DND]".."|r "
  98. _G.CHAT_FLAG_GM = "|cff4154F5".."[GM]".."|r "
  99.  
  100. _G.ERR_FRIEND_ONLINE_SS = "|Hplayer:%s|h[%s]|h ".."is now |cff298F00online|r".."!"
  101. _G.ERR_FRIEND_OFFLINE_S = "%s ".."is now |cffff0000offline|r".."!"
  102.  
  103. Kill(FriendsMicroButton)
  104. Kill(ChatFrameMenuButton)
  105.  
  106. if hidecombat==true then
  107.     local EventFrame = CreateFrame("Frame");
  108.     EventFrame:RegisterEvent("ADDON_LOADED");
  109.     local function EventHandler(self, event, ...)
  110.         if ... == "Blizzard_CombatLog" then
  111.             local topbar = _G["CombatLogQuickButtonFrame_Custom"];
  112.             if not topbar then return end
  113.             topbar:Hide();
  114.             topbar:HookScript("OnShow", function(self) topbar:Hide(); end);
  115.             topbar:SetHeight(0);
  116.         end
  117.     end
  118.     EventFrame:SetScript("OnEvent", EventHandler);
  119. end
  120. local function SetChatStyle(frame)
  121.     local id = frame:GetID()
  122.     local chat = frame:GetName()
  123.     local tab = _G[chat.."Tab"]
  124.  
  125.     tab:SetAlpha(1)
  126.     tab.SetAlpha = UIFrameFadeRemoveFrame
  127.    
  128.     _G[chat]:SetFading(false)
  129.     _G[chat.."TabText"]:SetTextColor(unpack(BarbolUI["Colors"].Border))
  130.     _G[chat.."TabText"].SetTextColor = dummy
  131.     _G[chat.."TabText"]:SetFont(FONT,10,"OUTLINE")
  132.     _G[chat]:SetClampRectInsets(0,0,0,0)
  133.     _G[chat]:SetClampedToScreen(false)
  134.     _G[chat]:SetMinResize(371,111)
  135.  
  136.  
  137.  
  138.    
  139.     for j = 1, #CHAT_FRAME_TEXTURES do
  140.         _G[chat..CHAT_FRAME_TEXTURES[j]]:SetTexture(nil)
  141.     end
  142.            
  143.     Kill(_G[format("ChatFrame%sTabLeft", id)])
  144.     Kill(_G[format("ChatFrame%sTabMiddle", id)])
  145.     Kill(_G[format("ChatFrame%sTabRight", id)])
  146.  
  147.     Kill(_G[format("ChatFrame%sTabSelectedLeft", id)])
  148.     Kill(_G[format("ChatFrame%sTabSelectedMiddle", id)])
  149.     Kill(_G[format("ChatFrame%sTabSelectedRight", id)])
  150.    
  151.     Kill(_G[format("ChatFrame%sTabHighlightLeft", id)])
  152.     Kill(_G[format("ChatFrame%sTabHighlightMiddle", id)])
  153.     Kill(_G[format("ChatFrame%sTabHighlightRight", id)])
  154.  
  155.     Kill(_G[format("ChatFrame%sTabSelectedLeft", id)])
  156.     Kill(_G[format("ChatFrame%sTabSelectedMiddle", id)])
  157.     Kill(_G[format("ChatFrame%sTabSelectedRight", id)])
  158.  
  159.    
  160.     tab.leftSelectedTexture:Hide()
  161.     tab.middleSelectedTexture:Hide()
  162.     tab.rightSelectedTexture:Hide()
  163.     tab.leftSelectedTexture.Show = tab.leftSelectedTexture.Hide
  164.     tab.middleSelectedTexture.Show = tab.middleSelectedTexture.Hide
  165.     tab.rightSelectedTexture.Show = tab.rightSelectedTexture.Hide
  166.    
  167.     Kill(_G[format("ChatFrame%sButtonFrameUpButton", id)])
  168.     Kill(_G[format("ChatFrame%sButtonFrameDownButton", id)])
  169.     Kill(_G[format("ChatFrame%sButtonFrameBottomButton", id)])
  170.     Kill(_G[format("ChatFrame%sButtonFrameMinimizeButton", id)])
  171.     Kill(_G[format("ChatFrame%sButtonFrame", id)])
  172.  
  173.     Kill(_G[format("ChatFrame%sEditBoxFocusLeft", id)])
  174.     Kill(_G[format("ChatFrame%sEditBoxFocusMid", id)])
  175.     Kill(_G[format("ChatFrame%sEditBoxFocusRight", id)])
  176.  
  177.     local a, b, c = select(6, _G[chat.."EditBox"]:GetRegions()); Kill (a); Kill (b); Kill (c)
  178.                
  179.     _G[chat.."EditBox"]:SetAltArrowKeyMode(false)
  180.     _G[chat.."EditBox"]:Hide()
  181.     _G[chat.."EditBox"]:HookScript("OnEditFocusLost", function(self) self:Hide() end)
  182.     _G[chat.."Tab"]:HookScript("OnClick", function() _G[chat.."EditBox"]:Hide() end)
  183.  
  184.     local editbox = _G["ChatFrame"..id.."EditBox"]
  185.     local left, mid, right = select(6, editbox:GetRegions())
  186.     left:Hide(); mid:Hide(); right:Hide()
  187.     editbox:ClearAllPoints();
  188.     editbox:SetPoint("BOTTOMLEFT", UIParent, 20, 156)
  189.     editbox:SetWidth(BarbolUI["chatt"].editboxwidth)
  190.     editbox:SetHeight(BarbolUI["chatt"].editboxheight)
  191.  
  192. end
  193. local function SetupChat(self) 
  194.     for i = 1, NUM_CHAT_WINDOWS do
  195.         local frame = _G[format("ChatFrame%s", i)]
  196.         SetChatStyle(frame)
  197.         FCFTab_UpdateAlpha(frame)
  198.     end
  199.  
  200.     ChatTypeInfo.WHISPER.sticky = 1
  201.     ChatTypeInfo.BN_WHISPER.sticky = 1
  202.     ChatTypeInfo.OFFICER.sticky = 1
  203.     ChatTypeInfo.RAID_WARNING.sticky = 1
  204.     ChatTypeInfo.CHANNEL.sticky = 1
  205. end
  206. local function SetupChatPosAndFont(self)   
  207.     for i = 1, NUM_CHAT_WINDOWS do
  208.         local chat = _G[format("ChatFrame%s", i)]
  209.         local tab = _G[format("ChatFrame%sTab", i)]
  210.         local id = chat:GetID()
  211.         local name = FCF_GetChatWindowInfo(id)
  212.         local point = GetChatWindowSavedPosition(id)
  213.         local _, fontSize = FCF_GetChatWindowInfo(id)
  214.        
  215.         FCF_SetChatWindowFontSize(nil, chat, 12)
  216.        
  217.         ChatFrame1:ClearAllPoints()
  218.         ChatFrame1:SetPoint("BOTTOMLEFT", ChatBackground, "BOTTOMLEFT", 3, 5)          
  219.     end
  220. end
  221. Chat:RegisterEvent("ADDON_LOADED")
  222. Chat:RegisterEvent("PLAYER_ENTERING_WORLD")
  223. Chat:SetScript("OnEvent", function(self, event, ...)
  224.     for i = 1, NUM_CHAT_WINDOWS do
  225.         _G["ChatFrame"..i]:SetClampRectInsets(0,0,0,0)
  226.         _G["ChatFrame"..i]:SetWidth(BarbolUI["chatt"].chatframewidth)
  227.         _G["ChatFrame"..i]:SetHeight(BarbolUI["chatt"].chatframeheight)
  228.     end
  229.     local addon = ...
  230.     if event == "ADDON_LOADED" then
  231.         if addon == "Blizzard_CombatLog" then
  232.             self:UnregisterEvent("ADDON_LOADED")
  233.             SetupChat(self)
  234.         end
  235.     elseif event == "PLAYER_ENTERING_WORLD" then
  236.         SetupChatPosAndFont(self)
  237.         Chat:UnregisterEvent("PLAYER_ENTERING_WORLD")
  238.     end
  239.     if event == "PLAYER_LOGIN" then
  240.         SetupChatPosAndFont(self)
  241.     end
  242. end)
  243. local function SetupTempChat()
  244.     local frame = FCF_GetCurrentChatFrame()
  245.     SetChatStyle(frame)
  246. end
  247. hooksecurefunc("FCF_OpenTemporaryWindow", SetupTempChat)
  248. for i = 1, NUM_CHAT_WINDOWS do
  249.     local editBox = _G["ChatFrame"..i.."EditBox"]
  250.     editBox:HookScript("OnTextChanged", function(self)
  251.        local text = self:GetText()
  252.        if text:len() < 5 then
  253.           if text:sub(1, 4) == "/tt " then
  254.              local unitname, realm
  255.              unitname, realm = UnitName("target")
  256.              if unitname then unitname = gsub(unitname, " ", "") end
  257.              if unitname and not UnitIsSameServer("player", "target") then
  258.                 unitname = unitname .. "-" .. gsub(realm, " ", "")
  259.              end
  260.              ChatFrame_SendTell((unitname or "Invalid Target"), ChatFrame1)
  261.           end
  262.        end
  263.     end)
  264. end
  265. local SetItemRef_orig = SetItemRef
  266. function ReURL_SetItemRef(link, text, button, chatFrame)
  267.     if (strsub(link, 1, 3) == "url") then
  268.         local ChatFrameEditBox = ChatEdit_ChooseBoxForSend()
  269.         local url = strsub(link, 5);
  270.         if (not ChatFrameEditBox:IsShown()) then
  271.             ChatEdit_ActivateChat(ChatFrameEditBox)
  272.         end
  273.         ChatFrameEditBox:Insert(url)
  274.         ChatFrameEditBox:HighlightText()
  275.  
  276.     else
  277.         SetItemRef_orig(link, text, button, chatFrame)
  278.     end
  279. end
  280. SetItemRef = ReURL_SetItemRef
  281. function ReURL_AddLinkSyntax(chatstring)
  282.     if (type(chatstring) == "string") then
  283.         local extraspace;
  284.         if (not strfind(chatstring, "^ ")) then
  285.             extraspace = true;
  286.             chatstring = " "..chatstring;
  287.         end
  288.         chatstring = gsub (chatstring, " www%.([_A-Za-z0-9-]+)%.(%S+)%s?", ReURL_Link("www.%1.%2"))
  289.         chatstring = gsub (chatstring, " (%a+)://(%S+)%s?", ReURL_Link("%1://%2"))
  290.         chatstring = gsub (chatstring, " ([_A-Za-z0-9-%.]+)@([_A-Za-z0-9-]+)(%.+)([_A-Za-z0-9-%.]+)%s?", ReURL_Link("%1@%2%3%4"))
  291.         chatstring = gsub (chatstring, " (%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?):(%d%d?%d?%d?%d?)%s?", ReURL_Link("%1.%2.%3.%4:%5"))
  292.         chatstring = gsub (chatstring, " (%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%s?", ReURL_Link("%1.%2.%3.%4"))
  293.         if (extraspace) then
  294.             chatstring = strsub(chatstring, 2);
  295.         end
  296.     end
  297.     return chatstring
  298. end
  299.  
  300. REURL_COLOR = "16FF5D"
  301. ReURL_Brackets = false
  302. ReUR_CustomColor = true
  303.  
  304. function ReURL_Link(url)
  305.     if (ReUR_CustomColor) then
  306.         if (ReURL_Brackets) then
  307.             url = " |cff"..REURL_COLOR.."|Hurl:"..url.."|h["..url.."]|h|r "
  308.         else
  309.             url = " |cff"..REURL_COLOR.."|Hurl:"..url.."|h"..url.."|h|r "
  310.         end
  311.     else
  312.         if (ReURL_Brackets) then
  313.             url = " |Hurl:"..url.."|h["..url.."]|h "
  314.         else
  315.             url = " |Hurl:"..url.."|h"..url.."|h "
  316.         end
  317.     end
  318.     return url
  319. end
  320. for i=1, NUM_CHAT_WINDOWS do
  321.     local frame = getglobal("ChatFrame"..i)
  322.     local addmessage = frame.AddMessage
  323.     frame.AddMessage = function(self, text, ...) addmessage(self, ReURL_AddLinkSyntax(text), ...) end
  324. end
  325. -----------------------------------------------------------------------------
  326. -- Copy Chat (by Shestak)
  327. -----------------------------------------------------------------------------
  328. local lines = {}
  329. local frame = nil
  330. local editBox = nil
  331. local isf = nil
  332.  
  333. local function CreatCopyFrame()
  334.     frame = CreateFrame("Frame", "CopyFrame", UIParent)
  335.     frame:SetBackdrop({
  336.             bgFile = "Interface\\Buttons\\WHITE8x8",
  337.             edgeFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
  338.             tile = 0, tileSize = 0, edgeSize = 1,
  339.             insets = { left = -1, right = -1, top = -1, bottom = -1 }
  340.     })
  341.    
  342.     local tex = frame:CreateTexture(nil, "BORDER")
  343.     tex:SetPoint("TOPLEFT", frame, "TOPLEFT", 2, -2)
  344.     tex:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 2)
  345.     tex:SetVertexColor(.05,.05,.05,0)
  346.     tex:SetDrawLayer("BORDER", -8)
  347.     frame.tex = tex
  348.    
  349.     frame:SetBackdropColor(.05,.05,.05,.7)
  350.     frame:SetBackdropBorderColor(.15,.15,.15,0)
  351.     frame:SetWidth(500)
  352.     frame:SetHeight(300)
  353.     frame:SetScale(0.9)
  354.     frame:SetPoint("LEFT", UIParent, "LEFT", 10, 0)
  355.     frame:Hide()
  356.     frame:SetFrameStrata("DIALOG")
  357.  
  358.  
  359.     local scrollArea = CreateFrame("ScrollFrame", "CopyScroll", frame, "UIPanelScrollFrameTemplate")
  360.     scrollArea:SetPoint("TOPLEFT", frame, "TOPLEFT", 8, -30)
  361.     scrollArea:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -30, 8)
  362.     editBox = CreateFrame("EditBox", "CopyBox", frame)
  363.     editBox:SetMultiLine(true)
  364.     editBox:SetMaxLetters(99999)
  365.     editBox:EnableMouse(true)
  366.     editBox:SetAutoFocus(false)
  367.     editBox:SetFontObject(ChatFontNormal)
  368.     editBox:SetWidth(500)
  369.     editBox:SetHeight(300)
  370.     editBox:SetScript("OnEscapePressed", function() frame:Hide() end)
  371.     scrollArea:SetScrollChild(editBox)
  372.     local close = CreateFrame("Button", "CopyCloseButton", frame, "UIPanelCloseButton")
  373.     close:SetPoint("TOPRIGHT", frame, "TOPRIGHT",0, 0)
  374.     isf = true
  375. end
  376.  
  377. local function GetLines(...)
  378.     local ct = 1
  379.     for i = select("#", ...), 1, -1 do
  380.         local region = select(i, ...)
  381.         if region:GetObjectType() == "FontString" then
  382.             lines[ct] = tostring(region:GetText())
  383.             ct = ct + 1
  384.         end
  385.     end
  386.     return ct - 1
  387. end
  388. local function Copy(cf)
  389.     local _, size = cf:GetFont()
  390.     FCF_SetChatWindowFontSize(cf, cf, 0.01)
  391.     local lineCt = GetLines(cf:GetRegions())
  392.     local text = table.concat(lines, "\n", 1, lineCt)
  393.     FCF_SetChatWindowFontSize(cf, cf, size)
  394.     if not isf then CreatCopyFrame() end
  395.     frame:Show()
  396.     editBox:SetText(text)
  397.     editBox:HighlightText(1)
  398. end
  399. function ChatCopyButtons()
  400.     for i = 1, NUM_CHAT_WINDOWS do
  401.         local cf = _G[format("ChatFrame%d",  i)]
  402.         local button = CreateFrame("Button", format("ButtonCF%d", i), cf)
  403.         button:SetHeight(20)
  404.         button:SetWidth(20)
  405.         button:SetPoint("TOPRIGHT", cf, "TOPRIGHT", 0 , 0)
  406.            
  407.         local buttontext = button:CreateFontString(nil,"OVERLAY",nil)
  408.         buttontext:SetFont(FONT,10,"OUTLINE")
  409.         buttontext:SetText("C")
  410.         buttontext:SetPoint("CENTER", 1, 0)
  411.         buttontext:SetJustifyH("CENTER")
  412.         buttontext:SetJustifyV("CENTER")
  413.         buttontext:SetTextColor(unpack(BarbolUI["Colors"].Border))
  414.                        
  415.         button:SetScript("OnMouseUp", function(self, btn)
  416.             if i == 1 and btn == "RightButton" then
  417.                 ToggleFrame(ChatMenu)
  418.             else
  419.                 Copy(cf)
  420.             end
  421.         end)
  422.     end
  423. end
  424. ChatCopyButtons()
  425. ------------------------------------------------------------------------
  426. --  Enhance/rewrite a Blizzard feature, chatframe mousewheel.
  427. ------------------------------------------------------------------------
  428. local ScrollLines = 3 -- set the jump when a scroll is done !
  429. function FloatingChatFrame_OnMouseScroll(self, delta)
  430.     if delta < 0 then
  431.         if IsShiftKeyDown() then
  432.             self:ScrollToBottom()
  433.         else
  434.             for i = 1, ScrollLines do
  435.                 self:ScrollDown()
  436.             end
  437.         end
  438.     elseif delta > 0 then
  439.         if IsShiftKeyDown() then
  440.             self:ScrollToTop()
  441.         else
  442.             for i = 1, ScrollLines do
  443.                 self:ScrollUp()
  444.             end
  445.         end
  446.     end
  447. end
  Reply With Quote
07-29-11, 02:13 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Have you poked around to make sure different parts of your code are actually being run? What I do is put something random, like print("blargh") at a key spot and see if that pops up in the chatframe. You can do pcall(assert,false,"Debug Breakpoint") to throw an error for a more distinguishable breakpoint and still continue execution.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
08-01-11, 10:47 AM   #3
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
Doing this doesn't seem wise:

Code:
ChatFrame1:ClearAllPoints()
        ChatFrame1:SetPoint("BOTTOMLEFT", ChatBackground, "BOTTOMLEFT", 3, 5)

You need to set the width and height or set another point
  Reply With Quote
08-01-11, 06:46 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by sylvanaar View Post
Doing this doesn't seem wise:

Code:
ChatFrame1:ClearAllPoints()
ChatFrame1:SetPoint("BOTTOMLEFT", ChatBackground, "BOTTOMLEFT", 3, 5)
You need to set the width and height or set another point
In practice it actually works, what happens is the frame retains its size as if it was set by a frame:SetSize() call with its previous size (no matter if set directly or by points) and just moves the frame. This only works if the frame had a valid size and position to start with.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
08-01-11, 07:31 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Only one reference point is stored in the chat-cache.txt file as is the width and height.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » chat addon, whats wrong


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