Skip to content

Commit

Permalink
Option for not storing PL to history
Browse files Browse the repository at this point in the history
  • Loading branch information
evil-morfar committed Sep 17, 2024
1 parent 4381601 commit c16afa0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Core/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ addon.defaults = {
enableHistory = true,
sendHistory = true,
sendHistoryToGuildChannel = false,
savePersonalLoot = true,

-- ML - General - Usage
usage = { -- State of enabledness
Expand Down
2 changes: 2 additions & 0 deletions Locale/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ L.opt_profileSharing_fail_noProfileData =
L.opt_profileSharing_import_desc =
"Import a new RCLootCouncil profile. Imports are non-destructive, unless you're overwriting an existing profile."
L.opt_profileSharing_profileExistsWarning = "A profile named \"%s\" already exists - do you want to overwrite it?"
L.opt_savePersonalLoot_name = "Record Personal Loot"
L.opt_savePersonalLoot_desc = "If disabled, personal loot will not be added to the history."
L.opt_sharingProfile_success = "Succesfully imported profile: \"%s\""
L["opt_rejectTrade_Name"] = "Allow Keeping"
L["opt_rejectTrade_Desc"] = "Check to enable candidates to choose whether they want to 'give' the item to the council or not. If unchecked, all tradeable PL items are added automatically."
Expand Down
6 changes: 6 additions & 0 deletions Modules/History/lootHistory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ end

function LootHistory:OnHistoryReceived (name, history)
if not addon:Getdb().enableHistory then return end
if not addon:Getdb().storePersonalLoot then
if history.responseID == "PL" or history.responseID == "PL_REJECT" then
addon.Log:D("Not storing personal loot", history.lootWon)
return
end
end
-- v2.15 Add itemClass and itemSubClass locally:
local itemID, _, _, _, _, itemClassID, itemSubClassID = C_Item.GetItemInfoInstant(history.lootWon)
history.tierToken = RCTokenTable[itemID] and true
Expand Down
6 changes: 6 additions & 0 deletions Modules/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ function addon:OptionsTable()
type = "toggle",
disabled = function() return not self.db.profile.sendHistory end,
},
savePersonalLoot = {
order = 3.2,
name = L.opt_savePersonalLoot_name,
desc = L.opt_savePersonalLoot_desc,
type = "toggle",
},
header = {
order = 4,
type = "header",
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Changes

Added option to not store personal loot in the history.

## Bugfixes

- *Addon should now always properly initialize when reloading as the ML.*
Expand Down

0 comments on commit c16afa0

Please sign in to comment.