/trunk
## Interface: 30100 |
## Interface: 30300 |
## Title: RollWatcher |
## Notes: Displays who has rolled need/greed/pass on what loot items |
## Version: 1.0.4 |
## Author: Marco |
## X-Curse-Packaged-Version: v1.0.4 |
## X-Curse-Project-Name: RollWatcher |
## X-Curse-Project-ID: rollwatcher |
## X-Curse-Repository-ID: wow/rollwatcher/mainline |
## Author: Marco, lokyst |
## SavedVariables: RollWatcherDB |
style = "dropdown", |
get = "GetQuality", |
set = "SetQuality" |
}, |
displayIcons = { |
name = "Display Icons", |
desc = "Display icons for rolls types instead of text strings", |
type = "toggle", |
get = "GetDisplayIcons", |
set = "SetDisplayIcons", |
} |
} |
} |
namelistwidth = 100, |
scale = 1, |
expiry = 5, |
quality = ITEM_QUALITY_EPIC |
quality = ITEM_QUALITY_EPIC, |
displayIcons = false, |
} |
} |
local ROLLWATCHER_CHOICE = { |
["need"] = { |
["string"] = "|c00FF0000" .. NEED .. "|r", |
["icon"] = "|TInterface\\Buttons\\UI-GroupLoot-Dice-Up:32|t", |
}, |
["greed"] = { |
["string"] = "|c0000FF00" .. GREED .. "|r", |
["icon"] = "|TInterface\\Buttons\\UI-GroupLoot-Coin-Up:32|t", |
}, |
["pass"] = { |
["string"] = "|c00CCCCCC" .. PASS .. "|r", |
["icon"] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_7:16|t", |
}, |
["disenchant"] = { |
["string"] = "|c00FF00FF" .. ROLL_DISENCHANT .. "|r", |
["icon"] = "|TInterface\\Buttons\\UI-GroupLoot-DE-Up:32|t", |
} |
} |
function RollWatcher:OnInitialize() |
self.db = LibStub("AceDB-3.0"):New("RollWatcherDB", defaults, true) |
self.db.RegisterCallback(self, "OnProfileChanged", "ResizeFrames") |
self:RecordReceived(link) |
return |
end |
-- To handle new disenchant rules |
link = self:unformat(LOOT_ROLL_DISENCHANT_SELF, msg) |
if link then |
self:RecordChoice(link, me, "disenchant") |
return |
end |
player, link = self:unformat(LOOT_ROLL_DISENCHANT, msg) |
if link then |
self:RecordChoice(link, player, "disenchant") |
return |
end |
player, link = self:unformat(LOOT_ROLL_DISENCHANT, msg) |
if link then |
self:RecordChoice(link, player, "disenchant") |
return |
end |
number, link, player = self:unformat(LOOT_ROLL_ROLLED_DE, msg) |
if number then |
self:RecordRoll(link, player, number) |
return |
end |
end |
function RollWatcher:RecordChoice(link, player, choice) |
end |
function RollWatcher:ChoiceText(choice) |
if choice == "need" then |
return "|c00FF0000" .. NEED .. "|r" |
elseif choice == "greed" then |
return "|c0000FF00" .. GREED .. "|r" |
elseif choice == "pass" then |
return "|c00CCCCCC" .. PASS .. "|r" |
else |
return "" |
local style = "string" |
if self.db.profile.displayIcons == true then style = "icon" end |
if choice then |
if ROLLWATCHER_CHOICE[choice][style] then |
return ROLLWATCHER_CHOICE[choice][style] |
end |
end |
return "" |
end |
function RollWatcher:RollText(number) |
function RollWatcher:SetQuality(info, quality) |
self.db.profile.quality = quality |
end |
function RollWatcher:GetDisplayIcons(info) |
return self.db.profile.displayIcons |
end |
function RollWatcher:SetDisplayIcons(info, displayIcons) |
self.db.profile.displayIcons = displayIcons |
end |