Skip to content

Commit

Permalink
Merge pull request #111 from KaylinFinke/loot_threshold
Browse files Browse the repository at this point in the history
Added common and poor to to loot threshold
  • Loading branch information
KaylinFinke authored Aug 31, 2023
2 parents 2c1bd8c + d9060dc commit 1aefb2f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions loot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,46 @@ function GogoLoot:Initialize(events)

LootFrame.selectedQuality = GetLootThreshold()

UnitPopupItemQuality0DescButtonMixin = CreateFromMixins(UnitPopupItemQuality2DescButtonMixin);

function UnitPopupItemQuality0DescButtonMixin:GetText()
return ITEM_QUALITY0_DESC;
end

function UnitPopupItemQuality0DescButtonMixin:GetID()
return 0;
end

UnitPopupItemQuality1DescButtonMixin = CreateFromMixins(UnitPopupItemQuality2DescButtonMixin);

function UnitPopupItemQuality1DescButtonMixin:GetText()
return ITEM_QUALITY1_DESC;
end

function UnitPopupItemQuality1DescButtonMixin:GetID()
return 1;
end

local UnitPopupLootThresholdButtonMixinGetButtons = UnitPopupLootThresholdButtonMixin.GetButtons
function UnitPopupLootThresholdButtonMixin:GetButtons()
local buttons = UnitPopupLootThresholdButtonMixinGetButtons(self)
table.insert(buttons, UnitPopupItemQuality1DescButtonMixin)
table.insert(buttons, UnitPopupItemQuality0DescButtonMixin)

--Fixup button ids to be in some sort of sane order, fixes an issue in the default UI.
table.sort(buttons, function (a, b)
if (b.GetID == nil) then
return a.GetID ~= nil;
elseif (a.GetID == nil) then
return false;
else
return a.GetID() < b.GetID();
end
end);

return buttons;
end

GogoLoot:HookTrades(events)
end

Expand Down

0 comments on commit 1aefb2f

Please sign in to comment.