diff --git a/SharedUtil.lua b/SharedUtil.lua index 5801727..e18522e 100644 --- a/SharedUtil.lua +++ b/SharedUtil.lua @@ -3,12 +3,10 @@ local _, TTT = ... local Util = {}; TTT.Util = Util; local L = TTT.L; ---- @type TalentTreeTweaks_ImportExportUtilV1|TalentTreeTweaks_ImportExportUtilV2 +--- @type TalentTreeTweaks_ImportExportUtilV2 local ImportExportUtil = TTT.ImportExportUtil; -local isDF = select(4, GetBuildInfo()) < 110000; -Util.isDF = isDF; -local talentAddonName = isDF and 'Blizzard_ClassTalentUI' or 'Blizzard_PlayerSpells'; +local talentAddonName = 'Blizzard_PlayerSpells'; local LTT = LibStub('LibTalentTree-1.0'); Util.LibTalentTree = LTT; @@ -86,6 +84,10 @@ function Util:OnInitialize() self:RefreshConfigIDLookup(); end +--- @generic T: table +--- @param db table +--- @param defaults T +--- @return T function Util:PrepareModuleDb(module, db, defaults) module.db = db; for k, v in pairs(defaults) do @@ -93,6 +95,8 @@ function Util:PrepareModuleDb(module, db, defaults) db[k] = v; end end + + return db; end function Util:GetterSetterIncrementFactory(db, postSetCallback) @@ -144,7 +148,7 @@ function Util:CopyText(text, optionalTitleSuffix) end function Util:GetTalentContainerFrame(noAutoload) - local frameName = isDF and 'ClassTalentFrame' or 'PlayerSpellsFrame'; + local frameName = 'PlayerSpellsFrame'; if not _G[frameName] and not noAutoload then C_AddOns.LoadAddOn(talentAddonName); end diff --git a/modules/alwaysShowGates.lua b/modules/alwaysShowGates.lua index 72f9b7d..caf9262 100644 --- a/modules/alwaysShowGates.lua +++ b/modules/alwaysShowGates.lua @@ -27,8 +27,8 @@ function Module:OnDisable() if talentFrame then self.gatePool:ReleaseAll(); talentFrame:RefreshGates(); - if not Util.isDF and talentFrame.HeroTalentsContainer then - talentFrame.HeroTalentsContainer:SetPoint("TOP", talentFrame.ButtonsParent, 'TOP', -15, 0) + if talentFrame.HeroTalentsContainer then + talentFrame:UpdateSpecBackground(); end end end @@ -41,6 +41,24 @@ function Module:GetName() return L['Always Show Gates']; end +function Module:GetOptions(defaultOptionsTable, db) + self.db = Util:PrepareModuleDb(self, db, { + shiftHeroTrees = false, + }); + local getter, setter, increment = Util:GetterSetterIncrementFactory(db, function() self:UpdateHeroContainerPosition(); end); + + defaultOptionsTable.args.shiftHeroTrees = { + order = increment(), + type = "toggle", + name = L["Shift Hero Talent Trees"], + desc = L["Shifts the Hero Talent Trees to the left to avoid overlapping with the gate text."], + get = getter, + set = setter, + } + + return defaultOptionsTable; +end + function Module:SetupHook() local talentTab = Util:GetTalentFrame(); -- We have to create our own gatePool, because otherwise we will cause massive taint issues @@ -66,7 +84,7 @@ function Module:RefreshGates() return; end - for i, gateInfo in ipairs(talentFrame.talentTreeInfo.gates) do + for _, gateInfo in pairs(talentFrame.talentTreeInfo.gates) do local firstButton = talentFrame:GetTalentButtonByNodeID(gateInfo.topLeftNodeID); local condInfo = talentFrame:GetAndCacheCondInfo(gateInfo.conditionID); if firstButton and firstButton:IsVisible() and condInfo.isMet then @@ -83,9 +101,17 @@ function Module:RefreshGates() end end - if not Util.isDF and talentFrame.HeroTalentsContainer then - -- shift the hero talents container to the left to make room for the longer gate text - talentFrame.HeroTalentsContainer:SetPoint("TOP", talentFrame.ButtonsParent, 'TOP', -80, 0) + self:UpdateHeroContainerPosition(); +end + +function Module:UpdateHeroContainerPosition() + local talentFrame = Util:GetTalentFrame(); + if talentFrame.HeroTalentsContainer then + if self.db.shiftHeroTrees then + talentFrame.HeroTalentsContainer:SetPoint("TOP", talentFrame.ButtonsParent, 'TOP', -80, 0); + else + talentFrame:UpdateSpecBackground(); + end end end diff --git a/modules/exportInspectedBuild.lua b/modules/exportInspectedBuild.lua index 7ef9108..e91dc55 100644 --- a/modules/exportInspectedBuild.lua +++ b/modules/exportInspectedBuild.lua @@ -5,7 +5,7 @@ local Main = TTT.Main; local Util = TTT.Util; local L = TTT.L; -local LEVEL_CAP = Util.isDF and 70 or 80; +local LEVEL_CAP = 80; --- @class TalentTreeTweaks_ExportInspectedBuild: AceModule, AceHook-3.0 local Module = Main:NewModule('ExportInspectedBuild', 'AceHook-3.0'); @@ -143,6 +143,7 @@ end function Module:MakeLinkButton(talentsTab) local button = CreateFrame('Button', nil, talentsTab, 'UIPanelButtonNoTooltipTemplate, UIButtonTemplate'); + talentsTab.TalentTreeTweaks_LinkToChatButton = button; button:SetText(TALENT_FRAME_DROP_DOWN_EXPORT_CHAT_LINK or L['Post in Chat']); button:SetSize(100, 22); button:SetPoint('BOTTOMLEFT', 47, 5); diff --git a/modules/heroTalents.lua b/modules/heroTalents.lua index a22c807..efbb758 100644 --- a/modules/heroTalents.lua +++ b/modules/heroTalents.lua @@ -5,9 +5,6 @@ local Main = TTT.Main; local Util = TTT.Util; local L = TTT.L; --- TWW+ only -if Util.isDF then return; end - --- @class TalentTreeTweaks_HeroTalents: AceModule, AceHook-3.0 local Module = Main:NewModule('HeroTalents', 'AceHook-3.0'); diff --git a/modules/importIntoCurrentLoadout.lua b/modules/importIntoCurrentLoadout.lua index ad28903..f9d09ae 100644 --- a/modules/importIntoCurrentLoadout.lua +++ b/modules/importIntoCurrentLoadout.lua @@ -101,7 +101,7 @@ function Module:SetupHook() end function Module:OnUnlockImportButtonValueChanged() - if not Util.isDF then return; end -- todo: TWW compatibility + if true then return; end -- todo: TWW compatibility local dropdown = Util:GetTalentFrame().LoadoutDropDown; for _, sentinelInfo in pairs(dropdown.sentinelKeyToInfo) do if sentinelInfo.text == TALENT_FRAME_DROP_DOWN_IMPORT then @@ -139,6 +139,7 @@ function Module:CreateCheckbox(dialog) local text = string.format(L['Import into current loadout (click "%s" afterwards)'], TALENT_FRAME_APPLY_BUTTON_TEXT); local checkbox = CreateFrame('CheckButton', nil, dialog, 'UICheckButtonTemplate'); + dialog.TalentTreeTweaks_ImportIntoCurrentCheckbox = checkbox; checkbox:SetPoint('TOPLEFT', dialog.NameControl, 'BOTTOMLEFT', 0, 5); checkbox:SetSize(24, 24); checkbox:SetScript('OnClick', function(cb) self:OnCheckboxClick(cb); end); @@ -167,6 +168,7 @@ function Module:CreateAcceptButton(dialog) end local acceptButton = CreateFrame('Button', nil, dialog, 'ClassTalentLoadoutDialogButtonTemplate'); + dialog.TalentTreeTweaks_AcceptButton = acceptButton; acceptButton:SetPoint('BOTTOMRIGHT', dialog.ContentArea, 'BOTTOM', -5, 0); acceptButton:SetText(HUD_CLASS_TALENTS_IMPORT_LOADOUT_ACCEPT_BUTTON); acceptButton.disabledTooltip = HUD_CLASS_TALENTS_IMPORT_ERROR_IMPORT_STRING_AND_NAME; diff --git a/modules/inspectDiff.lua b/modules/inspectDiff.lua index 81d6d5b..37f6145 100644 --- a/modules/inspectDiff.lua +++ b/modules/inspectDiff.lua @@ -182,6 +182,7 @@ function Module:InitCheckbox(talentViewerFrame) end local checkbox = CreateFrame('CheckButton', nil, talentViewerFrame, 'UICheckButtonTemplate'); + talentViewerFrame.TalentTreeTweaks_ShowDiffCheckbox = checkbox; checkbox:SetPoint('TOPLEFT', talentViewerFrame.IgnoreRestrictions, 'BOTTOMLEFT'); checkbox:SetSize(25, 25); checkbox:SetScript('OnClick', function() diff --git a/modules/miniTreeInTooltip.lua b/modules/miniTreeInTooltip.lua index 95339bc..474e7ad 100644 --- a/modules/miniTreeInTooltip.lua +++ b/modules/miniTreeInTooltip.lua @@ -62,12 +62,10 @@ end function Module:OnInitialize() self.debug = false; self.containers = {}; - if not Util.isDF then - Menu.ModifyMenu('MENU_CLASS_TALENT_PROFILE', function(dropdown, rootDescription, contextData) - if not self:IsEnabled() then return; end - self:OnLoadoutMenuOpen(dropdown, rootDescription); - end); - end + Menu.ModifyMenu('MENU_CLASS_TALENT_PROFILE', function(dropdown, rootDescription, contextData) + if not self:IsEnabled() then return; end + self:OnLoadoutMenuOpen(dropdown, rootDescription); + end); end function Module:OnEnable() @@ -80,16 +78,7 @@ function Module:OnEnable() self:SecureHookScript(frame, "OnHyperlinkEnter"); self:SecureHookScript(frame, "OnHyperlinkLeave"); end) - self:SecureHook(GameTooltip, "Show", "OnTooltipShow") - - Util:OnTalentUILoad(function() - local talentsTab = Util:GetTalentFrame(); - if Util.isDF then -- todo: remove after 11.0 release - local dropdown = talentsTab.LoadoutDropDown; - self:SecureHook(dropdown.DropDownControl, 'SetCustomSetup', 'HookCustomSetupCallback'); - self:HookCustomSetupCallback(dropdown.DropDownControl); - end - end) + self:SecureHook(GameTooltip, "Show", "OnTooltipShow"); EventUtil.ContinueOnAddOnLoaded("Blizzard_InspectUI", function() self:HookInspectTalentsButton(); @@ -249,20 +238,18 @@ function Module:GetOptions(defaultOptionsTable, db) step = 0.1, get = getter, set = setter, - } - if not Util.isDF then - defaultOptionsTable.args.inactiveSubTreeAlpha = { - order = increment(), - type = "range", - name = L["Fade Inactive Hero Trees"], - desc = L["Fade Inactive Hero Trees, to more easily see which one is active."], - min = 0, - max = 1, - step = 0.1, - get = getter, - set = setter, - }; - end + }; + defaultOptionsTable.args.inactiveSubTreeAlpha = { + order = increment(), + type = "range", + name = L["Fade Inactive Hero Trees"], + desc = L["Fade Inactive Hero Trees, to more easily see which one is active."], + min = 0, + max = 1, + step = 0.1, + get = getter, + set = setter, + }; defaultOptionsTable.args.example = { order = increment(), type = "execute", @@ -280,7 +267,7 @@ function Module:GetOptions(defaultOptionsTable, db) TalentTreeTweaks_EmbedMiniTreeIntoTooltip(ItemRefTooltip, nil, configID) end, disabled = function() return not C_ClassTalents.GetActiveConfigID(); end, - } + }; return defaultOptionsTable; end @@ -552,7 +539,7 @@ function containerMixin:Init() self.spacing = 20; self.dotSize = 12; self.expectedMaxRows = 10; - self.expectedMaxCols = Util.isDF and 20 or 23; + self.expectedMaxCols = 23; self:SetSize(self.expectedMaxCols * self.spacing, self.expectedMaxRows * self.spacing); self:Hide(); diff --git a/modules/reduceTaint.lua b/modules/reduceTaint.lua index ea7beea..962dfdf 100644 --- a/modules/reduceTaint.lua +++ b/modules/reduceTaint.lua @@ -8,15 +8,10 @@ local L = TTT.L; --- @type LibUIDropDownMenuNumy-4.0 local LibDD = LibStub('LibUIDropDownMenuNumy-4.0'); -if Util.isDF then - TalentTreeTweaks_DropDownControlReplacementMixin = CreateFromMixins(DropDownControlMixin); -end - --- @class TalentTreeTweaks_ReduceTaintModule: AceModule, AceHook-3.0 local Module = Main:NewModule('ReduceTaint', 'AceHook-3.0'); function Module:OnInitialize() - if Util.isDF then return; end Menu.ModifyMenu('MENU_CLASS_TALENT_PROFILE', function(dropdown, rootDescription, contextData) if not self:IsEnabled() then return; end self:OnLoadoutMenuOpen(dropdown, rootDescription); @@ -31,9 +26,6 @@ function Module:OnEnable() end function Module:OnDisable() - if self.db.replaceDropDown and Util.isDF then - self:DisableDropDownReplacement(); - end self:UnhookAll(); end @@ -41,8 +33,6 @@ function Module:GetDescription() return L['Implements various workarounds around taint.'] .. '\n\n' .. - (Util.isDF and L['Fully replace the loadout dropdown, to avoid tainting the edit mode dropdown.'] or '') - .. (Util.isDF and '\n\n' or '') .. L['A workaround for one of the ways that Talent Tree taint can block action buttons from working.'] .. '\n\n' .. L['Replace the Share Loadout button, to open a copy/paste popup instead of automatically copying to clipboard when needed.']; @@ -55,9 +45,9 @@ end function Module:GetOptions(defaultOptionsTable, db) self.db = db; local defaults = { - replaceDropDown = Util.isDF, disableMultiActionBarShowHide = true, }; + self.db.replaceDropDown = nil; for k, v in pairs(defaults) do if db[k] == nil then db[k] = v; @@ -77,25 +67,6 @@ function Module:GetOptions(defaultOptionsTable, db) name = L['You have to reload your UI after disabling this module, for some of the change to take effect.'], order = 5, }; - if Util.isDF then - defaultOptionsTable.args.replaceDropDown = { - type = 'toggle', - name = L['Replace Loadout Dropdown'], - desc = L['Replace the loadout dropdown, to avoid tainting the edit mode dropdown.'], - order = counter(), - get = get, - set = function(info, value) - set(info, value); - if value then - self:EnableDropDownReplacement(); - else - self:DisableDropDownReplacement(); - end - end, - }; - else - self.db.replaceDropDown = nil; - end defaultOptionsTable.args.alwaysReplaceShareButton = { type = 'toggle', name = L['Always Replace Share Button'], @@ -120,10 +91,6 @@ function Module:GetOptions(defaultOptionsTable, db) end function Module:SetupHook() - if Util.isDF and self.db.replaceDropDown then - self:EnableDropDownReplacement(); - end - local talentsTab = Util:GetTalentFrame(); talentsTab:RegisterCallback(TalentFrameBaseMixin.Event.TalentButtonAcquired, self.OnTalentButtonAcquired, self); for talentButton in talentsTab:EnumerateAllTalentButtons() do @@ -131,11 +98,6 @@ function Module:SetupHook() end self:SecureHook(talentsTab, 'ShowSelections', 'OnShowSelections'); - if Util.isDF then -- todo: remove after 11.0 release - -- GetSentinelKeyInfoFromSelectionID happens just before callbacks are executed, so that's as good a place as any, to replace the callback - self:SecureHook(talentsTab.LoadoutDropDown, 'GetSentinelKeyInfoFromSelectionID', function(dropdown, selectionID) self:ReplaceShareButton(dropdown, selectionID) end); - end - -- ToggleTalentFrame starts of with a talentContainerFrame:SetInspecting call, which has a high likelihood of tainting execution self:SecureHook('ShowUIPanel', 'OnShowUIPanel') self:SecureHook('HideUIPanel', 'OnHideUIPanel') @@ -184,18 +146,12 @@ function Module:HandleMultiActionBarTaint() self.originalOnShowFEnv = self.originalOnShowFEnv or getfenv(talentContainerFrame.OnShow); if - not (TalentMicroButton and TalentMicroButton.EvaluateAlertVisibility) - and not (PlayerSpellsMicroButton and PlayerSpellsMicroButton.EvaluateAlertVisibility) + not (PlayerSpellsMicroButton and PlayerSpellsMicroButton.EvaluateAlertVisibility) then Util:DebugPrint('cannot find the Talent MicroButton, it can spread taint to action bars if not handled properly'); end setfenv(talentContainerFrame.OnShow, makeFEnvReplacement(self.originalOnShowFEnv, { - TalentMicroButton = { - EvaluateAlertVisibility = function() - HelpTip:HideAllSystem('MicroButtons'); - end, - }, PlayerSpellsMicroButton = { EvaluateAlertVisibility = function() HelpTip:HideAllSystem('MicroButtons'); @@ -214,7 +170,7 @@ function Module:HandleMultiActionBarTaint() setfenv(talentContainerFrame.OnShow, self.originalOnShowFEnv); self:Unhook(FrameUtil, 'UnregisterFrameForEvents'); end - local microButton = TalentMicroButton or PlayerSpellsMicroButton; + local microButton = PlayerSpellsMicroButton; if self.originalOnShowFEnv and microButton and microButton.HasTalentAlertToShow @@ -266,49 +222,6 @@ function Module:TriggerMicroButtonUpdate() LFDMicroButton:UnregisterEvent('CVAR_UPDATE'); end -function Module:EnableDropDownReplacement() - local talentsTab = Util:GetTalentFrame(); - local loadoutDropDown = talentsTab.LoadoutDropDown; - if not self.replacementDropDownControl then - self.replacementDropDownControl = self:CreateReplacementDropDownControl(loadoutDropDown); - end - loadoutDropDown.DropDownControlOrig = loadoutDropDown.DropDownControlOrig or loadoutDropDown.DropDownControl; - loadoutDropDown.DropDownControl = self.replacementDropDownControl; - - loadoutDropDown.DropDownControlOrig:Hide(); - self.replacementDropDownControl:Show(); - self.replacementDropDownControl:OnLoad(); - loadoutDropDown:OnLoad(); - - wipe(talentsTab.configIDs); - talentsTab:InitializeLoadoutDropDown(); - self.replacementDropDownControl:SetSelectedValue(loadoutDropDown.DropDownControlOrig:GetSelectedValue()); -end - -function Module:CreateReplacementDropDownControl(parent) - local replacementDropDownControl = CreateFrame('Frame', nil, parent, 'TalentTreeTweaks_DropDownControlTemplate'); - replacementDropDownControl:SetSize(150, 30); - replacementDropDownControl:SetPoint('LEFT'); - replacementDropDownControl.DropDownMenu = LibDD:Create_UIDropDownMenu('TalentTreeTweaksDropDownMenu', parent); - replacementDropDownControl.DropDownMenu:SetParent(replacementDropDownControl); - replacementDropDownControl.DropDownMenu:SetPoint('CENTER', 0, -2); - - return replacementDropDownControl; -end - -function Module:DisableDropDownReplacement() - local talentsTab = Util:GetTalentFrame(true); - if talentsTab and self.replacementDropDownControl then - local loadoutDropDown = talentsTab.LoadoutDropDown; - self.replacementDropDownControl:Hide(); - loadoutDropDown.DropDownControl = loadoutDropDown.DropDownControlOrig or loadoutDropDown.DropDownControl; - loadoutDropDown.DropDownControl:Show(); - wipe(talentsTab.configIDs); - talentsTab:InitializeLoadoutDropDown(); - loadoutDropDown.DropDownControl:SetSelectedValue(self.replacementDropDownControl:GetSelectedValue()); - end -end - function Module:OnShowUIPanel(frame) if frame ~= Util:GetTalentContainerFrame(true) then return end if (frame.IsShown and not frame:IsShown()) then @@ -336,21 +249,6 @@ local function replacedShareButtonCallback() Util:CopyText(exportString, L['Talent Loadout String']); end -local skipHook = false; -function Module:ReplaceShareButton(dropdown, selectionID) - if skipHook then return; end - - skipHook = true; - local _, sentinelInfo = dropdown:GetSentinelKeyInfoFromSelectionID(selectionID); - skipHook = false; - if sentinelInfo and (sentinelInfo.text == TALENT_FRAME_DROP_DOWN_EXPORT or sentinelInfo.text == TALENT_FRAME_DROP_DOWN_EXPORT_CLIPBOARD) then - local callback = sentinelInfo.callback; - if callback then - sentinelInfo.callback = replacedShareButtonCallback; - end - end -end - function Module:OnLoadoutMenuOpen(dropdown, rootDescription) if not self:ShouldReplaceShareButton() then return; end @@ -467,89 +365,3 @@ function Module:OnTalentButtonAcquired(button) button.ShowActionBarHighlights = ShowActionBarHighlightsReplacement; button.HideActionBarHighlights = HideActionBarHighlightsReplacement; end - -if Util.isDF then - --- copied from DropDownControlMixin - function TalentTreeTweaks_DropDownControlReplacementMixin:OnLoad() - local function InitializeDropDownFrame(frame, level) - self:Initialize(level); - end - - LibDD:UIDropDownMenu_Initialize(self.DropDownMenu, InitializeDropDownFrame); - - self:UpdateDropDownWidth(self:GetWidth()); - self:UpdateSavedDefaultTextColor(); - end - - function TalentTreeTweaks_DropDownControlReplacementMixin:UpdateDropDownWidth(width) - LibDD:UIDropDownMenu_SetWidth(self.DropDownMenu, width - 20); - end - - function TalentTreeTweaks_DropDownControlReplacementMixin:Initialize(level) - if self.options == nil then - return; - end - - local function DropDownControlButton_OnClick(button) - local isUserInput = true; - self:SetSelectedValue(button.value, isUserInput); - end - - for i, option in ipairs(self.options) do - local optionLevel = option.level or 1; - if not level or optionLevel == level then - if option.isSeparator then - LibDD:UIDropDownMenu_AddSeparator(option.level); - else - local info = LibDD:UIDropDownMenu_CreateInfo(); - if not self.skipNormalSetup then - info.text = option.text; - info.tooltipTitle = option.tooltipTitle; - info.tooltipText = option.tooltipText; - info.tooltipInstruction = option.tooltipInstruction; - info.tooltipWarning = option.tooltipWarning; - info.tooltipOnButton = option.tooltipOnButton; - info.iconTooltipTitle = option.iconTooltipTitle; - info.iconTooltipText = option.iconTooltipText; - info.minWidth = self.dropDownListMinWidth or 108; - info.value = option.value; - info.checked = self.selectedValue == option.value; - info.func = DropDownControlButton_OnClick; - end - - info.data = option.data; - info.level = optionLevel; - - if self.customSetupCallback ~= nil then - self.customSetupCallback(info, DropDownControlButton_OnClick); - end - - LibDD:UIDropDownMenu_AddButton(info, option.level); - end - end - end - end - - function TalentTreeTweaks_DropDownControlReplacementMixin:UpdateSelectedText() - local selectedValue = self.selectedValue; - if selectedValue == nil then - LibDD:UIDropDownMenu_SetText(self.DropDownMenu, self.noneSelectedText); - elseif self.options ~= nil then - for i, option in ipairs(self.options) do - if option.value == selectedValue then - LibDD:UIDropDownMenu_SetText(self.DropDownMenu, option.selectedText or option.text); - end - end - end - - self:UpdateSelectedTextColor(); - end - - function TalentTreeTweaks_DropDownControlReplacementMixin:SetEnabled(enabled, disabledTooltip) - LibDD:UIDropDownMenu_SetDropDownEnabled(self.DropDownMenu, enabled, disabledTooltip); - if enabled then - self:UpdateSelectedTextColor(); - end - end -end - diff --git a/modules/searchForIds.lua b/modules/searchForIds.lua index 57dff36..a2de52e 100644 --- a/modules/searchForIds.lua +++ b/modules/searchForIds.lua @@ -47,15 +47,10 @@ function Module:SetupHook(addon) elseif addon == TALENT_TREE_VIEWER then talentFrame = TalentViewer and TalentViewer.GetTalentFrame and TalentViewer:GetTalentFrame(); end - if Util.isDF and talentFrame and talentFrame.textSearch then - self:RawHook(talentFrame.textSearch, 'GetExactSearchMatchDescription', 'GetExactSearchMatchDescriptionHook', true); - self:RawHook(talentFrame.textSearch, 'GetSearchMatchTypeForEntry', 'GetSearchMatchTypeForEntryHook', true); - elseif not Util.isDF then - local searchController = talentFrame.searchController; - local textSearchFilter = searchController.searchFilters[SpellSearchUtil.FilterType.Text]; - self:RawHook(textSearchFilter, 'InternalGetExactSearchMatchDescription', 'InternalGetExactSearchMatchDescriptionHook', true); - self:RawHook(textSearchFilter, 'DerivedGetMatchTypeForTraitNodeEntry', 'DerivedGetMatchTypeForTraitNodeEntryHook', true); - end + local searchController = talentFrame.searchController; + local textSearchFilter = searchController.searchFilters[SpellSearchUtil.FilterType.Text]; + self:RawHook(textSearchFilter, 'InternalGetExactSearchMatchDescription', 'InternalGetExactSearchMatchDescriptionHook', true); + self:RawHook(textSearchFilter, 'DerivedGetMatchTypeForTraitNodeEntry', 'DerivedGetMatchTypeForTraitNodeEntryHook', true); end function Module:MatchesID(traitSearchSource, searchString, nodeID, specificEntryID) diff --git a/modules/unlockRestrictions.lua b/modules/unlockRestrictions.lua index 7a302df..62938b8 100644 --- a/modules/unlockRestrictions.lua +++ b/modules/unlockRestrictions.lua @@ -86,7 +86,7 @@ function Module:SetupHook() end function Module:UpdateShareButton() - if not Util.isDF then return; end -- todo: TWW compatibility + if true then return; end -- todo: TWW compatibility local dropdown = Util:GetTalentFrame().LoadoutDropDown; for _, sentinelInfo in pairs(dropdown.sentinelKeyToInfo) do if self.textsToUnlock[sentinelInfo.text] then