Skip to content

Commit

Permalink
Empty loot tabs in the Reserves window now show some text
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Jul 17, 2024
1 parent 75520c6 commit ad0b2c4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Windows/ClientWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ function LootReserve.Client:UpdateLootList()
list.GlobalFavoritesHeader:Hide();
end

local itemsShown = 0;
local missing = { };
local missingLoad = { };
local function createFrame(item, source)
if item:GetID() ~= 0 then
itemsShown = itemsShown + 1;
end
if item:GetID() ~= 0 and not item:IsCached() then
return;
end
Expand Down Expand Up @@ -486,7 +490,15 @@ function LootReserve.Client:UpdateLootList()
for i = list.LastIndex + 1, #list.Frames do
list.Frames[i]:Hide();
end

if #missing == 0 and #missingLoad == 0 and itemsShown == 0 then
if not list.EmptyHint then
list.EmptyHint = CreateFrame("Frame", nil, list, "LootReserveLootEmptyHint");
end
end
if list.EmptyHint then
list.EmptyHint:SetShown(itemsShown == 0 and self.SelectedCategory and self.SelectedCategory.Loot);
end

if self.Blind and not list.BlindHint then
list.BlindHint = CreateFrame("Frame", nil, list, "LootReserveLootBlindHint");
end
Expand Down
16 changes: 16 additions & 0 deletions Windows/ClientWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,22 @@
</Layer>
</Layers>
</Frame>
<Frame name="LootReserveLootEmptyHint" virtual="true" setAllPoints="true">
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.$parent" />
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.$parent" />
</Anchors>
<Layers>
<Layer>
<FontString inherits="GameFontDisable" text="No items available" setAllPoints="true">
<Anchors>
<Anchor point="TOPLEFT" />
<Anchor point="BOTTOMRIGHT" />
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Frame name="LootReserveLootFavoritesHeader" virtual="true">
<Size y="16" />
<Layers>
Expand Down

0 comments on commit ad0b2c4

Please sign in to comment.