Skip to content

Commit

Permalink
start categories
Browse files Browse the repository at this point in the history
  • Loading branch information
Krowi authored and Krowi committed Nov 10, 2024
1 parent f156acc commit 082c554
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Api/CategoryDataApi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
local _, addon = ...;

KrowiAF.CategoryData = {};

function KrowiAF.AddCategoryData(id, name, canMerge)
addon.Data.Categories[id] = addon.Objects.Category:New(id, name, canMerge);
end
1 change: 1 addition & 0 deletions Api/Files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Script file="Api.lua" />
<Script file="AchievementDataApi.lua" />
<Script file="BuildVersionDataApi.lua" />
<Script file="CategoryDataApi.lua" />
<Script file="EventDataApi.lua" />
<Script file="PetBattleLinkDataApi.lua" />
<Script file="TabDataApi.lua" />
Expand Down
9 changes: 9 additions & 0 deletions DataAddons/Loaders/CategoryData.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local _, addon = ...;

-- for k1, v1 in next, KrowiAF.TabData do
-- for k2, v2 in next, v1 do
-- if addon.Util.IsTable(v2) and not addon.Util.IsFunction(v2[1]) then
-- tinsert(KrowiAF.TabData[k1][k2], 1, KrowiAF.AddTabData);
-- end
-- end
-- end
1 change: 1 addition & 0 deletions DataAddons/Loaders/Files.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Ui>
<Script file="AchievementData.lua" />
<Script file="BuildVersionData.lua" />
<Script file="CategoryData.lua" />
<Script file="EventData.lua" />
<Script file="PetBattleLinkData.lua" />
<Script file="TabData.lua" />
Expand Down
73 changes: 73 additions & 0 deletions DataAddons/Shared/CategoryData.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
local _, addon = ...;
addon.Data.CategoryData = {};
addon.Data.CategoryData.Shared = {};
local shared = addon.Data.CategoryData.Shared;

KrowiAF.CategoryData.Achievements = { -- TAB - Expansions
883, -- Id
addon.L["Expansions"], -- Name
{
{ -- Cross-Expansion
1431,
addon.L["Cross-Expansion"],
{
{ -- Zones
1160,
addon.L["Zones"],
{
{ -- Exile's Reach
953,
(select(2, addon.GetAchievementInfo(14222))),
{}, -- No child categories so empty table
{14222}
},
},
},
{ -- Character
1432,
addon.GetCategoryInfoTitle(92),
{},
{
6, 7, 8, 9, 14782, 14783, 15805, 19459, 10, 11,
12, 13, 4826, 6193, 9060, 10671, 12544, 7382, 7383, 7384,
7380, 546, 1176, 1177, 1178, 1180, 1181, 5455, 5456, 6753,
558, 559, 891, 889, 890, 5180, 892, 2357, 2358, 2359,
545, 557, 556, 5373, 5372, 6348, 6349, 9707, 9708, 10764,
10765, 12546, 12547, 14796, 14797, 705, 16, 2716, 17334, 19489,
}, -- Achievements table
}
},
},
},
};


KrowiAF.CategoryData.Achievements = {
{ -- TAB - Expansions
883, -- Id
addon.L["Expansions"], -- Name
{
IsTab = true,
},
},
{ -- Cross-Expansion
1431,
addon.L["Cross-Expansion"],
883, -- Parent
},
{ -- Zones
1160,
addon.L["Zones"],
1431,
},
{ -- Exile's Reach
953,
(select(2, addon.GetAchievementInfo(14222))),
1160,
},
{ -- Character
1432,
addon.GetCategoryInfoTitle(92),
1431,
},
};
1 change: 1 addition & 0 deletions DataAddons/Shared/Files.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Ui>
<Script file="AchievementData.lua" />
<Script file="BuildVersionData.lua" />
<Script file="CategoryData.lua" />
<Script file="EventData.lua" />
<Script file="PetBattleLinkData.lua" />
<Script file="TabData.lua" />
Expand Down

0 comments on commit 082c554

Please sign in to comment.