Well I'm blind and my problem isn't solved as i thought before
Code:
chatElement.Show = nil
actually does nothing (ie doesn't prevent chat parts from showing) so im left with
Code:
chatElement.Show = function() end
which generates tons of garbage on frequent mouse over, any idea why?
Here is full code for that lua file (even tho i don't believe it's relevant )
lua Code:
--Get namespace
local addonName, addon = ...
--localize config
local cfg = addon.cfg
--Keep references to new and some default frames
addon.chatFrames = {}
addon.chatTabs = {}
addon.nChatArt = {}
addon.nTabArt = {}
addon.nChatButtons = {}
addon.tabControl = {}
--some localized functions
local unpack, select = unpack, select
--Helper
local dumy = nil
--Hide chat elements (buttons, background and border), create frame with custom background and border
local function initChatFrame(chatFrame, id)
local chatElement
local newFrame
--Disable drawing of background layer for all border elements (can't hide those cause they allow to resize chat frame)
for i = 1, 8 do
chatElement = select(i, chatFrame:GetChildren())
chatElement:DisableDrawLayer('BACKGROUND')
end
--Hide chat buttons, and make sure they stay that way
for i = 9, 11 do
chatElement = select(i, chatFrame:GetChildren())
chatElement.Show = function() end
chatElement:Hide()
end
--Now disable chat background which should be first region of ChatFrame
chatElement = chatFrame:GetRegions()
chatElement.Show = function() end
chatElement:Hide()
--Create frame that will serve as a custom background and border
newFrame = CreateFrame('Frame', nil, chatFrame)
--Need to make it bit bigger so it looks ok
newFrame:SetPoint('TOPLEFT', chatFrame, 'TOPLEFT', -2, 2)
newFrame:SetPoint('BOTTOMRIGHT', chatFrame, 'BOTTOMRIGHT', 2, -2)
--Add custom backdrop
newFrame:SetBackdrop(addon.cfg.backdropStyle)
newFrame:SetBackdropColor(unpack(addon.cfg.chatBGColor))
newFrame:SetBackdropBorderColor(unpack(addon.cfg.chatBorderColor))
--Move it under chatFrame
newFrame:SetFrameLevel(chatFrame:GetFrameLevel() - 1)
--Clamp to screen
chatFrame:SetClampedToScreen(true)
--Change parent to control frame to make combat fading easy
chatFrame:SetParent(addon.control)
--Add chat frame and new bg frame to tables for easy acces
addon.chatFrames[id] = chatFrame
addon.nChatArt[id] = newFrame
end
--Do some morel stuff with chat
local function chatPostInit()
--Hide emote menu
ChatFrameMenuButton.Show = dumy
ChatFrameMenuButton:Hide()
end
--Do full initialization on all chat window elements (chat frame / tabs etc)
addon.initChatWindow = function(id)
local chatFrame = _G['ChatFrame'..id]
--Initialize chat frame
initChatFrame(chatFrame, id)
--Initialize chat tab
addon.initTabFrame(chatFrame, id)
--Add timestamps
addon.addTimestamp(chatFrame)
--Add mousescrolling
addon.initScroll(chatFrame, id)
end
--Prepare frames
local function init()
--Proces all chat frames and their elements
for i = 1, FCF_GetNumActiveChatFrames() do
addon.initChatWindow(i)
end
--Do some more stuff
chatPostInit()
addon.tabPostInit()
addon.initEditbox()
addon.autohideInit()
end
--Initialize everything on PLAYER_LOGIN some information isnt aviable earlier
local function onLoad(self, event, arg1)
init()
self:UnregisterAllEvents()
end
--main frame
local frame = CreateFrame('Frame', nil, UIParent)
frame:RegisterEvent('PLAYER_LOGIN')
frame:SetScript('OnEvent', onLoad)
--Frame for combat fading control
addon.control = CreateFrame('Frame', nil, UIParent)
BTW What are tags for luacode? I saw in few post proper syntax coloring of lua but can't find how to do it