Skip to content

Commit 99c7f21

Browse files
committed
Completely rewrote the config UI in blizzard's new style
1 parent 0f6dd21 commit 99c7f21

34 files changed

+1738
-1414
lines changed

.pkgmeta

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ externals:
22
libs/LibStub: https://repos.wowace.com/wow/ace3/trunk/LibStub
33
libs/CallbackHandler-1.0: https://repos.wowace.com/wow/ace3/trunk/CallbackHandler-1.0
44
libs/AceAddon-3.0: https://repos.wowace.com/wow/ace3/trunk/AceAddon-3.0
5-
libs/AceGUI-3.0: https://repos.wowace.com/wow/ace3/trunk/AceGUI-3.0
6-
libs/AceConfig-3.0: https://repos.wowace.com/wow/ace3/trunk/AceConfig-3.0
75
libs/AceConsole-3.0: https://repos.wowace.com/wow/ace3/trunk/AceConsole-3.0
86
libs/AceHook-3.0: https://repos.wowace.com/wow/ace3/trunk/AceHook-3.0
97
libs/AceEvent-3.0: https://repos.wowace.com/wow/ace3/trunk/AceEvent-3.0

ImportExportUtilV2.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
local LOADOUT_SERIALIZATION_VERSION = 2;
22
if C_Traits.GetLoadoutSerializationVersion() ~= LOADOUT_SERIALIZATION_VERSION then return; end -- Only load for serialization version 2
33

4-
local _, TTT = ...
4+
--- @class TTT_NS
5+
local ns = select(2, ...);
6+
57
--- @class TalentTreeTweaks_ImportExportUtilV2
68
local ImportExportUtil = {};
7-
TTT.ImportExportUtil = ImportExportUtil;
9+
ns.ImportExportUtil = ImportExportUtil;
810

911
local LTT = LibStub('LibTalentTree-1.0');
1012
ImportExportUtil.LibTalentTree = LTT;
@@ -40,8 +42,8 @@ local function fixLoadoutString(loadoutString, specID)
4042
end
4143

4244
function ImportExportUtil:GetLoadoutExportString(talentsTab, configIDOverride)
43-
if (TTT.Util:GetSpecIDFromConfigID(configIDOverride)) then
44-
local specID = TTT.Util:GetSpecIDFromConfigID(configIDOverride);
45+
if (ns.Util:GetSpecIDFromConfigID(configIDOverride)) then
46+
local specID = ns.Util:GetSpecIDFromConfigID(configIDOverride);
4547
local loadoutString = C_Traits.GenerateImportString(configIDOverride);
4648
if loadoutString and loadoutString ~= '' then
4749
return fixLoadoutString(loadoutString, specID);
@@ -70,13 +72,13 @@ end
7072

7173
--- @return false|number # specID or false on error
7274
--- @return number|string # classID or errorMessage on error
73-
--- @return nil|TalentTreeTweaks_Util_LoadoutContent[] # loadoutInfo or nothing on error
75+
--- @return nil|TTT_Util_LoadoutContent[] # loadoutInfo or nothing on error
7476
function ImportExportUtil:ParseTalentBuildString(importString)
7577
local importStream = ExportUtil.MakeImportDataStream(importString);
7678

7779
local headerValid, serializationVersion, specIDFromString, treeHash = self:ReadLoadoutHeader(importStream);
7880
local classFileName = select(6, GetSpecializationInfoByID(specIDFromString));
79-
local classIDFromString = TTT.Util.classMap[classFileName];
81+
local classIDFromString = ns.Util.classMap[classFileName];
8082

8183
if(not headerValid) then
8284
return false, LOADOUT_ERROR_BAD_STRING;

SharedUtil.lua

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
local _, TTT = ...
1+
--- @class TTT_NS
2+
local ns = select(2, ...);
3+
24
--- @class TalentTreeTweaks_Util
35
local Util = {};
4-
TTT.Util = Util;
5-
local L = TTT.L;
6-
--- @type TalentTreeTweaks_ImportExportUtilV2
7-
local ImportExportUtil = TTT.ImportExportUtil;
6+
ns.Util = Util;
7+
local L = ns.L;
8+
local ImportExportUtil = ns.ImportExportUtil;
89

910
local talentAddonName = 'Blizzard_PlayerSpells';
1011

@@ -94,29 +95,6 @@ function Util:OnInitialize()
9495
self:RefreshConfigIDLookup();
9596
end
9697

97-
--- @generic T: table
98-
--- @param db table
99-
--- @param defaults T
100-
--- @return T
101-
function Util:PrepareModuleDb(module, db, defaults)
102-
module.db = db;
103-
for k, v in pairs(defaults) do
104-
if db[k] == nil then
105-
db[k] = v;
106-
end
107-
end
108-
109-
return db;
110-
end
111-
112-
function Util:GetterSetterIncrementFactory(db, postSetCallback)
113-
local getter = function(info) return db[info[#info]]; end
114-
local setter = function(info, value) db[info[#info]] = value; if postSetCallback then postSetCallback(); end end
115-
local increment = CreateCounter(5);
116-
117-
return getter, setter, increment;
118-
end
119-
12098
function Util:ContinueOnAddonLoaded(addonName, callback)
12199
if C_AddOns.IsAddOnLoaded(addonName) then
122100
callback();
@@ -273,7 +251,7 @@ end
273251

274252
--- @return false|number # specID or false on error
275253
--- @return number|string # classID or errorMessage on error
276-
--- @return nil|TalentTreeTweaks_Util_LoadoutContent[] # loadoutInfo or nothing on error
254+
--- @return nil|TTT_Util_LoadoutContent[] # loadoutInfo or nothing on error
277255
function Util:ParseTalentBuildString(importString)
278256
return ImportExportUtil:ParseTalentBuildString(importString);
279257
end

TalentTreeTweaks.toc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ core.lua
2828
ImportExportUtilV2.lua
2929
SharedUtil.lua
3030

31+
settingsTemplates.xml
32+
config.lua
33+
3134
modules\reduceTaint.lua
32-
modules\dropdownReplacement.xml
3335

3436
modules\tooltipIds.lua
3537
modules\exportInspectedBuild.lua

0 commit comments

Comments
 (0)