diff --git a/broker.lua b/broker.lua index 4cd0a46..51aa5c8 100644 --- a/broker.lua +++ b/broker.lua @@ -2,16 +2,21 @@ local addonName, addon = ... local childName = addon['childName'] local child = addon[childName] local zzLDB = LibStub:GetLibrary("zzLDB") +local L = LibStub("AceLocale-3.0"):GetLocale(childName, true) local function OnClick(self, button) zzLDB:DefaultOnClick(self, button, addon, childName) end local function OnTooltipShow(tip) tip:AddLine(childName) + local avgItemLevel, avgItemLevelEquipped, avgItemLevelPvp = GetAverageItemLevel() + tip:AddDoubleLine(L['Itemlevel'], child:colorize(format(child['frm_digits'],avgItemLevel), 'ffffff')) + tip:AddDoubleLine(L['Equipped Itemlevel'], child:colorize(format(child['frm_digits'],avgItemLevelEquipped), 'ffffff')) + tip:AddDoubleLine(L['PvP'], child:colorize(format(child['frm_digits'],avgItemLevelPvp), 'ffffff')) end child['ldb'] = { -- https://github.com/tekkub/libdatabroker-1-1/wiki/Data-Specifications ['type'] = 'data source', -- required: 'data source' or 'launcher' ['text'] = childName, -- required/optional for launcher - ['icon'] = 'Interface\\Icons\\INV_Misc_Bag_10_Blue', -- optional/required for launcher + ['icon'] = 'Interface\\Icons\\Sha_spell_warlock_demonsoul_nightmare', -- optional/required for launcher ['OnClick'] = OnClick, -- optional/required for launcher ['OnTooltipShow'] = OnTooltipShow, -- optional } diff --git a/core.lua b/core.lua index 03ec49f..296655d 100644 --- a/core.lua +++ b/core.lua @@ -3,6 +3,8 @@ local childName = addon['childName'] local child = addon[childName] local events = child['events'] local db +child['frm_digits'] = "%.2f" +LibStub("zzHelper"):Embed(child) local function prepareDB() db = addon['db']['profile'][childName] child['db'] = db @@ -22,7 +24,7 @@ child['specs'] = { } function events:PLAYER_AVG_ITEM_LEVEL_UPDATE() local avgItemLevel, avgItemLevelEquipped, avgItemLevelPvp = GetAverageItemLevel() - child:OnText(childName, format("%.2f",avgItemLevelEquipped)) + child:OnText(childName, format(child['frm_digits'], avgItemLevelEquipped)) end function events:PLAYER_ENTERING_WORLD(_, event) child:UnregisterEvent(event) diff --git a/locale_enUS.lua b/locale_enUS.lua index b177803..d3ea3d8 100644 --- a/locale_enUS.lua +++ b/locale_enUS.lua @@ -2,5 +2,7 @@ local addonname, addon = ... local childName = addon['childName'] local L = LibStub("AceLocale-3.0"):NewLocale(childName, "enUS", true) if L then - L[childName] = childName + L['Itemlevel'] = true + L['Equipped Itemlevel'] = true + L['PvP'] = true end \ No newline at end of file