LibStatsPane-1.0

This project is experimental.

This project is only experimental and may change drastically between now and when it comes out of experimental status. It may even be disapproved once that happens, worst-case.

Be forewarned before downloading anything from this project.

Example results

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)

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Oct 09, 2010
Category
Last update
Apr 27, 2011
Development stage
Beta
Language
  • deDE
  • enUS
  • esES
  • esMX
  • frFR
  • koKR
  • ruRU
  • zhCN
  • zhTW
License
GNU Lesser General Public License version 2.1 (LGPLv2.1)
Downloads
91
Recent files
  • A: r4 for 4.1 Apr 27, 2011
  • B: r3 for 4.0.1 Oct 09, 2010
  • A: r2 for 4.0.1 Oct 09, 2010

Authors