diff --git a/.pkgmeta b/.pkgmeta
index 1dbe9c6..a6e17e4 100644
--- a/.pkgmeta
+++ b/.pkgmeta
@@ -18,10 +18,6 @@ externals:
ignore:
- README.md
- .luacheckrc
- - Libs/LibToast-1.0/LibStub
- - Libs/LibToast-1.0/LibToast-1.0.toc
- - Libs/LibToast-1.0/lib.xml
- - Libs/LibToast-1.0/LibStub
- Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml
- Libs/LibBabble-Race-3.0/LibBabble-Race-3.0.toc
- Libs/LibBabble-Race-3.0/lib.xml
diff --git a/Embeds.xml b/Embeds.xml
index bac8ed2..3899bc1 100644
--- a/Embeds.xml
+++ b/Embeds.xml
@@ -5,7 +5,6 @@
-
diff --git a/Locale/enUS.lua b/Locale/enUS.lua
index 3effc7d..705c451 100644
--- a/Locale/enUS.lua
+++ b/Locale/enUS.lua
@@ -8,8 +8,6 @@ L["Prev. season"] = true
L["Current session"] = true
L["Hide minimap button"] = true
-L["Enable battleground summary"] = true
-L["Display toast with battleground summary after completed match."] = true
L["Display server names"] = true
L["LDB feed display mode"] = true
L["Rating display always compares the values with the previous week."] = true
diff --git a/REFlex.lua b/REFlex.lua
index b254a02..ff68e04 100644
--- a/REFlex.lua
+++ b/REFlex.lua
@@ -5,7 +5,6 @@ local ST = LibStub("ScrollingTable")
local GUI = LibStub("AceGUI-3.0")
local LDB = LibStub("LibDataBroker-1.1")
local LDBI = LibStub("LibDBIcon-1.0")
-local TOAST = LibStub("LibToast-1.0")
local QTIP = LibStub("LibQTip-1.0")
local DUMP = LibStub("LibTextDump-1.0")
_G.REFlex = RE
@@ -59,6 +58,7 @@ local AbbreviateNumbers = _G.AbbreviateNumbers
local UIParentLoadAddOn = _G.UIParentLoadAddOn
local RegisterAddonMessagePrefix = _G.C_ChatInfo.RegisterAddonMessagePrefix
local SendAddonMessage = _G.C_ChatInfo.SendAddonMessage
+local PlaySound = _G.PlaySound
local ElvUI = _G.ElvUI
RE.Version = 300
@@ -200,6 +200,13 @@ function RE:OnLoad(self)
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})
end
+function RE:OnHide(_)
+ if RE.Tooltip and RE.Tooltip:IsVisible() then
+ QTIP:Release(RE.Tooltip)
+ end
+ PlaySound(_G.SOUNDKIT.IG_CHARACTER_INFO_CLOSE)
+end
+
function RE:OnEvent(_, event, ...)
if event == "ADDON_LOADED" and ... == "REFlex" then
if not _G.REFlexSettings then
@@ -235,36 +242,6 @@ function RE:OnEvent(_, event, ...)
end
end
- TOAST:Register("REFlexToast", function(toast, ...)
- toast:SetFormattedTitle("|cFF74D06CRE|r|cFFFFFFFFFlex|r")
- toast:SetFormattedText(...)
- toast:SetIconTexture([[Interface\PvPRankBadges\PvPRank09]])
- toast:MakePersistent()
- if RE.PlayerFaction == 0 then
- toast:SetSoundFile(565853)
- toast:SetPrimaryCallback(_G.HORDE_CHEER, RE.CloseToast)
- else
- toast:SetSoundFile(566564)
- toast:SetPrimaryCallback(_G.ALLIANCE_CHEER, RE.CloseToast)
- end
- end)
- TOAST:Register("REFlexToastArena", function(toast, title, payload)
- toast:SetFormattedTitle(title)
- toast:SetFormattedText(payload)
- toast:SetIconTexture([[Interface\PvPRankBadges\PvPRank09]])
- toast:MakePersistent()
- if RE.PlayerFaction == 0 then
- toast:SetPrimaryCallback(_G.HORDE_CHEER, RE.CloseToast)
- else
- toast:SetPrimaryCallback(_G.ALLIANCE_CHEER, RE.CloseToast)
- end
- end)
- TOAST:Register("REFlexToastInfo", function(toast, ...)
- toast:SetFormattedTitle("|cFF74D06CRE|r|cFFFFFFFFFlex|r")
- toast:SetFormattedText(...)
- toast:SetIconTexture([[Interface\PvPRankBadges\PvPRank09]])
- end)
-
RE.LDB = LDB:NewDataObject("REFlex", {
type = "data source",
text = "|cFF74D06CRE|rFlex",
@@ -388,7 +365,7 @@ function RE:OnEvent(_, event, ...)
local messageEx = {strsplit(";", message)}
if messageEx[1] == "Version" then
if not RE.FoundNewVersion and tonumber(messageEx[2]) > RE.Version then
- TOAST:Spawn("REFlexToastInfo", L["New version released!"])
+ print("\124cFF74D06C[REFlex]\124r "..L["New version released!"])
RE.FoundNewVersion = true
end
end
@@ -408,6 +385,7 @@ function RE:OnEvent(_, event, ...)
if IsInGuild() then
SendAddonMessage("REFlex", "Version;"..RE.Version, "GUILD")
end
+ _G.REFlexBGFrameText:SetText("")
end
elseif event == "PVP_MATCH_COMPLETE" and not RE.DataSaved then
RE.DataSaved = true
@@ -610,8 +588,12 @@ function RE:OnBracketChange(_, bracket)
end
function RE:OnArenaStatsClick(self)
- _G.CloseDropDownMenus()
- _G.EasyMenu(RE.StatsDropDown, _G.REFlexStatsDropDown, self, 0 , 0, "MENU")
+ if RE.Tooltip and RE.Tooltip:IsVisible() then
+ QTIP:Release(RE.Tooltip)
+ else
+ _G.CloseDropDownMenus()
+ _G.EasyMenu(RE.StatsDropDown, _G.REFlexStatsDropDown, self, 0 , 0, "MENU")
+ end
end
function RE:OnDateChange(_, mode)
@@ -935,11 +917,10 @@ function RE:PVPEnd()
if not RE.MatchData.Hidden then
if RE.MatchData.isArena then
RE:UpdateArenaData(false)
+ _G.REFlexBGFrameText:SetText("")
else
RE:UpdateBGData(false)
- if RE.Settings.Toasts then
- TOAST:Spawn("REFlexToast", RE:GetBGToast(#RE.Database))
- end
+ _G.REFlexBGFrameText:SetText(RE:GetBGScoreText(#RE.Database))
end
else
print("\124cFF74D06C[REFlex]\124r "..L["API returned corrupted data. Match will not be recorded."])
diff --git a/REFlex.xml b/REFlex.xml
index eed4e09..1e3f90f 100644
--- a/REFlex.xml
+++ b/REFlex.xml
@@ -19,7 +19,7 @@
REFlex:OnLoad(self)
REFlex:OnEvent(self, event, ...)
PlaySound(SOUNDKIT.IG_CHARACTER_INFO_OPEN); REFlex:UpdateGUI()
- PlaySound(SOUNDKIT.IG_CHARACTER_INFO_CLOSE)
+ REFlex:OnHide(self)
self:StartMoving()
self:StopMovingOrSizing()
@@ -371,4 +371,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/REFlexFunctions.lua b/REFlexFunctions.lua
index e91d3c0..eb8b1a7 100644
--- a/REFlexFunctions.lua
+++ b/REFlexFunctions.lua
@@ -2,9 +2,9 @@ local _G = _G
local _, RE = ...
local L = LibStub("AceLocale-3.0"):GetLocale("REFlex")
local BR = LibStub("LibBabble-Race-3.0"):GetReverseLookupTable()
-local DUMP = LibStub("LibTextDump-1.0")
-local TOAST = LibStub("LibToast-1.0")
local ST = LibStub("ScrollingTable")
+local QTIP = LibStub("LibQTip-1.0")
+local DUMP = LibStub("LibTextDump-1.0")
local tinsert, tsort, tconcat, tremove = _G.table.insert, _G.table.sort, _G.table.concat, _G.table.remove
local mfloor = _G.math.floor
@@ -314,52 +314,52 @@ function RE:GetMercenaryStatus(databaseID)
return not (RE.Database[databaseID].PlayerSide == RE.PlayerFaction)
end
-function RE:GetBGToast(databaseID)
- local toast = {}
+function RE:GetBGScoreText(databaseID)
+ local text = {}
local savedFilters = RE.Settings.Filters
RE.Settings.Filters = {["Spec"] = _G.ALL, ["Map"] = RE.Database[databaseID].Map, ["Bracket"] = 1, ["Date"] = {0, 0}, ["Season"] = 0}
local playerData = RE:GetPlayerData(databaseID)
local placeKB, placeHK, placeHonor, placeDamage, placeHealing = unpack(RE.Database[databaseID].BGPlace[2])
local _, topKB, _, topHK, _, topHonor, _, topDamage, _, topHealing = RE:GetStats(1, false, true)
RE.Settings.Filters = savedFilters
- tinsert(toast, RE:InsideToast("KB", playerData[2], databaseID, placeKB, topKB))
- tinsert(toast, RE:InsideToast("HK", playerData[3], databaseID, placeHK, topHK))
- tinsert(toast, RE:InsideToast(_G.HONOR, playerData[5], databaseID, placeHonor, topHonor))
- tinsert(toast, RE:InsideToast(_G.DAMAGE, playerData[10], databaseID, placeDamage, topDamage))
- tinsert(toast, RE:InsideToast(_G.SHOW_COMBAT_HEALING, playerData[11], databaseID, placeHealing, topHealing))
- return tconcat(toast, "")
+ tinsert(text, RE:ScoreTextParser("KB", playerData[2], databaseID, placeKB, topKB))
+ tinsert(text, RE:ScoreTextParser("HK", playerData[3], databaseID, placeHK, topHK))
+ tinsert(text, RE:ScoreTextParser(_G.HONOR, playerData[5], databaseID, placeHonor, topHonor))
+ tinsert(text, RE:ScoreTextParser(_G.DAMAGE, playerData[10], databaseID, placeDamage, topDamage))
+ tinsert(text, RE:ScoreTextParser(_G.SHOW_COMBAT_HEALING, playerData[11], databaseID, placeHealing, topHealing))
+ return tconcat(text, " |cFF808080|||r ")
end
-function RE:GetArenaToast(mode)
+function RE:GetArenaStatsTooltip(mode)
if #RE.TableArena.filtered > 0 then
local payload = RE:GetArenaTeamStats(mode)
- local title = "|cFF74D06CRE|r|cFFFFFFFFFlex|r"
- local toast = {}
+ RE.Tooltip = QTIP:Acquire("REFlexTooltipArena", 1, "CENTER")
+ RE.Tooltip:SmartAnchorTo(_G.REFlexFrame_StatsButton)
if mode == 1 then
- title = title.." "..L["Most common teams"]
+ RE.Tooltip:AddHeader("|cFF74D06C"..L["Most common teams"].."|r")
elseif mode == 2 then
- title = title.." "..L["Easiest teams"]
+ RE.Tooltip:AddHeader("|cFF74D06C"..L["Easiest teams"].."|r")
else
- title = title.." "..L["Hardest teams"]
+ RE.Tooltip:AddHeader("|cFF74D06C"..L["Hardest teams"].."|r")
end
+ RE.Tooltip:AddLine()
+ RE.Tooltip:AddLine()
for _, v in pairs(payload) do
local members = {strsplit(";", v[1])}
for i=1, #members do
local class, spec = strsplit("-", members[i])
- tinsert(toast, "|c".._G.RAID_CLASS_COLORS[class]:GenerateHexColor().._G.LOCALIZED_CLASS_NAMES_MALE[class].." "..spec.."|r|n")
+ RE.Tooltip:AddLine("|c".._G.RAID_CLASS_COLORS[class]:GenerateHexColor().._G.LOCALIZED_CLASS_NAMES_MALE[class].." "..spec.."|r")
end
if mode == 1 then
- tinsert(toast, "|cFFFFFFFF"..v[2].."|r | |cFF00FF00"..v[3].."|r - |cFFFF0000"..v[4].."|r|n|n")
+ RE.Tooltip:AddLine("|cFFFFFFFF"..v[2].."|r | |cFF00FF00"..v[3].."|r - |cFFFF0000"..v[4].."|r")
elseif mode == 2 then
- tinsert(toast, "|cFF00FF00"..v[3].."|r - |cFFFF0000"..v[4].."|r | |cFFFFFFFF"..v[2].."|n|n")
+ RE.Tooltip:AddLine("|cFF00FF00"..v[3].."|r - |cFFFF0000"..v[4].."|r | |cFFFFFFFF"..v[2])
else
- tinsert(toast, "|cFFFF0000"..v[4].."|r - |cFF00FF00"..v[3].."|r | |cFFFFFFFF"..v[2].."|n|n")
+ RE.Tooltip:AddLine("|cFFFF0000"..v[4].."|r - |cFF00FF00"..v[3].."|r | |cFFFFFFFF"..v[2])
end
+ RE.Tooltip:AddLine()
end
- if #toast > 1 then
- toast[#toast] = toast[#toast]:gsub("|n|n", "")
- TOAST:Spawn("REFlexToastArena", title, tconcat(toast, ""))
- end
+ RE.Tooltip:Show()
end
end
@@ -653,17 +653,13 @@ function RE:HKBarUpdate()
_G.REFlexFrame_HKBar_I:SetValue(hk)
end
-function RE:InsideToast(label, value, databaseID, place, top)
- local toast = {}
- tinsert(toast, "|cFFC5F3BC"..label..":|r |cFFFFFFFF"..RE:AbbreviateNumbers(value).." - "..place.."/"..RE.Database[databaseID].PlayersNum.."|r")
+function RE:ScoreTextParser(label, value, databaseID, place, top)
+ local text = {}
+ tinsert(text, "|cFF90EE90"..label..":|r |cFFFFFFFF"..RE:AbbreviateNumbers(value).." - "..place.."/"..RE.Database[databaseID].PlayersNum.."|r")
if value > top then
- tinsert(toast, " |cFFFFFFFF-|r |TInterface\\GroupFrame\\UI-Group-LeaderIcon:14:14:0:0|t")
+ tinsert(text, " |TInterface\\GroupFrame\\UI-Group-LeaderIcon:14:14:0:0|t")
end
- tinsert(toast, "|n")
- return tconcat(toast, "")
-end
-
-function RE:CloseToast()
+ return tconcat(text, "")
end
function RE:HideEntry(databaseID)
diff --git a/REFlexStructures.lua b/REFlexStructures.lua
index d57e968..4f10c3a 100644
--- a/REFlexStructures.lua
+++ b/REFlexStructures.lua
@@ -10,7 +10,6 @@ local ReloadUI = _G.ReloadUI
RE.DefaultConfig = {
["MiniMapButtonSettings"] = {["hide"] = false},
- ["Toasts"] = true,
["ShowServerName"] = false,
["CurrentTab"] = 1,
["Filters"] = {["Spec"] = _G.ALL, ["Map"] = 1, ["Bracket"] = 1, ["Date"] = {0, 0}, ["Season"] = 0, ["DateMode"] = 1},
@@ -183,9 +182,9 @@ for classID=1, _G.MAX_CLASSES do
end
RE.StatsDropDown = {
- { text = L["Most common teams"], notCheckable = true, func = function() RE:GetArenaToast(1) end },
- { text = L["Easiest teams"], notCheckable = true, func = function() RE:GetArenaToast(2) end },
- { text = L["Hardest teams"], notCheckable = true, func = function() RE:GetArenaToast(3) end }
+ { text = L["Most common teams"], notCheckable = true, func = function() RE:GetArenaStatsTooltip(1) end },
+ { text = L["Easiest teams"], notCheckable = true, func = function() RE:GetArenaStatsTooltip(2) end },
+ { text = L["Hardest teams"], notCheckable = true, func = function() RE:GetArenaStatsTooltip(3) end }
}
RE.AceConfig = {
@@ -199,21 +198,12 @@ RE.AceConfig = {
set = function(_, val) RE.Settings.MiniMapButtonSettings.hide = val; RE:UpdateConfig() end,
get = function(_) return RE.Settings.MiniMapButtonSettings.hide end
},
- toasts = {
- name = L["Enable battleground summary"],
- desc = L["Display toast with battleground summary after completed match."],
- type = "toggle",
- width = "full",
- order = 2,
- set = function(_, val) RE.Settings.Toasts = val end,
- get = function(_) return RE.Settings.Toasts end
- },
servername = {
name = L["Display server names"],
desc = L["Show player server name in match detail tooltip."],
type = "toggle",
width = "full",
- order = 3,
+ order = 2,
set = function(_, val) RE.Settings.ShowServerName = val end,
get = function(_) return RE.Settings.ShowServerName end
},
@@ -222,7 +212,7 @@ RE.AceConfig = {
desc = L["A minimal number of matches required to be included in arena team composition statistics."],
type = "range",
width = "double",
- order = 4,
+ order = 3,
min = 1,
max = 10,
step = 1,
@@ -234,7 +224,7 @@ RE.AceConfig = {
desc = L["Rating display always compares the values with the previous week."],
type = "select",
width = "double",
- order = 5,
+ order = 4,
values = {
[1] = L["Current session"],
[2] = _G.HONOR_TODAY,
@@ -249,7 +239,7 @@ RE.AceConfig = {
type = "execute",
width = "double",
confirm = true,
- order = 6,
+ order = 5,
func = function() _G.REFlexDatabase = {}; _G.REFlexHonorDatabase = {}; ReloadUI() end
},
deleteoldseason = {
@@ -258,7 +248,7 @@ RE.AceConfig = {
type = "execute",
width = "double",
confirm = true,
- order = 7,
+ order = 6,
func = function() RE:SeasonPurge(); ReloadUI() end
}
}