Skip to content

Commit

Permalink
style: Count column -- Destroyed tag
Browse files Browse the repository at this point in the history
added Counts to the table and items destroyed at tagged with -- Destroyed. incase you want to change the loot rule.
  • Loading branch information
grimmier378 committed May 19, 2024
1 parent 1dc2ff3 commit 2ac22d8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ end

function guiLoot.ReportLoot()
if guiLoot.recordData then
showReport = true
guiLoot.console:AppendText("\ay[Looted]\at[Loot Report]")
for looter, lootData in pairs(lootTable) do
guiLoot.console:AppendText("\at[%s] \ax: ", looter)
Expand Down Expand Up @@ -483,22 +484,33 @@ local function lootedReport_GUI()
return showRepGUI
end
if showReport then
ImGui.BeginTable('##LootReport', 2, bit32.bor(ImGuiTableFlags.Borders, ImGuiTableFlags.ScrollY,ImGuiTableFlags.RowBg))
ImGui.BeginTable('##LootReport', 3, bit32.bor(ImGuiTableFlags.Borders, ImGuiTableFlags.ScrollY,ImGuiTableFlags.RowBg))
ImGui.TableSetupScrollFreeze(0, 1)
ImGui.TableSetupColumn("Looter", ImGuiTableColumnFlags.WidthFixed, 100)
ImGui.TableSetupColumn("Item", ImGuiTableColumnFlags.WidthStretch, 150)
ImGui.TableSetupColumn("Count", ImGuiTableColumnFlags.WidthFixed, 50)
ImGui.TableHeadersRow()

for looter, lootData in pairs(lootTable) do
for item, data in pairs(lootData) do
local itemName = item
local itemLink = data["Link"]
local itemCount = data["Count"]
if string.find(itemName,"*") then
itemName = string.gsub(itemName, "*", ' -- Destroyed')
end
ImGui.BeginGroup()
ImGui.TableNextRow()
ImGui.TableSetColumnIndex(0)
ImGui.Text(looter)
ImGui.TableSetColumnIndex(1)
ImGui.Text(item)
ImGui.Text(itemName)
if ImGui.IsItemHovered() and ImGui.IsMouseReleased(0) then
-- guiLoot.console:AppendText("\ay[Looted]\ax %s \ax: \ax(%d)", itemLink, itemCount)
mq.cmdf('/executelink %s', itemLink)
end
ImGui.TableSetColumnIndex(2)
ImGui.Text(itemCount)
ImGui.EndGroup()
if ImGui.IsItemHovered() and ImGui.IsMouseReleased(0) then
-- guiLoot.console:AppendText("\ay[Looted]\ax %s \ax: \ax(%d)", itemLink, itemCount)
Expand Down

0 comments on commit 2ac22d8

Please sign in to comment.