From d2d5b52cb53e08ccd0e985878d72530c677d759a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 9 Feb 2021 16:53:15 +0100 Subject: [PATCH] Added session filter --- Locale/enUS.lua | 1 + REFlex.lua | 16 +++++++++------- REFlex.toc | 2 +- REFlexUpdater.lua | 11 +++++++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Locale/enUS.lua b/Locale/enUS.lua index a2023aa..0b40bc8 100644 --- a/Locale/enUS.lua +++ b/Locale/enUS.lua @@ -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 diff --git a/REFlex.lua b/REFlex.lua index f4bdfc4..f38806f 100644 --- a/REFlex.lua +++ b/REFlex.lua @@ -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 @@ -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(_) @@ -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 diff --git a/REFlex.toc b/REFlex.toc index 0a52d61..2dba942 100644 --- a/REFlex.toc +++ b/REFlex.toc @@ -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 diff --git a/REFlexUpdater.lua b/REFlexUpdater.lua index a175ec2..f25c26e 100644 --- a/REFlexUpdater.lua +++ b/REFlexUpdater.lua @@ -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