1. #1

    KgPanels and the Combat Log

    Hi all! I am currently trying to show a frame that triggers when I am currently logging through /combatlog. Im using KgPanels to create a frame that shows this status. Here's what I have so far based on what I have been able to pull from the interent and lua errors I get from other panels.

    OnLoad:
    self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

    self:Hide()
    OnEvent:
    local BamfLogFrame = kgPanels:FetchFrame("LogsRunning")
    if LoggingCombat() == true then BamfLogFrame:Show() else BamfLogFrame:Hide() end
    I'm not sure if I'm on the right track, or if this is even possible. From what I was able to research there is no event fired for starting the logging.

    Thanks so much for all you do!

  2. #2
    Deleted
    I don't have any experience with kgpanels but you could hook LoggingCombat. One possbile way (dry-coded) would look like this:
    Code:
    OnLoad:
    
    local function frameToggle(input)
      if input then
        self:Show()
      elseif input == false then
        self:Hide()
      end
    end
    
    frameToggle(LoggingCombat())
    
    hooksecurefunc("LoggingCombat", frameToggle)

    This assumes kgpanels runs OnLoad only once after frame creation like if it were to be specified in XML. Otherwise you would need to build any kind of check if you already hooked LoggingCombat as to not hook it over and over again.
    Last edited by mmoc7723fe36c9; 2015-07-07 at 08:29 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •