/trunk
<Include file="libs\AceDBOptions-3.0\AceDBOptions-3.0.xml"/> |
<Include file="libs\AceEvent-3.0\AceEvent-3.0.xml"/> |
<Include file="libs\AceTimer-3.0\AceTimer-3.0.xml"/> |
<Include file="libs\AceLocale-3.0\AceLocale-3.0.xml"/> |
<Script file="libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/> |
<Script file="libs\LibQTip-1.0\LibQTip-1.0.lua"/> |
</Ui> |
NeedyGreedy = LibStub("AceAddon-3.0"):NewAddon("NeedyGreedy", "AceEvent-3.0", "AceTimer-3.0", "AceConsole-3.0") |
local L = LibStub("AceLocale-3.0"):GetLocale("NeedyGreedy", true) |
LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("NeedyGreedy", { |
type = "launcher", |
label = "Needy Greedy", |
local items = {} |
local options = { |
name = L["NeedyGreedy"], |
desc = L["Displays a table of items and the roll choices players have made on them"], |
name = "NeedyGreedy", |
desc = "Displays a table of items and the roll choices players have made on them", |
handler = NeedyGreedy, |
type = "group", |
args = { |
nItems = { |
name = L["Display Items"], |
desc = L["Number of item columns in the display window"], |
name = "Display Items", |
desc = "Number of item columns in the display window", |
type = "range", |
min = 1, |
max = 10, |
set = "SetNItems" |
}, |
expiry = { |
name = L["Expiry Time"], |
desc = L["Minutes after item is received before it is removed from display (0 = forever)"], |
name = "Expiry Time", |
desc = "Minutes after item is received before it is removed from display (0 = forever)", |
type = "range", |
min = 0, |
max = 60, |
set = "SetExpiry" |
}, |
quality = { |
name = L["Minimum Quality"], |
desc = L["Minimum quality of item to be displayed"], |
name = "Minimum Quality", |
desc = "Minimum quality of item to be displayed", |
type = "select", |
values = { |
[ITEM_QUALITY_UNCOMMON] = ITEM_QUALITY2_DESC, |
set = "SetQuality" |
}, |
displayIcons = { |
name = L["Display Icons"], |
desc = L["Display icons for rolls types instead of text strings"], |
name = "Display Icons", |
desc = "Display icons for rolls types instead of text strings", |
type = "toggle", |
get = "GetDisplayIcons", |
set = "SetDisplayIcons", |
}, |
detachedTooltip = { |
name = L["Detach Tooltip"], |
desc = L["Display the roll information in a standalone window"], |
name = "Detach Tooltip", |
desc = "Display the roll information in a standalone window", |
type = "toggle", |
get = "GetDetachedTooltip", |
set = "SetDetachedTooltip", |
}, |
displayTextLink = { |
name = L["Display Item Names"], |
desc = L["Show the item names as a header"], |
name = "Display Item Names", |
desc = "Show the item names as a header", |
type = "toggle", |
get = "GetDisplayTextLink", |
set = "SetDisplayTextLink", |
options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db) |
LibStub("AceConfig-3.0"):RegisterOptionsTable("NeedyGreedy", options) |
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("NeedyGreedy") |
-- self:RegisterChatCommand("ngt", "TestItemList") |
self:RegisterChatCommand("ngt", "TestItemList") |
self:RegisterChatCommand("needygreedy", function() InterfaceOptionsFrame_OpenToCategory("NeedyGreedy") end) |
end |
if nItems == 1 then |
pageText = tostring(report.firstItem) |
elseif count == 0 then |
pageText = L["None"] |
pageText = "None" |
elseif count == 1 or report.firstItem == count then |
pageText = string.format(L["%d of %d"], report.firstItem, count) |
pageText = string.format("%d of %d", report.firstItem, count) |
else |
local lastitem = report.firstItem + nItems - 1 |
if (lastitem > count) then |
lastitem = count |
end |
pageText = string.format(L["%d-%d of %d"], report.firstItem, lastitem, count) |
pageText = string.format("%d-%d of %d", report.firstItem, lastitem, count) |
end |
tooltip:SetCell(lineNum, colNum - 1, yC .. pageText) |
function NeedyGreedy:AddInfoText(tooltip) |
local helpText = "" |
if self.db.profile.detachedTooltip then |
helpText = helpText .. eC .. L["Click"] .. "|r " .. gC .. L["to hide/show detached tooltip"] .. "|r" |
helpText = helpText .. eC .. "Click|r " .. gC .. "to hide/show detached tooltip\n|r" |
end |
-- helpText = helpText "\n" .. eC .. "Right-Click|r " .. gC .. "to open configuration menu|r" |
helpText = helpText .. eC .. "Right-Click|r " .. gC .. "to open configuration menu|r" |
tooltip:AddLine("") |
local lineNum = tooltip:AddLine() |
tooltip:SetCell(lineNum, 1, helpText, nil, tooltip:GetColumnCount()) |
-- Unit tests |
--[[ |
function NeedyGreedy:TestItemList() |
items[1] = { |
texture = "Interface\\Icons\\INV_Weapon_ShortBlade_04", |
} |
self:UpdateReport() |
end |
--]] |
## Interface: 30300 |
## Title: NeedyGreedy |
## Notes: Displays who has rolled need/greed/pass on what loot items |
## Version: 0.9 |
## Author: lokyst, Marco |
## Version: 1.0 |
## Author: Marco, lokyst |
## SavedVariables: NeedyGreedyDB |
## OptionalDeps: |
## OptionalDeps: Blizzard_DebugTools |
Localization\enUS.lua |
embeds.xml |
embeds.xml |
NeedyGreedy.lua |