diff --git a/HistOffline.lua b/HistOffline.lua
index 3787cb3..f1a9d25 100644
--- a/HistOffline.lua
+++ b/HistOffline.lua
@@ -42,8 +42,14 @@ dofile "./data/Quest.lua"
dofile "./data/Veteran.lua" -- Auxillary Achievements for Vet Dungeons
dofile "./data/WB.lua"
dofile "./data/Trial.lua"
+dofile "./data/Special.lua" -- Record of non standard Achievment ID's we need to keep.
dofile "./data/utility.lua" -- utility functions
+-- generate_id () -- Generate the file the addon uses to filter Achievement ID's
+-- Uncomment when need to run.
+
+
+
-- generate achievement lookups from key (cell)
for _,i in ipairs(Grp_Order) do
Grp_Dat[i].reverse_id = reverse_id(Grp_Dat[i].id)
@@ -490,6 +496,7 @@ end
}
end
+ -- these IDs are in Specials.lua
--Set background of heading if all done
if thischar.ach[1073] ~= nil then --EP Vanquisher
iup.SetAttribute(me.Grp["1N"].box, "BGCOLOR0:1", Colour_Heading_Complete)
diff --git a/data/Quest.lua b/data/Quest.lua
index c65aac0..8259a6c 100644
--- a/data/Quest.lua
+++ b/data/Quest.lua
@@ -66,14 +66,14 @@ SQ_dat = {
--["33"] = "Greenshade",
[511] = {L=3, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Pelidil%27s_End"},
--[945] = {L=3, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Striking_at_the_Heart"}, -- Striking is a composite of 3 quests
-[512] = {L=3, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Striking_at_the_Heart"}, -- Achievement grantin skill pt is Valenwood Protector
+[512] = {L=3, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Striking_at_the_Heart"}, -- Achievement granting skill pt is Valenwood Protector
[510] = {L=3, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Throne_of_the_Wilderking"},
-- Malabal-Tor
[284] = {L=4, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:The_Prisoner_of_Jathsogur"},
[283] = {L=4, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Reap_What_Is_Sown"},
---- Has no Achievement
-["X"] = {L=4, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Buyer_Beware"},
+[99999999] = {L=4, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:Buyer_Beware"},
--Reapers march
[538] = {L=5, C=3, ["link1"] = "http://www.uesp.net/wiki/Online:The_Den_of_Lorkhaj"},
diff --git a/data/ids.lua b/data/ids.lua
new file mode 100644
index 0000000..71aa165
--- /dev/null
+++ b/data/ids.lua
@@ -0,0 +1,278 @@
+hist.IDs = {
+-- GRP 1N
+[272] = true,
+[81] = true,
+[570] = true,
+[417] = true,
+[551] = true,
+[357] = true,
+[294] = true,
+[391] = true,
+[325] = true,
+[393] = true,
+[410] = true,
+[11] = true,
+[80] = true,
+[301] = true,
+[78] = true,
+[79] = true,
+-- GRP 1V
+[1653] = true,
+[1617] = true,
+[1597] = true,
+[1635] = true,
+[1556] = true,
+[1589] = true,
+[1573] = true,
+[1623] = true,
+[1549] = true,
+[1641] = true,
+[1610] = true,
+[1604] = true,
+[1629] = true,
+[1581] = true,
+[1565] = true,
+[1647] = true,
+-- GRP 1VH
+[1658] = true,
+[1617] = true,
+[1586] = true,
+[1640] = true,
+[1652] = true,
+[1602] = true,
+[1578] = true,
+[1554] = true,
+[1608] = true,
+[1561] = true,
+[1594] = true,
+[1634] = true,
+[1628] = true,
+[1570] = true,
+[1646] = true,
+[1615] = true,
+-- GRP 2N
+[1616] = true,
+[1603] = true,
+[1562] = true,
+[1587] = true,
+[1579] = true,
+[1555] = true,
+[1595] = true,
+[1571] = true,
+-- GRP 2V
+[464] = true,
+[545] = true,
+[878] = true,
+[459] = true,
+[876] = true,
+[421] = true,
+[678] = true,
+[343] = true,
+-- GRP 2VH
+[448] = true,
+[681] = true,
+[1114] = true,
+[467] = true,
+[1084] = true,
+[451] = true,
+[342] = true,
+[463] = true,
+-- Craglorn N
+[1462] = true,
+[1474] = true,
+[1503] = true,
+-- Craglorn V
+[1080] = true,
+[1081] = true,
+[992] = true,
+[1123] = true,
+[1124] = true,
+[990] = true,
+[870] = true,
+[991] = true,
+-- Craglorn VH
+[1136] = true,
+[1137] = true,
+[1138] = true,
+[1140] = true,
+-- DLC
+[1304] = true,
+[1305] = true,
+[1346] = true,
+[1120] = true,
+[1236] = true,
+[880] = true,
+[1345] = true,
+[1239] = true,
+-- SQ
+[512] = true,
+[516] = true,
+[517] = true,
+[518] = true,
+[201] = true,
+[204] = true,
+[589] = true,
+[590] = true,
+[335] = true,
+[336] = true,
+[209] = true,
+[146] = true,
+[147] = true,
+[597] = true,
+[598] = true,
+[599] = true,
+[536] = true,
+[537] = true,
+[154] = true,
+[155] = true,
+[28] = true,
+[605] = true,
+[30] = true,
+[31] = true,
+[612] = true,
+[613] = true,
+[614] = true,
+[360] = true,
+[361] = true,
+[362] = true,
+[363] = true,
+[364] = true,
+[365] = true,
+[538] = true,
+[99999999] = true,
+[283] = true,
+[284] = true,
+[156] = true,
+[950] = true,
+[337] = true,
+[184] = true,
+[185] = true,
+[607] = true,
+[606] = true,
+[145] = true,
+[591] = true,
+[510] = true,
+[511] = true,
+-- Pub
+[368] = true,
+[1056] = true,
+[370] = true,
+[1052] = true,
+[396] = true,
+[1050] = true,
+[374] = true,
+[390] = true,
+[376] = true,
+[1049] = true,
+[378] = true,
+[1051] = true,
+[300] = true,
+[1053] = true,
+[1054] = true,
+[1055] = true,
+-- WB
+[384] = true,
+[257] = true,
+[386] = true,
+[387] = true,
+[260] = true,
+[261] = true,
+[262] = true,
+[263] = true,
+[399] = true,
+[400] = true,
+[401] = true,
+[402] = true,
+[275] = true,
+[276] = true,
+[277] = true,
+[278] = true,
+[279] = true,
+[280] = true,
+[153] = true,
+[158] = true,
+[159] = true,
+[160] = true,
+[161] = true,
+[162] = true,
+[163] = true,
+[425] = true,
+[426] = true,
+[427] = true,
+[428] = true,
+[429] = true,
+[430] = true,
+[560] = true,
+[561] = true,
+[562] = true,
+[563] = true,
+[564] = true,
+[565] = true,
+[439] = true,
+[696] = true,
+[697] = true,
+[698] = true,
+[187] = true,
+[188] = true,
+[189] = true,
+[190] = true,
+[191] = true,
+[192] = true,
+[195] = true,
+[196] = true,
+[197] = true,
+[198] = true,
+[199] = true,
+[200] = true,
+[210] = true,
+[211] = true,
+[212] = true,
+[213] = true,
+[214] = true,
+[345] = true,
+[346] = true,
+[347] = true,
+[348] = true,
+[349] = true,
+[350] = true,
+[351] = true,
+[352] = true,
+[353] = true,
+[354] = true,
+[355] = true,
+[356] = true,
+[441] = true,
+[442] = true,
+[444] = true,
+[443] = true,
+[440] = true,
+[259] = true,
+[258] = true,
+[701] = true,
+[699] = true,
+[495] = true,
+[496] = true,
+[497] = true,
+[498] = true,
+[499] = true,
+[500] = true,
+[700] = true,
+[148] = true,
+[149] = true,
+[152] = true,
+[150] = true,
+[151] = true,
+[404] = true,
+[403] = true,
+[385] = true,
+[382] = true,
+[383] = true,
+-- Specials
+[1073] = true,
+[1074] = true,
+[1075] = true,
+[1068] = true,
+[1069] = true,
+[1070] = true,
+[1139] = true,
+}
diff --git a/data/special.lua b/data/special.lua
new file mode 100644
index 0000000..503c425
--- /dev/null
+++ b/data/special.lua
@@ -0,0 +1,9 @@
+Special_dat = {
+[1073] = "EP Vanquisher",
+[1074] = "DC Vanquisher",
+[1075] = "AD Vanquisher",
+[1068] = "EP Conqueror",
+[1069] = "EP Conqueror",
+[1070] = "DC Conqueror",
+[1139] = "Craglorn Trials Conqueror",
+}
diff --git a/data/utility.lua b/data/utility.lua
index 4c9c958..764fb8b 100644
--- a/data/utility.lua
+++ b/data/utility.lua
@@ -110,3 +110,54 @@ box_mousemove_funct = function (self, l, c)
detail_desc.title = Ach_Detail[ach].description
end
+
+generate_id=function()
+--write a combined list of achievement id we look for to add to the in-game part (cut and paste) for filtering
+ outfile=io.open("data/ids.lua", "w")
+
+ if outfile == nil then
+ print ("Couldn't open id.lua file for writing.")
+ end
+ outfile:write("hist.IDs = {" .. "\n")
+
+ for _,i in ipairs(Grp_Order) do
+ outfile:write("-- GRP " .. i .. "\n")
+ for j,_ in pairs (Grp_Dat[i].id) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+ end
+
+ for _,i in ipairs(Craglorn_Order) do
+ outfile:write("-- Craglorn " .. i .. "\n")
+ for j,_ in pairs (Craglorn_Dat[i].id) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+ end
+
+ outfile:write("-- DLC " .. "\n")
+ for j,_ in pairs (DLC_Dat.id) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+
+ outfile:write("-- SQ " .. "\n")
+ for j,_ in pairs (SQ_dat) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+
+ outfile:write("-- Pub " .. "\n")
+ for j,_ in pairs (Pub_Dat.id) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+
+ outfile:write("-- WB " .. "\n")
+ for j,_ in pairs (WB_dat) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+
+ outfile:write("-- Specials " .. "\n")
+ for j,_ in pairs (Special_dat) do
+ outfile:write("[" .. j .. "] = true,\n")
+ end
+ outfile:write("}" .. "\n")
+ outfile:close()
+end
diff --git a/history.lua b/history.lua
index 911af0d..706bd81 100644
--- a/history.lua
+++ b/history.lua
@@ -1,6 +1,6 @@
hist = {
name = "history",
- version = "34",
+ version = "35",
initialised = false,
SV={},
L={},
@@ -39,11 +39,13 @@ table.insert(hist.me.log,{["TimeStamp"]=GetTimeStamp(),
})
end
-local Keep_Achievement = function (cat) -- is this an achievement we want to save?
-if cat == 3 or cat == 4 or cat == 5 or cat == nil then
-return false
-end
-return true
+local Keep_Achievement = function (id) -- is this an achievement we want to save?
+
+ if hist.IDs[id] then
+ return true
+ else
+ return false
+ end
end
local function get_start () -- get better start date from Achievements
@@ -79,7 +81,7 @@ local function Achievement(_, name, points, id, link)
local category_id = GetCategoryInfoFromAchievementId(id)
local category_name =GetAchievementCategoryInfo(category_id)
_,description,_,_,_,_,_= GetAchievementInfo(id)
- if Keep_Achievement(category_id) then
+ if Keep_Achievement(id) then
hist.me.ach[id] = {}
hist.me.ach[id].Category_ID = category_id
hist.me.ach[id].Category = category_name
@@ -112,7 +114,7 @@ function load_history()
name,description,points,_,completed,adate,atime= GetAchievementInfo(i)
if completed then
local category_id = GetCategoryInfoFromAchievementId(i) -- nil if bad
- if Keep_Achievement(category_id) then
+ if category_id ~= nil and Keep_Achievement(i) then
if hist.me.ach[i] == nil then
hist.me.ach[i] = {}
hist.me.ach[i].Category_ID = category_id
@@ -353,12 +355,12 @@ local function Dead()
end
-del_old_categories = function()
+del_old_Achievements = function()
local count = 0
for playerID, player in pairs (hist.SV.data) do
- log("Deleting old categories for " .. player.name)
+ log("Deleting old Achievements for " .. player.name)
for ID, ach in pairs (player.ach) do
- if not (Keep_Achievement (ach["Category_ID"])) then
+ if not (Keep_Achievement (ID)) then
player.ach[ID] = nil
count = count +1
end
@@ -468,11 +470,17 @@ if (hist.name ~= addOnName) then return end
--remove old achievement categories
if hist.SV.cleaned1 == nil then
- del_old_categories()
del_old_levels()
hist.SV.cleaned1 = 1
end
+ if hist.SV.cleaned1 == 1 then
+ del_old_Achievements()
+ hist.SV.cleaned1 = 2
+ log("Deleted Old Achievements, cleaned1=2")
+ end
+
+
if (hist.SV.start_version == nil ) then
hist.SV.start_version = hist.version
end
diff --git a/history.txt b/history.txt
index ea45ff4..1c478a8 100644
--- a/history.txt
+++ b/history.txt
@@ -1,9 +1,10 @@
## Title: Dad's History
## APIVersion: 100017 100018
-## Version: 34
+## Version: 35
## Author: HisDad
## Description: Record progress of all characters for offline viewing.
## SavedVariables: History_SV
timetable.lua
history.lua
+data/ids.lua