@@ -199,6 +199,7 @@ function SideBarMixin:OnDisable()
199199 self :UnhookAll ();
200200
201201 API :UnregisterCallback (API .Event .LoadoutListUpdated , self );
202+ Config :UnregisterCallback (Config .Event .CharacterVisibilityChanged , self );
202203end
203204
204205function SideBarMixin :SetupHook ()
@@ -216,6 +217,7 @@ function SideBarMixin:SetupHook()
216217 self :SecureHook (talentsTab , " OnUpdate" , " OnTalentsChanged" );
217218
218219 API :RegisterCallback (API .Event .LoadoutListUpdated , self .RefreshSideBarData , self );
220+ Config :RegisterCallback (Config .Event .CharacterVisibilityChanged , self .RefreshSideBarData , self );
219221end
220222
221223do
@@ -850,6 +852,10 @@ function SideBarMixin:GenerateMenu(rootDescription, frame, loadoutInfo)
850852 rootDescription :CreateButton (" Remove all loadouts from this character from the list" , function ()
851853 StaticPopup_Show (self .removeFromListBulkDialogName , loadoutInfo .owner , nil , loadoutInfo );
852854 end );
855+ rootDescription :CreateButton (" Permanently hide all loadouts from this character" , function ()
856+ Config :SetCharacterShown (loadoutInfo .owner , false );
857+ TLM :Printf (" Loadouts from %s are now hidden. You can reset this in the config." , loadoutInfo .owner );
858+ end );
853859 end
854860end
855861
@@ -1055,21 +1061,23 @@ function SideBarMixin:RefreshSideBarData()
10551061 local activeLoadoutID = self .activeLoadout and self .activeLoadout .id or nil ;
10561062 local dataProviderEntries = {}
10571063 for _ , loadout in pairs (loadouts ) do
1058- --- @type TLM_SideBarLoadoutInfo
1059- local loadout = loadout --- @diagnostic disable-line : assign-type-mismatch , redefined-local
1060- --- @type number ?
1061- local parentID = loadout .parentMapping and loadout .parentMapping [0 ];
1062- loadout .parentID = parentID ;
1063- --- @type TLM_SideBarDataProviderEntry
1064- local entry = {
1065- text = loadout .displayName ,
1066- data = loadout ,
1067- isActive = loadout .id == activeLoadoutID ,
1068- parentID = parentID ,
1069- };
1070- table.insert (dataProviderEntries , entry );
1071- if loadout .id == activeLoadoutID then
1072- foundActiveLoadout = true ;
1064+ if loadout .playerIsOwner or not loadout .owner or Config :IsCharacterShown (loadout .owner ) then
1065+ --- @type TLM_SideBarLoadoutInfo
1066+ local loadout = loadout --- @diagnostic disable-line : assign-type-mismatch , redefined-local
1067+ --- @type number ?
1068+ local parentID = loadout .parentMapping and loadout .parentMapping [0 ];
1069+ loadout .parentID = parentID ;
1070+ --- @type TLM_SideBarDataProviderEntry
1071+ local entry = {
1072+ text = loadout .displayName ,
1073+ data = loadout ,
1074+ isActive = loadout .id == activeLoadoutID ,
1075+ parentID = parentID ,
1076+ };
1077+ table.insert (dataProviderEntries , entry );
1078+ if loadout .id == activeLoadoutID then
1079+ foundActiveLoadout = true ;
1080+ end
10731081 end
10741082 end
10751083 if not foundActiveLoadout then
0 commit comments