@@ -352,6 +352,106 @@ public int Ears
352352 }
353353 }
354354
355+ public int Beard
356+ {
357+ get
358+ {
359+ if ( BodyGender != AppearanceGender . Female )
360+ {
361+ var entries = GetEntries ( "first.main.beard_color_" ) ;
362+ foreach ( HashValueEntry singleEntry in entries )
363+ {
364+ var name = singleEntry . GetPath ( ) . Split ( '\\ ' ) . Last ( ) ;
365+ var searchString = name . Substring ( 0 , name . Length - ".app" . Length ) . Substring ( "hb_000_pma__" . Length ) . Split ( "__" ) ;
366+
367+ return AppearanceValueLists . Beards . FindIndex ( x => x == searchString [ 0 ] ) + 1 ;
368+ }
369+ return 0 ;
370+ }
371+ return - 1 ;
372+ }
373+ set
374+ {
375+ if ( value < 0 || value > AppearanceValueLists . Beards . Count )
376+ {
377+ return ;
378+ }
379+
380+ SetNullableHashEntry ( "beard_color_" , new HashValueEntry ( )
381+ {
382+ FirstString = "01_blonde_platinum" ,
383+ Hash = value == 0 ? 0 : CyberCAT . Extra . Utils . HashGenerator . CalcFNV1A64 ( "base\\ characters\\ head\\ player_base_heads\\ appearances\\ facial_hairs\\ hb_000_pma__" + AppearanceValueLists . Beards [ value - 1 ] + ".app" ) ,
384+ SecondString = "beard_color1_0"
385+ } ,
386+ new [ ] { "TPP" , "character_customization" } , AppearanceField . Hash ) ;
387+ }
388+ }
389+
390+ public int BeardStyle
391+ {
392+ get
393+ {
394+ if ( BodyGender != AppearanceGender . Female )
395+ {
396+ var entries = GetEntries ( "first.main.beard_color_" ) ;
397+ foreach ( HashValueEntry singleEntry in entries )
398+ {
399+ var name = singleEntry . GetPath ( ) . Split ( '\\ ' ) . Last ( ) ;
400+ var searchString = name . Substring ( 0 , name . Length - ".app" . Length ) . Substring ( "hb_000_pma__" . Length ) . Split ( "__" ) ;
401+
402+ if ( searchString . Count ( ) > 1 )
403+ {
404+ return AppearanceValueLists . BeardStyles [ searchString [ 0 ] ] . FindIndex ( x => x == searchString [ 1 ] ) + 1 ;
405+ }
406+ else if ( AppearanceValueLists . BeardStyles [ searchString [ 0 ] ] . Count < 2 )
407+ {
408+ return - 1 ;
409+ }
410+ else
411+ {
412+ return 1 ;
413+ }
414+ }
415+ }
416+ return - 1 ;
417+ }
418+ set
419+ {
420+ var entries = GetEntries ( "first.main.beard_color_" ) ;
421+
422+ var path = ( ( HashValueEntry ) entries [ 0 ] ) . GetPath ( ) . Split ( '\\ ' ) ;
423+ var parts = path . Last ( ) . Substring ( 0 , path . Last ( ) . Length - ".app" . Length ) . Split ( "__" ) . ToList ( ) ;
424+
425+ var options = AppearanceValueLists . BeardStyles [ parts [ 1 ] ] ;
426+
427+ if ( value < 1 || value > options . Count )
428+ {
429+ return ;
430+ }
431+
432+ if ( options [ value - 1 ] == string . Empty && parts . Count > 2 )
433+ {
434+ parts . RemoveAt ( 2 ) ;
435+ }
436+ else if ( options [ value - 1 ] != string . Empty && parts . Count < 3 )
437+ {
438+ parts . Add ( options [ value - 1 ] ) ;
439+ }
440+ else if ( options [ value - 1 ] != string . Empty && parts . Count > 2 )
441+ {
442+ parts [ 2 ] = options [ value - 1 ] ;
443+ }
444+
445+ path [ path . Length - 1 ] = string . Join ( "__" , parts ) + ".app" ;
446+ var finalPath = string . Join ( '\\ ' , path ) ;
447+
448+ foreach ( HashValueEntry singleEntry in entries )
449+ {
450+ singleEntry . SetPath ( finalPath ) ;
451+ }
452+ }
453+ }
454+
355455 public int Cyberware
356456 {
357457 get
@@ -1709,5 +1809,7 @@ public static class AppearanceValueLists
17091809 public static List < string > PenisSizes { get ; } = Values [ "PenisSizes" ] . ToObject < List < string > > ( ) ;
17101810 public static List < ulong > PubicHairStyles { get ; } = Values [ "PubicHairStyles" ] . ToObject < List < ulong > > ( ) ;
17111811 public static List < string > NailColors { get ; } = Values [ "NailColors" ] . ToObject < List < string > > ( ) ;
1812+ public static List < string > Beards { get ; } = Values [ "Beards" ] . ToObject < List < string > > ( ) ;
1813+ public static Dictionary < string , List < string > > BeardStyles { get ; } = Values [ "BeardStyles" ] . ToObject < Dictionary < string , List < string > > > ( ) ;
17121814 }
17131815}
0 commit comments