@@ -147,8 +147,21 @@ buildEntry.Primary is null ||
147147
148148 private async void LoadSkills ( )
149149 {
150- var filteredSkills = await this . FilterSkills ( this . SkillSearchText ) . ToListAsync ( ) . ConfigureAwait ( true ) ;
151- this . PrepareSkillListCache ( filteredSkills ) ;
150+ var searchTerm = this . SkillSearchText ;
151+ var buildEntry = this . BuildEntry ;
152+ if ( buildEntry is null )
153+ {
154+ return ;
155+ }
156+
157+ await Task . Factory . StartNew ( ( ) =>
158+ {
159+ var filteredSkills = this . FilterSkills ( searchTerm , buildEntry ) . ToList ( ) ;
160+ this . Dispatcher . InvokeAsync ( ( ) =>
161+ {
162+ this . PrepareSkillListCache ( filteredSkills ) ;
163+ } , System . Windows . Threading . DispatcherPriority . Background , CancellationToken . None ) ;
164+ } , CancellationToken . None , TaskCreationOptions . LongRunning , TaskScheduler . Current ) ;
152165 }
153166
154167 private void BrowseToInfo ( string infoName )
@@ -215,7 +228,7 @@ private void PrepareSkillListCache(List<Skill> skills)
215228 }
216229 }
217230
218- private async IAsyncEnumerable < Skill > FilterSkills ( string searchTerm )
231+ private IEnumerable < Skill > FilterSkills ( string searchTerm , SingleBuildEntry buildEntry )
219232 {
220233 // Replace symbols to ease search
221234 searchTerm = searchTerm ? . Replace ( "\" " , "" ) . Replace ( "!" , "" ) ! ;
@@ -227,21 +240,25 @@ private async IAsyncEnumerable<Skill> FilterSkills(string searchTerm)
227240 continue ;
228241 }
229242
230- if ( skill . Profession != this . BuildEntry ! . Primary &&
231- skill . Profession != this . BuildEntry ! . Secondary &&
243+ if ( skill . Profession != buildEntry . Primary &&
244+ skill . Profession != buildEntry . Secondary &&
232245 skill . Profession != Profession . None )
233246 {
234247 continue ;
235248 }
236249
250+ if ( skill . Name ? . Contains ( "(PvP)" ) is true )
251+ {
252+ continue ;
253+ }
254+
237255 if ( searchTerm . IsNullOrWhiteSpace ( ) )
238256 {
239257 yield return skill ;
240258 continue ;
241259 }
242260
243- var matchesName = await Task . Run ( ( ) => StringUtils . MatchesSearchString ( skill . Name ! . Replace ( "\" " , "" ) . Replace ( "!" , "" ) , searchTerm ! ) ) ;
244- if ( matchesName )
261+ if ( StringUtils . MatchesSearchString ( skill . Name ! . Replace ( "\" " , "" ) . Replace ( "!" , "" ) , searchTerm ! ) )
245262 {
246263 yield return skill ;
247264 continue ;
0 commit comments