WoW LibStatsPane-1.0 addon Dragonflight/Wrath of the Lich King Classic 2024
logo
wow addon LibStatsPane-1.0

LibStatsPane-1.0

Game Version: 4.0.1
Total Downloads: 217
Updated: Oct 9, 2010
Created: Oct 9, 2010
download LibStatsPane-1.0Download Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
r3 beta 3.15 KB Oct 9, 2010 4.0.1 139 download LibStatsPane-1.0 r3 betaDownload
r4 alpha 3.09 KB Apr 27, 2011 4.1.0 54 download LibStatsPane-1.0 r4 alphaDownload
r2 alpha 2.31 KB Oct 9, 2010 4.0.1 24 download LibStatsPane-1.0 r2 alphaDownload

Screenshots

Description

Share this:

LibStatsPane-1.0 is a library to assist in adding custom data in the new character stats pane in 4.0.

Usage example, with results show in image:

local StatsPane = LibStub("LibStatsPane-1.0")

local function test(statFrame, unit)
  PaperDollFrame_SetLabelAndText(statFrame, "Hello", 3.33)
  statFrame.tooltip = HIGHLIGHT_FONT_COLOR_CODE.."Test is the tooltip title"..FONT_COLOR_CODE_CLOSE
  statFrame.tooltip2 = "Tooltip lines"
  statFrame:Show()
end

local function test2(statFrame, label, value, ispercent, tip1, tip2)
  PaperDollFrame_SetLabelAndText(statFrame, label, value, ispercent)
  statFrame.tooltip = HIGHLIGHT_FONT_COLOR_CODE..tip1..FONT_COLOR_CODE_CLOSE
  statFrame.tooltip2 = tip2
  -- custom scripts
  statFrame:SetScript("OnMouseDown", function(self, button) print("ClickEvent: ", button) end)
  statFrame:Show()
end

local pane = {
  -- Category: string
  -- * indexes PAPERDOLL_STATCATEGORIES[categoryFrame.Category], needs to be a globally unique key
  -- * also used for the display title, set to _G["STAT_CATEGORY_"..categoryFrame.Category]
  Category = "Stat Modifiers", -- string
  StatInfo = {
    {
      -- id: string
      -- * indexes PAPERDOLL_STATINFO[stat], needs to be a globally unique key
      id = "MyAddon_Stat1",
      -- updateFunc: function
      -- * takes 2 arguments, the statFrame frame and the unit string
      updateFunc = test,
    },
    {
      id = "MyAddon_Stat2",
      updateFunc = function(statFrame, unit)
        test2(statFrame, "Hello2", 6.66, 1, "Test is the tooltip title2", "Tooltip lines2")
      end,
    },
  },
}
StatsPane:AddPane(pane)

Comments

Add a comment