Skip to content

Commit

Permalink
Added session filter
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Feb 9, 2021
1 parent d210d3f commit d2d5b52
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions Locale/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ L["This month"] = true
L["This season"] = true
L["Prev. season"] = true
L["Current session"] = true
L["Session"] = true

L["Hide minimap button"] = true
L["Display server names"] = true
Expand Down
16 changes: 9 additions & 7 deletions REFlex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ local SendAddonMessage = _G.C_ChatInfo.SendAddonMessage
local PlaySound = _G.PlaySound
local ElvUI = _G.ElvUI

RE.Version = 303
RE.Version = 310
RE.LastSquash = 1602662400
RE.FoundNewVersion = false

Expand Down Expand Up @@ -198,7 +198,7 @@ function RE:OnLoad(self)
RE.DateDropDown.frame:SetPoint("RIGHT", RE.MapDropDown.frame, "LEFT", -5, 0)
RE.DateDropDown:SetWidth(100)
RE.DateDropDown:SetCallback("OnValueChanged", RE.OnDateChange)
RE.DateDropDown:SetList({[1] = _G.ALL, [2] = _G.HONOR_TODAY, [3] = _G.HONOR_YESTERDAY, [4] = _G.GUILD_CHALLENGES_THIS_WEEK, [5] = L["This month"], [6] = L["This season"], [7] = L["Prev. season"], [8] = _G.CUSTOM})
RE.DateDropDown:SetList({[1] = _G.ALL, [2] = L["Session"], [3] = _G.HONOR_TODAY, [4] = _G.HONOR_YESTERDAY, [5] = _G.GUILD_CHALLENGES_THIS_WEEK, [6] = L["This month"], [7] = L["This season"], [8] = L["Prev. season"], [9] = _G.CUSTOM})
end

function RE:OnHide(_)
Expand Down Expand Up @@ -611,17 +611,19 @@ function RE:OnDateChange(_, mode)
if mode == 1 then
RE.Settings.Filters.Date = {0, 0}
elseif mode == 2 then
RE.Settings.Filters.Date = {RE:ParseUTCTimestamp(), 0}
RE.Settings.Filters.Date = {RE.SessionStart, 0}
elseif mode == 3 then
RE.Settings.Filters.Date = {RE:ParseUTCTimestamp() - 86400, RE:ParseUTCTimestamp()}
RE.Settings.Filters.Date = {RE:ParseUTCTimestamp(), 0}
elseif mode == 4 then
RE.Settings.Filters.Date = {RE:GetUTCTimestamp() - RE:GetPreviousWeeklyReset() + (RE.PlayerTimezone * 3600), 0}
RE.Settings.Filters.Date = {RE:ParseUTCTimestamp() - 86400, RE:ParseUTCTimestamp()}
elseif mode == 5 then
RE.Settings.Filters.Date = {RE:ParseUTCTimestamp(true), 0}
RE.Settings.Filters.Date = {RE:GetUTCTimestamp() - RE:GetPreviousWeeklyReset() + (RE.PlayerTimezone * 3600), 0}
elseif mode == 6 then
RE.Settings.Filters.Date = {RE:ParseUTCTimestamp(true), 0}
elseif mode == 7 then
RE.Settings.Filters.Date = {0, 0}
RE.Settings.Filters.Season = RE.Season
elseif mode == 7 then
elseif mode == 8 then
RE.Settings.Filters.Date = {0, 0}
RE.Settings.Filters.Season = RE.Season - 1
else
Expand Down
2 changes: 1 addition & 1 deletion REFlex.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 90002
## Title: |cFF74D06CRE|rFlex
## Notes: Collect statistics of played arena matches and battlegrounds.
## Version: 3.0.3
## Version: 3.1.0
## Author: AcidWeb
## SavedVariablesPerCharacter: REFlexSettings, REFlexDatabase, REFlexHonorDatabase
## X-Website: https://www.curseforge.com/wow/addons/reflex-battleground-historian
Expand Down
11 changes: 9 additions & 2 deletions REFlexUpdater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ function RE:UpdateSettings()
RE.Settings.ConfigVersion = 250
end

RE.Settings.ArenaStatsLimit = 3
RE.Settings.ConfigVersion = 260
if RE.Settings.ConfigVersion < 260 then
RE.Settings.ArenaStatsLimit = 3
RE.Settings.ConfigVersion = 260
end

if RE.Settings.Filters.DateMode > 1 then
RE.Settings.Filters.DateMode = RE.Settings.Filters.DateMode + 1
end
RE.Settings.ConfigVersion = 310
end
end

Expand Down

0 comments on commit d2d5b52

Please sign in to comment.