@@ -221,55 +221,32 @@ protected string GetCosmeticSet(string setName)
221221 return Utils . RemoveHtmlTags ( string . Format ( format , name ) ) ;
222222 }
223223
224- protected ( int , int ) GetInternalSID ( int number )
224+ protected ( string , string , bool ) GetInternalSID ( string number )
225225 {
226- static int GetSeasonsInChapter ( int chapter ) => chapter switch
227- {
228- 1 => 10 ,
229- 2 => 8 ,
230- 3 => 4 ,
231- 4 => 5 ,
232- 5 => 5 ,
233- _ => 10
234- } ;
235-
236- var chapterIdx = 0 ;
237- var seasonIdx = 0 ;
238- while ( number > 0 )
239- {
240- var seasonsInChapter = GetSeasonsInChapter ( ++ chapterIdx ) ;
241- if ( number > seasonsInChapter )
242- number -= seasonsInChapter ;
243- else
244- {
245- seasonIdx = number ;
246- number = 0 ;
247- }
248- }
249- return ( chapterIdx , seasonIdx ) ;
226+ if ( ! Utils . TryLoadObject ( "FortniteGame/Plugins/GameFeatures/BattlePassBase/Content/DataTables/Athena_SeasonTitles.Athena_SeasonTitles" , out UDataTable seasonTitles ) ||
227+ ! seasonTitles . TryGetDataTableRow ( number , StringComparison . InvariantCulture , out var row ) ||
228+ ! row . TryGetValue ( out FText chapterText , "DisplayChapterText" ) ||
229+ ! row . TryGetValue ( out FText seasonText , "DisplaySeasonText" ) ||
230+ ! row . TryGetValue ( out FName displayType , "DisplayType" ) )
231+ return ( string . Empty , string . Empty , true ) ;
232+
233+ var onlySeason = displayType . Text . EndsWith ( "::OnlySeason" ) || ( chapterText . Text == seasonText . Text && ! int . TryParse ( seasonText . Text , out _ ) ) ;
234+ return ( chapterText . Text , seasonText . Text , onlySeason ) ;
250235 }
251236
252237 protected string GetCosmeticSeason ( string seasonNumber )
253238 {
254239 var s = seasonNumber [ "Cosmetics.Filter.Season." . Length ..] ;
255- var initial = int . Parse ( s ) ;
256- ( int chapterIdx , int seasonIdx ) = GetInternalSID ( initial ) ;
240+ ( string chapterIdx , string seasonIdx , bool onlySeason ) = GetInternalSID ( s ) ;
257241
258242 var season = Utils . GetLocalizedResource ( "AthenaSeasonItemDefinitionInternal" , "SeasonTextFormat" , "Season {0}" ) ;
259243 var introduced = Utils . GetLocalizedResource ( "Fort.Cosmetics" , "CosmeticItemDescription_Season" , "\n Introduced in <SeasonText>{0}</>." ) ;
260- if ( s == "10" ) return Utils . RemoveHtmlTags ( string . Format ( introduced , string . Format ( season , "X" ) ) ) ;
261- if ( initial <= 10 ) return Utils . RemoveHtmlTags ( string . Format ( introduced , string . Format ( season , s ) ) ) ;
244+ if ( onlySeason ) return Utils . RemoveHtmlTags ( string . Format ( introduced , string . Format ( season , seasonIdx ) ) ) ;
262245
263246 var chapter = Utils . GetLocalizedResource ( "AthenaSeasonItemDefinitionInternal" , "ChapterTextFormat" , "Chapter {0}" ) ;
264247 var chapterFormat = Utils . GetLocalizedResource ( "AthenaSeasonItemDefinitionInternal" , "ChapterSeasonTextFormat" , "{0}, {1}" ) ;
265248 var d = string . Format ( chapterFormat , string . Format ( chapter , chapterIdx ) , string . Format ( season , seasonIdx ) ) ;
266- return s switch
267- {
268- "27" => Utils . RemoveHtmlTags ( string . Format ( introduced , string . Format ( "Fortnite: OG" ) ) ) ,
269- "32" => Utils . RemoveHtmlTags ( string . Format ( introduced , string . Format ( "Fortnite: Remix" ) ) ) ,
270- "35" => Utils . RemoveHtmlTags ( string . Format ( introduced , string . Format ( chapterFormat , string . Format ( chapter , chapterIdx ) , string . Format ( "MS1" ) ) ) ) ,
271- _ => Utils . RemoveHtmlTags ( string . Format ( introduced , d ) )
272- } ;
249+ return Utils . RemoveHtmlTags ( string . Format ( introduced , d ) ) ;
273250 }
274251
275252 protected void CheckGameplayTags ( FInstancedStruct [ ] dataList )
0 commit comments