Skip to content

Commit

Permalink
2.6.0
Browse files Browse the repository at this point in the history
Added Session display options
Updated some "Per Hour" options to use session naming
  • Loading branch information
Noshei committed Oct 20, 2024
1 parent 05158e2 commit 68f7668
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 51 deletions.
7 changes: 6 additions & 1 deletion Bindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function GT:ClearFilters()
GT:ClearDisplay()
end

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

Expand All @@ -107,8 +107,13 @@ function GT:ResetPerHour()
itemData.startAmount = {}
for senderIndex, value in ipairs(itemData.counts) do
itemData.startAmount[senderIndex] = value
itemData.sessionCounts[senderIndex] = 0
end
itemData.startTotal = GT:SumTable(itemData.startAmount)
end
for senderIndex, senderData in ipairs(GT.sender) do
senderData.sessionData = {}
end
GT:RefreshPerHourDisplay(false, true)
GT:RebuildDisplay("Reset Session")
end
4 changes: 2 additions & 2 deletions Bindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +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 name="Reset Session" category="Gathering Tracker">
GatheringTracker:ResetSession()
</Binding>
</Bindings>
66 changes: 55 additions & 11 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ GT.defaults = {
goldPerHour = false,
collapseDisplay = false,
collapseTime = 2,
sessionItems = false,
sessionOnly = false,
},
Notifications = {
Count = {
Expand Down Expand Up @@ -528,6 +530,48 @@ local generalOptions = {
end,
order = 204
},
header2 = {
type = "header",
name = "Session Display Options",
order = 250
},
sessionItems = {
type = "toggle",
name = "Display Session Item Counts",
desc = "If selected session item counts will be displayed in the column to the right of the item count.\n" ..
"Price data (if enabled) is not displayed for session data.\n\n" ..
"|cffff0000Session data not displayed in group mode.|r",
width = 1.70,
get = function() return GT.db.profile.General.sessionItems end,
set = function(_, key)
GT.db.profile.General.sessionItems = key
if not key then
GT.db.profile.General.sessionOnly = false
end
GT:RebuildDisplay("Display Session Item Counts Changed")
end,
order = 251
},
sessionOnly = {
type = "toggle",
name = "Only Display Session Data",
desc = "If selected only the session data will be displayed and selected items will only display if collected during the session.\n" ..
"Price data (if enabled) is displayed for the session data.",
width = 1.70,
get = function() return GT.db.profile.General.sessionOnly end,
set = function(_, key)
GT.db.profile.General.sessionOnly = key
GT:RebuildDisplay("Only Display Session Data Changed")
end,
disabled = function()
if not GT.db.profile.General.sessionItems then
return true
else
return false
end
end,
order = 252
},
itemsPerHour = {
type = "toggle",
name = "Display Items Per Hour",
Expand All @@ -536,10 +580,9 @@ local generalOptions = {
get = function() return GT.db.profile.General.itemsPerHour end,
set = function(_, key)
GT.db.profile.General.itemsPerHour = key
GT:RebuildDisplay("tems Per Hour Changed")
GT:RebuildDisplay("Items Per Hour Changed")
end,

order = 205
order = 255
},
goldPerHour = {
type = "toggle",
Expand All @@ -559,24 +602,25 @@ local generalOptions = {
return false
end
end,
order = 206
order = 256
},
perHourReset = {
type = "execute",
name = "Reset Item and Gold Per Hour",
desc = "Clicking this will reset the Item and Gold Per Hour displays.",
name = "Reset Session Data",
desc = "Clicking this will reset the session data.",
width = 1.70,
func = function()
GT:ResetPerHour()
GT:ResetSession()
end,
disabled = function()
if not GT.db.profile.General.itemsPerHour and not GT.db.profile.General.goldPerHour then
return true
else
if GT.db.profile.General.itemsPerHour or GT.db.profile.General.goldPerHour or
GT.db.profile.General.sessionItems then
return false
else
return true
end
end,
order = 207
order = 257
},
header3 = {
type = "header",
Expand Down
1 change: 0 additions & 1 deletion Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,6 @@ local ItemData = {
Other = {
{ id = 1, name = "Current Gold", order = 1, icon = 370211, desc = "Displays the current Gold on the character, rounded to the nearest whole number." },
{ id = 2, name = "Open Bag Space", order = 2, icon = 975745, desc = "Displays the number of open bag space." },
{ id = 3, name = "Timer", order = 3, icon = 134377, desc = "Displays a timer starting from the first gather after being enabled." },
},
},
}
Expand Down
Loading

0 comments on commit 68f7668

Please sign in to comment.