promotional bannermobile promotional banner

LibStatsPane-1.0

Experimental
A library to assist in adding custom data in the character stats pane.
<p>Example results</p>

Example results

Description

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)

The LibStatsPane-1.0 Team

profile avatar
  • 17
    Projects
  • 4.8M
    Downloads
Donate

More from whitetooth3View all

  • TankPoints project image

    TankPoints

    • 550.2K
    • Addons

    Calculates and shows your TankPoints in the PaperDall Frame.

    • 550.2K
    • January 6, 2011
    • Addons
    • +4
  • RatingBuster project image

    RatingBuster

    • 3.6M
    • Addons

    Item stat breakdown, analysis and comparison

    • 3.6M
    • April 25, 2012
    • Addons
    • +1
  • LibStatLogic-1.2 project image

    LibStatLogic-1.2

    • 86.5K
    • Addons

    A Library for stat conversion, calculation and summarization.

    • 86.5K
    • April 25, 2012
    • Addons
  • RatingBuster AlwaysBuffed project image

    RatingBuster AlwaysBuffed

    • 42.1K
    • Addons

    Enables RatingBuster to calculate selected buff effects even if you don't really have them

    • 42.1K
    • June 28, 2011
    • Addons
    • +1
  • TankPoints project image

    TankPoints

    • 550.2K
    • Addons

    Calculates and shows your TankPoints in the PaperDall Frame.

    • 550.2K
    • January 6, 2011
    • Addons
    • +4
  • RatingBuster project image

    RatingBuster

    • 3.6M
    • Addons

    Item stat breakdown, analysis and comparison

    • 3.6M
    • April 25, 2012
    • Addons
    • +1
  • LibStatLogic-1.2 project image

    LibStatLogic-1.2

    • 86.5K
    • Addons

    A Library for stat conversion, calculation and summarization.

    • 86.5K
    • April 25, 2012
    • Addons
  • RatingBuster AlwaysBuffed project image

    RatingBuster AlwaysBuffed

    • 42.1K
    • Addons

    Enables RatingBuster to calculate selected buff effects even if you don't really have them

    • 42.1K
    • June 28, 2011
    • Addons
    • +1