-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Close #185: Add total item count to item loot rows * Close #186: Show Brann's level and XP progress * Close #188: Profession Skill Ups * Close #161: Highlight notable loot * Close #13: Highlight Better Than Equipped * Close #20: Add TSM and Auctionator integration
- Loading branch information
Showing
73 changed files
with
3,905 additions
and
1,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
local addonName, G_RLF = ... | ||
|
||
local RLF = G_RLF.RLF | ||
local LootToastOverride = G_RLF.RLF:NewModule("LootToasts", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") | ||
|
||
function LootToastOverride:OnInitialize() | ||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "LootToastHook") | ||
end | ||
|
||
local lootAlertAttempts = 0 | ||
function RLF:LootToastHook() | ||
if RLF:IsHooked(LootAlertSystem, "AddAlert") then | ||
function LootToastOverride:LootToastHook() | ||
if self:IsHooked(LootAlertSystem, "AddAlert") then | ||
return | ||
end | ||
if LootAlertSystem and LootAlertSystem.AddAlert then | ||
RLF:RawHook(LootAlertSystem, "AddAlert", "InterceptAddAlert", true) | ||
self:RawHook(LootAlertSystem, "AddAlert", "InterceptAddAlert", true) | ||
self:UnregisterEvent("PLAYER_ENTERING_WORLD") | ||
else | ||
if lootAlertAttempts <= 30 then | ||
lootAlertAttempts = lootAlertAttempts + 1 | ||
-- Keep checking until it's available | ||
RLF:ScheduleTimer("LootToastHook", 1) | ||
else | ||
RLF:Print(G_RLF.L["AddLootAlertUnavailable"]) | ||
RLF:Print(G_RLF.L["Issues"]) | ||
end | ||
lootAlertAttempts = G_RLF.retryHook(self, "LootToastHook", lootAlertAttempts, "AddLootAlertUnavailable") | ||
end | ||
end | ||
|
||
function RLF:InterceptAddAlert(frame, ...) | ||
function LootToastOverride:InterceptAddAlert(frame, ...) | ||
if G_RLF.db.global.disableBlizzLootToasts then | ||
return | ||
end | ||
-- Call the original AddAlert function if not blocked | ||
RLF.hooks[LootAlertSystem].AddAlert(frame, ...) | ||
self.hooks[LootAlertSystem].AddAlert(frame, ...) | ||
end | ||
|
||
return LootToastOverride |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
local addonName, G_RLF = ... | ||
|
||
local RLF = G_RLF.RLF | ||
local MoneyAlertOverride = G_RLF.RLF:NewModule("MoneyAlerts", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") | ||
|
||
function MoneyAlertOverride:OnInitialize() | ||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "MoneyAlertHook") | ||
end | ||
|
||
local moneyAlertAttempts = 0 | ||
function RLF:MoneyAlertHook() | ||
if RLF:IsHooked(MoneyWonAlertSystem, "AddAlert") then | ||
function MoneyAlertOverride:MoneyAlertHook() | ||
if self:IsHooked(MoneyWonAlertSystem, "AddAlert") then | ||
return | ||
end | ||
if MoneyWonAlertSystem and MoneyWonAlertSystem.AddAlert then | ||
RLF:RawHook(MoneyWonAlertSystem, "AddAlert", "InterceptMoneyAddAlert", true) | ||
self:RawHook(MoneyWonAlertSystem, "AddAlert", "InterceptMoneyAddAlert", true) | ||
self:UnregisterEvent("PLAYER_ENTERING_WORLD") | ||
else | ||
if moneyAlertAttempts <= 30 then | ||
moneyAlertAttempts = moneyAlertAttempts + 1 | ||
-- Keep checking until it's available | ||
RLF:ScheduleTimer("MoneyAlertHook", 1) | ||
else | ||
RLF:Print(G_RLF.L["AddMoneyAlertUnavailable"]) | ||
RLF:Print(G_RLF.L["Issues"]) | ||
end | ||
moneyAlertAttempts = G_RLF.retryHook(self, "MoneyAlertHook", moneyAlertAttempts, "AddMoneyAlertUnavailable") | ||
end | ||
end | ||
|
||
function RLF:InterceptMoneyAddAlert(frame, ...) | ||
function MoneyAlertOverride:InterceptMoneyAddAlert(frame, ...) | ||
if G_RLF.db.global.disableBlizzMoneyAlerts then | ||
return | ||
end | ||
-- Call the original AddAlert function if not blocked | ||
RLF.hooks[MoneyWonAlertSystem].AddAlert(frame, ...) | ||
self.hooks[MoneyWonAlertSystem].AddAlert(frame, ...) | ||
end | ||
|
||
return MoneyAlertOverride |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
local addonName, G_RLF = ... | ||
|
||
G_RLF.retryHook = function(module, previousAttempts, hookFunctionName, localeKey) | ||
local attempts = previousAttempts | ||
|
||
if attempts < 30 then | ||
attempts = attempts + 1 | ||
-- Keep checking until it's available | ||
module:ScheduleTimer(hookFunctionName, 1) | ||
else | ||
G_RLF:Print(G_RLF.L[localeKey]) | ||
G_RLF:Print(G_RLF.L["Issues"]) | ||
end | ||
|
||
return attempts | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,114 @@ | ||
local addonName, G_RLF = ... | ||
|
||
-- Define the global scope early so that the whole addon can use it | ||
local dbName = addonName .. "DB" | ||
local localeName = addonName .. "Locale" | ||
|
||
local xpcall = xpcall | ||
|
||
local function errorhandler(err) | ||
local suffix = "\n\n==== Addon Info " .. addonName .. " " .. G_RLF.addonVersion .. " ====\n\n" | ||
suffix = suffix .. G_RLF.L["Issues"] .. "\n\n" | ||
|
||
return geterrorhandler()(err .. suffix) | ||
end | ||
|
||
function G_RLF:fn(func, ...) | ||
-- Borrowed from AceAddon-3.0 | ||
if type(func) == "function" then | ||
return xpcall(func, errorhandler, ...) | ||
end | ||
end | ||
G_RLF.addonVersion = "@project-version@-@project-revision@-@project-abbreviated-hash@" | ||
|
||
G_RLF.RLF = LibStub("AceAddon-3.0"):NewAddon(addonName, "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") | ||
G_RLF.RLF:SetDefaultModuleState(true) | ||
G_RLF.RLF:SetDefaultModulePrototype({ | ||
getLogger = function(self) | ||
return G_RLF.RLF:GetModule("Logger") | ||
end, | ||
local RLF = LibStub("AceAddon-3.0"):NewAddon(addonName, "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") | ||
RLF:SetDefaultModuleState(true) | ||
RLF:SetDefaultModulePrototype({ | ||
fn = function(s, func, ...) | ||
local function errorhandler(err) | ||
local suffix = "\n\n==== Addon Info " .. addonName .. " " .. G_RLF.addonVersion .. " ====\n\n" | ||
local status, trace = pcall(function() | ||
return s:getLogger():Trace(s.moduleName) | ||
end) | ||
if status then | ||
suffix = suffix .. "Log traces related to " .. s.moduleName .. "\n" | ||
suffix = suffix .. "-------------------------------------------------\n" | ||
suffix = suffix .. trace | ||
suffix = suffix .. "-------------------------------------------------\n\n" | ||
end | ||
suffix = suffix .. G_RLF.L["Issues"] .. "\n\n" | ||
|
||
return geterrorhandler()(err .. suffix) | ||
end | ||
|
||
-- Borrowed from AceAddon-3.0 | ||
if type(func) == "function" then | ||
return xpcall(func, errorhandler, ...) | ||
end | ||
return G_RLF.fn(s, func, ...) | ||
end, | ||
}) | ||
G_RLF.dbName = dbName | ||
G_RLF.localeName = localeName | ||
G_RLF.addonVersion = "@project-version@-@project-revision@-@project-abbreviated-hash@" | ||
G_RLF.DisableBossBanner = { | ||
ENABLED = 0, | ||
FULLY_DISABLE = 1, | ||
DISABLE_LOOT = 2, | ||
DISABLE_MY_LOOT = 3, | ||
DISABLE_GROUP_LOOT = 4, | ||
} | ||
|
||
G_RLF.localeName = addonName .. "Locale" | ||
G_RLF.lsm = LibStub("LibSharedMedia-3.0") | ||
G_RLF.Masque = LibStub and LibStub("Masque", true) | ||
G_RLF.iconGroup = Masque and Masque:Group(addonName) | ||
local dbName = addonName .. "DB" | ||
local acd = LibStub("AceConfigDialog-3.0") | ||
local TestMode | ||
function RLF:OnInitialize() | ||
G_RLF.db = LibStub("AceDB-3.0"):New(dbName, G_RLF.defaults, true) | ||
LibStub("AceConfig-3.0"):RegisterOptionsTable(addonName, G_RLF.options) | ||
local lsm = G_RLF.lsm | ||
lsm:Register(lsm.MediaType.FONT, "BAR SADY Regular", "Interface\\AddOns\\RPGLootFeed\\Fonts\\BAR_SADY_Variable.ttf") | ||
self:Hook(acd, "Open", "OnOptionsOpen") | ||
self:RegisterEvent("PLAYER_ENTERING_WORLD") | ||
self:RegisterChatCommand("rlf", "SlashCommand") | ||
self:RegisterChatCommand("RLF", "SlashCommand") | ||
self:RegisterChatCommand("rpglootfeed", "SlashCommand") | ||
self:RegisterChatCommand("rpgLootFeed", "SlashCommand") | ||
|
||
if EditModeManagerFrame then | ||
EventRegistry:RegisterCallback("EditMode.Enter", function() | ||
G_RLF.LootDisplay:SetBoundingBoxVisibility(true) | ||
end) | ||
EventRegistry:RegisterCallback("EditMode.Exit", function() | ||
G_RLF.LootDisplay:SetBoundingBoxVisibility(false) | ||
end) | ||
end | ||
|
||
local acr = LibStub("AceConfigRegistry-3.0") | ||
|
||
function G_RLF:NotifyChange(...) | ||
acr:NotifyChange(...) | ||
end | ||
|
||
function G_RLF:SendMessage(...) | ||
G_RLF.RLF:SendMessage(...) | ||
TestMode = self:GetModule("TestMode") | ||
end | ||
|
||
function G_RLF:Print(...) | ||
G_RLF.RLF:Print(...) | ||
function RLF:SlashCommand(msg, editBox) | ||
G_RLF:fn(function() | ||
if msg == "test" then | ||
TestMode:ToggleTestMode() | ||
--@alpha@ | ||
elseif msg == "i" then | ||
TestMode:IntegrationTest() | ||
--@end-alpha@ | ||
elseif msg == "clear" then | ||
G_RLF.LootDisplay:HideLoot() | ||
elseif msg == "log" then | ||
self:GetModule("Logger"):Show() | ||
else | ||
acd:Open(addonName) | ||
end | ||
end) | ||
end | ||
|
||
function G_RLF:RGBAToHexFormat(r, g, b, a) | ||
local red = string.format("%02X", math.floor(r * 255)) | ||
local green = string.format("%02X", math.floor(g * 255)) | ||
local blue = string.format("%02X", math.floor(b * 255)) | ||
local alpha = string.format("%02X", math.floor((a or 1) * 255)) -- Default alpha to 1 if not provided | ||
local currentVersion = "@project-version@" | ||
function RLF:PLAYER_ENTERING_WORLD(event, isLogin, isReload) | ||
if self.optionsFrame == nil then | ||
self.optionsFrame = acd:AddToBlizOptions(addonName, addonName) | ||
end | ||
|
||
-- Return in WoW format with |c prefix | ||
return "|c" .. alpha .. red .. green .. blue | ||
local isNewVersion = currentVersion ~= G_RLF.db.global.lastVersionLoaded | ||
if isLogin and isReload == false and isNewVersion then | ||
G_RLF.db.global.lastVersionLoaded = currentVersion | ||
self:Print(G_RLF.L["Welcome"] .. " (" .. currentVersion .. ")") | ||
if G_RLF.db.global.enableAutoLoot then | ||
C_CVar.SetCVar("autoLootDefault", "1") | ||
end | ||
end | ||
G_RLF.AuctionIntegrations:Init() | ||
end | ||
|
||
--@alpha@ | ||
function G_RLF:ProfileFunction(func, funcName) | ||
return function(...) | ||
local startTime = debugprofilestop() | ||
local result = { func(...) } | ||
local endTime = debugprofilestop() | ||
local duration = endTime - startTime | ||
if duration > 0.3 then | ||
G_RLF:Print(string.format("%s took %.2f ms", funcName, endTime - startTime)) | ||
local optionsFrame | ||
local isOpen = false | ||
function RLF:OnOptionsOpen(...) | ||
local _, name, container, path = ... | ||
G_RLF:fn(function() | ||
if container then | ||
return | ||
end | ||
if name == addonName and not isOpen then | ||
isOpen = true | ||
G_RLF.LootDisplay:SetBoundingBoxVisibility(true) | ||
self:ScheduleTimer(function() | ||
optionsFrame = acd.OpenFrames[name] | ||
if self:IsHooked(optionsFrame, "Hide") then | ||
self:Unhook(optionsFrame, "Hide") | ||
end | ||
if optionsFrame and optionsFrame.Hide then | ||
self:Hook(optionsFrame, "Hide", "OnOptionsClose", true) | ||
end | ||
end, 0.25) | ||
end | ||
end) | ||
end | ||
|
||
return unpack(result) | ||
end | ||
function RLF:OnOptionsClose(...) | ||
G_RLF:fn(function() | ||
isOpen = false | ||
G_RLF.LootDisplay:SetBoundingBoxVisibility(false) | ||
self:Unhook(optionsFrame, "Hide") | ||
optionsFrame = nil | ||
end) | ||
end | ||
--@end-alpha@ | ||
|
||
G_RLF.RLF = RLF | ||
|
||
return RLF |
Oops, something went wrong.