11local addonName , ns = ... ;
22
3- --- @class TLM_SideBarMixin
3+ --- @class TLM_SideBarMixin : AceModule , AceHook-3.0
44local SideBarMixin = {};
55ns .SideBarMixin = SideBarMixin ;
66
@@ -15,6 +15,7 @@ local API = TalentLoadoutManagerAPI;
1515local GlobalAPI = TalentLoadoutManagerAPI .GlobalAPI ;
1616local CharacterAPI = TalentLoadoutManagerAPI .CharacterAPI ;
1717
18+ SideBarMixin .IntegrateWithBlizzMove = true ;
1819SideBarMixin .ImplementAutoApply = false ;
1920SideBarMixin .ShowAnimationOnImport = false ;
2021SideBarMixin .ImplementTTTMissingWarning = false ;
@@ -169,6 +170,7 @@ function SideBarMixin:OnInitialize()
169170end
170171
171172function SideBarMixin :OnEnable ()
173+ error (' override in implementation' );
172174 -- override in implementation: should SetupHook on relevant addonLoaded
173175end
174176
@@ -194,9 +196,48 @@ function SideBarMixin:SetupHook()
194196 API :RegisterCallback (API .Event .LoadoutListUpdated , self .RefreshSideBarData , self );
195197end
196198
197- --- @return Frame
198- function SideBarMixin :GetTalentsTab ()
199- -- override in implementation
199+ do
200+ --- @return PlayerSpellsFrame_TalentsFrame | TalentViewerUIMixinTWW
201+ function SideBarMixin :GetTalentsTab ()
202+ error (' override in implementation' );
203+ end
204+
205+ --- @param name string
206+ function SideBarMixin :DoCreate (name )
207+ error (' override in implementation' );
208+ end
209+
210+ function SideBarMixin :GetLoadouts ()
211+ error (' override in implementation' );
212+ end
213+
214+ function SideBarMixin :GetActiveLoadout (forceRefresh )
215+ error (' override in implementation' );
216+ end
217+
218+ function SideBarMixin :DoImport (importText , loadoutName , autoApply )
219+ error (' override in implementation' );
220+ end
221+
222+ function SideBarMixin :DoImportIntoCurrent (importText , autoApply )
223+ error (' override in implementation' );
224+ end
225+
226+ function SideBarMixin :GetDefaultActionText (elementData )
227+ error (' override in implementation' );
228+ end
229+
230+ function SideBarMixin :UpdateCustomLoadoutWithCurrentTalents (loadoutID )
231+ error (' override in implementation' );
232+ end
233+
234+ function SideBarMixin :DoLoad (loadoutID , autoApply )
235+ error (' override in implementation' );
236+ end
237+
238+ function SideBarMixin :GetBlizzMoveFrameTable ()
239+ error (' override in implementation' );
240+ end
200241end
201242
202243function SideBarMixin :OnTalentsTabShow (frame )
@@ -534,33 +575,20 @@ function SideBarMixin:CreateSideBar()
534575 sideBar .ScrollBoxContainer :SetPoint (" TOPLEFT" , sideBar .SaveButton , " BOTTOMLEFT" , 0 , - 10 );
535576 sideBar .ScrollBoxContainer :SetPoint (" BOTTOMRIGHT" , sideBar , " BOTTOMRIGHT" , - 10 , 10 );
536577
537- if self .ImplementTTTMissingWarning and not C_AddOns .IsAddOnLoaded (' TalentTreeTweaks' ) then
538- -- add a link to the addon
539- sideBar .WarningLink = CreateFrame (" Button" , nil , sideBar , " UIPanelButtonTemplate, UIButtonTemplate" );
540- sideBar .WarningLink :SetSize (width - 50 , 20 );
541- sideBar .WarningLink :SetText (" Download TalentTreeTweaks" );
542- sideBar .WarningLink :SetPoint (" BOTTOMLEFT" , sideBar , " BOTTOMLEFT" , 10 , 10 );
543- sideBar .WarningLink :SetScript (" OnClick" , function ()
544- local url = " https://www.curseforge.com/wow/addons/talent-tree-tweaks" ;
545- StaticPopup_Show (self .copyDialogName , nil , nil , url );
546- end );
547-
548- -- add a warning on the bottom of the sideBar
549- sideBar .Warning = sideBar :CreateFontString (nil , " OVERLAY" , " GameFontNormalHuge" );
550- sideBar .Warning :SetPoint (" BOTTOMLEFT" , sideBar .WarningLink , " TOPLEFT" , 0 , 0 );
551- sideBar .Warning :SetWidth (width - 50 );
552- sideBar .Warning :SetText (" TalentTreeTweaks is not loaded. You might encounter serious bugs without it." );
553- sideBar .Warning :SetTextColor (1 , 0.5 , 0.5 );
554-
555- local function onOptionChange (_ , option , value )
556- if option == ' disableTTTWarning' then
557- sideBar .Warning :SetShown (not value );
558- sideBar .WarningLink :SetShown (not value );
559- end
578+ -- add a warning on the bottom of the sideBar
579+ sideBar .Warning = sideBar :CreateFontString (nil , " OVERLAY" , " SystemFont_Shadow_Large" );
580+ sideBar .Warning :SetPoint (" BOTTOMLEFT" , sideBar , " BOTTOMLEFT" , 10 , 10 );
581+ sideBar .Warning :SetWidth (width - 50 );
582+ sideBar .Warning :SetText (' ' );
583+ sideBar .Warning :SetTextColor (1 , 0.5 , 0.5 );
584+ sideBar .Warning :SetScript (" OnShow" , function ()
585+ local badAddons = TLM :CheckForBadAddons (false );
586+ local text = " " ;
587+ for _ , warning in pairs (badAddons ) do
588+ text = text .. warning .. " \n " ;
560589 end
561- Config :RegisterCallback (Config .Event .OptionValueChanged , onOptionChange );
562- onOptionChange (nil , ' disableTTTWarning' , Config :GetConfig (' disableTTTWarning' ));
563- end
590+ sideBar .Warning :SetText (text );
591+ end );
564592
565593 return sideBar , dataProvider ;
566594end
@@ -750,10 +778,7 @@ function SideBarMixin:OpenDropDownMenu(dropDown, frame, elementData)
750778 openInTTV = {
751779 text = " Open in TalentTreeViewer" ,
752780 notCheckable = true ,
753- disabled = C_AddOns .GetAddOnEnableState (
754- TalentViewerLoader and TalentViewerLoader :GetLodAddonName () or ' TalentTreeViewer' ,
755- UnitName (' player' )
756- ) ~= 2 ,
781+ disabled = nil == TalentViewerLoader ,
757782 func = function ()
758783 self :OpenInTalentTreeViewer (elementData );
759784 end ,
@@ -984,14 +1009,6 @@ function SideBarMixin:SortElements(dataProviderEntries)
9841009 end );
9851010end
9861011
987- function SideBarMixin :GetLoadouts ()
988- -- override in implementation
989- end
990-
991- function SideBarMixin :GetActiveLoadout (forceRefresh )
992- -- override in implementation
993- end
994-
9951012function SideBarMixin :RefreshSideBarData ()
9961013 local loadouts = self :GetLoadouts ();
9971014
0 commit comments