@@ -2468,58 +2468,52 @@ private void DrawNameAndLabels(Color textColor, Color borderColor, Color backgro
24682468 DrawGuildName ( textColor , borderColor , backgroundColor ) ;
24692469 }
24702470
2471- public virtual void DrawGuildName ( Color textColor , Color borderColor = null , Color backgroundColor = null )
2471+ public virtual void DrawGuildName ( Color textColor , Color ? borderColor = default , Color ? backgroundColor = default )
24722472 {
2473- if ( HideName || Guild == null || Guild . Trim ( ) . Length == 0 || ! Options . Instance . Guild . ShowGuildNameTagsOverMembers )
2473+ var guildLabel = Guild ? . Trim ( ) ;
2474+ if ( ! ShouldDrawName || string . IsNullOrWhiteSpace ( guildLabel ) || ! Options . Instance . Guild . ShowGuildNameTagsOverMembers )
24742475 {
24752476 return ;
24762477 }
24772478
2478- if ( borderColor == null )
2479+ if ( IsStealthed && ! IsInMyParty ( Globals . Me ) )
24792480 {
2480- borderColor = Color . Transparent ;
2481- }
2482-
2483- if ( backgroundColor == null )
2484- {
2485- backgroundColor = Color . Transparent ;
2486- }
2487-
2488- //Check for stealth amoungst status effects.
2489- for ( var n = 0 ; n < Status . Count ; n ++ )
2490- {
2491- //If unit is stealthed, don't render unless the entity is the player.
2492- if ( Status [ n ] . Type == SpellEffect . Stealth )
2493- {
2494- if ( this != Globals . Me && ! ( this is Player player && Globals . Me . IsInMyParty ( player ) ) )
2495- {
2496- return ;
2497- }
2498- }
2481+ // Do not render if the party is stealthed and not in the local player's party
2482+ return ;
24992483 }
25002484
2501- var map = MapInstance ;
2502- if ( map == null )
2485+ if ( MapInstance == default )
25032486 {
25042487 return ;
25052488 }
25062489
2507- var textSize = Graphics . Renderer . MeasureText ( Guild , Graphics . EntityNameFont , 1 ) ;
2490+ var textSize = Graphics . Renderer . MeasureText ( guildLabel , Graphics . EntityNameFont , 1 ) ;
25082491
25092492 var x = ( int ) Math . Ceiling ( Origin . X ) ;
25102493 var y = GetLabelLocation ( LabelType . Guild ) ;
25112494
2495+ backgroundColor ??= Color . Transparent ;
25122496 if ( backgroundColor != Color . Transparent )
25132497 {
25142498 Graphics . DrawGameTexture (
2515- Graphics . Renderer . GetWhiteTexture ( ) , new FloatRect ( 0 , 0 , 1 , 1 ) ,
2516- new FloatRect ( x - textSize . X / 2f - 4 , y , textSize . X + 8 , textSize . Y ) , backgroundColor
2499+ Graphics . Renderer . GetWhiteTexture ( ) ,
2500+ new FloatRect ( 0 , 0 , 1 , 1 ) ,
2501+ new FloatRect ( x - textSize . X / 2f - 4 , y , textSize . X + 8 , textSize . Y ) ,
2502+ backgroundColor
25172503 ) ;
25182504 }
25192505
2506+ borderColor ??= Color . Transparent ;
25202507 Graphics . Renderer . DrawString (
2521- Guild , Graphics . EntityNameFont , x - ( int ) Math . Ceiling ( textSize . X / 2f ) , ( int ) y , 1 ,
2522- Color . FromArgb ( textColor . ToArgb ( ) ) , true , null , Color . FromArgb ( borderColor . ToArgb ( ) )
2508+ guildLabel ,
2509+ Graphics . EntityNameFont ,
2510+ x - ( int ) Math . Ceiling ( textSize . X / 2f ) ,
2511+ ( int ) y ,
2512+ 1 ,
2513+ Color . FromArgb ( textColor . ToArgb ( ) ) ,
2514+ true ,
2515+ default ,
2516+ Color . FromArgb ( borderColor . ToArgb ( ) )
25232517 ) ;
25242518 }
25252519
0 commit comments