I already have code that does what you want.
Give me like maybe an hour or so until I'm ready to leave bed so I can get the code from my PC.
ArchaeologyFindsTotals.toc:
Code:
## Interface: 70100
## Title: Archaeology Find Totals
## Notes: Displays the total number of finds for each race on the summary page of the archaeology journal.
## LoadOnDemand: 1
## LoadWith: Blizzard_ArchaeologyUI
ArchaeologyFindsTotals.lua
ArchaeologyFindsTotals.lua:
lua Code:
-- total number of artifacts per race; change the 99s to actual numbers
local perRace = {
10, -- Demonic
8, -- Highmountain Tauren
10, -- Highborne
12, -- Ogre
21, -- Draenor Clans
12, -- Arakkora
12, -- Mogu
12, -- Pandaren
10, -- Mantid
7, -- Vrykul
17, -- Troll
13, -- Tol'vir
10, -- Orc
9, -- Nerubian
25, -- Night Elf
17, -- Fossil
10, -- Draenei
31, -- Dwarf
}
-- GetNumArtifactsByRace includes the current project, which may not have been completed before.
-- This returns the number of artifacts that have been completed.
local function GetCompletedByRace(raceIndex)
local count = 0
local numArtifacts = GetNumArtifactsByRace(raceIndex)
if numArtifacts and numArtifacts > 0 then
for i = 1, numArtifacts do
if select(9, GetArtifactInfoByRace(raceIndex, i)) > 0 then
count = count + 1
end
end
end
return count
end
-- request history when archaeology window opened
ArchaeologyFrame:HookScript("OnShow", RequestArtifactCompletionHistory)
-- this function updates the summary page and runs in reaction to ARTIFACT_HISTORY_READY triggered by the above request
hooksecurefunc(ArchaeologyFrame.summaryPage, "UpdateFrame", function(self)
for i = 1, ARCHAEOLOGY_MAX_RACES do
local raceIndex = i + (ARCHAEOLOGY_MAX_RACES*(self.currentPage-1))
local button = _G["ArchaeologyFrameSummaryPageRace" .. i]
if button:IsEnabled() then
local name, _, _, currencyAmount, projectAmount = GetArchaeologyRaceInfo(raceIndex)
local done = GetCompletedByRace(raceIndex)
button.raceName:SetText(format("%s\n%d/%d\n%d of %d", name, currencyAmount, projectAmount, done, perRace[raceIndex]))
end
end
end)
-- this moves the 12 buttons up a bit to make room for the extra line of text
local anchorPoint, relativeTo, relativePoint, x, y = ArchaeologyFrameSummaryPageRace1:GetPoint()
ArchaeologyFrameSummaryPageRace1:SetPoint(anchorPoint, relativeTo, relativePoint, x, y+20)
-- makes the text darker
for i = 1,ARCHAEOLOGY_MAX_RACES do
_G["ArchaeologyFrameSummaryPageRace" .. i].raceName:SetTextColor(0, 0, 0)
end
(Credits go to
Gello for this.)
This will add counters to the archaeology page showing you how many finds have been completed per race.
If you want it to print to chatbox instead, you should be able to change it so instead of changing the text on the archaeology pages, it would print the values to chat instead.