Skip to content

Commit

Permalink
2.3.1
Browse files Browse the repository at this point in the history
Added Reset Per Hour stats button and key binding
Fixed issue with Hide in Instance not hiding in Delves
  • Loading branch information
Noshei committed Sep 20, 2024
1 parent 1d88b67 commit b47e878
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 24 deletions.
16 changes: 16 additions & 0 deletions Bindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,19 @@ function GT:ClearFilters()
GT:RebuildIDTables()
GT:ClearDisplay()
end

function GT:ResetPerHour()
--resets the per hour displays to current time and values
GT.Debug("Reset Per Hour", 1)

GT.GlobalStartTime = time()
for itemID, itemData in pairs(GT.InventoryData) do
itemData.startTime = time()
itemData.startAmount = {}
for senderIndex, value in ipairs(itemData.counts) do
itemData.startAmount[senderIndex] = value
end
itemData.startTotal = GT:SumTable(itemData.startAmount)
end
GT:RefreshPerHourDisplay(false, true)
end
3 changes: 3 additions & 0 deletions Bindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<Binding name="Clear Filters" category="Gathering Tracker">
GatheringTracker:ClearFilters()
</Binding>
<Binding name="Reset Item and Gold Per Hour" category="Gathering Tracker">
GatheringTracker:ResetPerHour()
</Binding>
</Bindings>
17 changes: 17 additions & 0 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,23 @@ local generalOptions = {
end,
order = 206
},
perHourReset = {
type = "execute",
name = "Reset Item and Gold Per Hour",
desc = "Clicking this will reset the Item and Gold Per Hour displays.",
width = 1.70,
func = function()
GT:ResetPerHour()
end,
disabled = function()
if not GT.db.profile.General.itemsPerHour and not GT.db.profile.General.goldPerHour then
return true
else
return false
end
end,
order = 207
},
header3 = {
type = "header",
name = "Columns",
Expand Down
6 changes: 4 additions & 2 deletions DisplayCreation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ local function CreateTextDisplay(frame, id, text, type, height, anchor)
string:SetParent(frame)
if id < 9999999998 then
string:SetFont(media:Fetch("font", GT.db.profile.General.textFont), GT.db.profile.General.textSize, "OUTLINE")
string:SetVertexColor(GT.db.profile.General.textColor[1], GT.db.profile.General.textColor[2], GT.db.profile.General.textColor[3])
string:SetVertexColor(GT.db.profile.General.textColor[1], GT.db.profile.General.textColor[2],
GT.db.profile.General.textColor[3])
else
string:SetFont(media:Fetch("font", GT.db.profile.General.totalFont), GT.db.profile.General.totalSize, "OUTLINE")
string:SetVertexColor(GT.db.profile.General.totalColor[1], GT.db.profile.General.totalColor[2], GT.db.profile.General.totalColor[3])
string:SetVertexColor(GT.db.profile.General.totalColor[1], GT.db.profile.General.totalColor[2],
GT.db.profile.General.totalColor[3])
end
string:SetHeight(height)
local offset = 3
Expand Down
29 changes: 8 additions & 21 deletions GatheringTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ function GT:GROUP_ROSTER_UPDATE(event, wait)
return
end

if GT.db.profile.General.instanceHide and IsInInstance() then
GT.Debug("GROUP_ROSTER_UPDATE: Instance Hide", 2)
GT.baseFrame.frame:Hide()
return
else
GT.baseFrame.frame:Show()
end

GT:SetChatType()

GT:CheckForPlayersLeavingGroup()
Expand Down Expand Up @@ -281,27 +289,6 @@ function GT:RemoveSender(senderIndex)
GT:RebuildDisplay()
end

function GT:AddRemoveDisplayCell(actionType, itemFrame, index, columnFrame)
GT.Debug("Add Remove Display Cell", 3, actionType, index)
if actionType == "add" then
table.insert(itemFrame.text, index, columnFrame)
elseif actionType == "remove" then
table.remove(itemFrame.text, index)
end

--[[for textIndex, textFrame in ipairs(itemFrame.text) do
if textFrame.textType == "totalItemCount" then
itemFrame.totalItemCount = textIndex
end
if textFrame.textType == "pricePerItem" then
itemFrame.pricePerItem = textIndex
end
if textFrame.textType == "priceTotalItem" then
itemFrame.priceTotalItem = textIndex
end
end]]
end

function GT:RemoveDiaplayRow(itemID --[[int]])
GT.Debug("Remove Diaplay Row", 3, itemID)
GT.Pools.framePool:Release(GT.Display.Frames[itemID])
Expand Down
2 changes: 1 addition & 1 deletion GatheringTracker.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Gathering Tracker
## Notes: Addon for tracking gathered items, supports solo players and groups
## Author: Noshei
## Version: 2.3.0
## Version: 2.3.1
## OptionalDeps: TradeSkillMaster
## SavedVariables: GatheringTrackerDB
## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick
Expand Down

0 comments on commit b47e878

Please sign in to comment.