@@ -90,6 +90,8 @@ public final class MapaHack extends Hack
9090 "Minimap icon size" , 8 , 4 , 24 , 1 , ValueDisplay .INTEGER );
9191 private final SliderSetting worldMapIconSize = new SliderSetting (
9292 "World map icon size" , 12 , 4 , 32 , 1 , ValueDisplay .INTEGER );
93+ private final SliderSetting playerNameScale = new SliderSetting (
94+ "Player name scale" , 1.0 , 0.5 , 4.0 , 0.1 , ValueDisplay .DECIMAL );
9395 private final CheckboxSetting iconOutline =
9496 new CheckboxSetting ("ESP icon outlines" , true );
9597 private final CheckboxSetting showCenterCross =
@@ -194,6 +196,7 @@ public MapaHack()
194196 addSetting (mapEspGroup );
195197 addSetting (minimapIconSize );
196198 addSetting (worldMapIconSize );
199+ addSetting (playerNameScale );
197200 addSetting (iconOutline );
198201 addSetting (showCenterCross );
199202 addSetting (showFrame );
@@ -445,29 +448,29 @@ private void renderPlayerHeadMarker(GuiGraphicsExtractor context,
445448 if (point == null )
446449 return ;
447450 renderPlayerHeadMarker (context , point , skin , name , size , outlineColor ,
448- cfg .showPlayerNames );
451+ cfg .showPlayerNames , ( float ) cfg . playerNameScale );
449452 }
450453
451454 private void renderPlayerHeadMarker (GuiGraphicsExtractor context ,
452455 MapPoint point , Identifier skin , String name , int size ,
453- int outlineColor , boolean drawName )
456+ int outlineColor , boolean drawName , float nameScale )
454457 {
455458 int x = Math .round (point .x ()) - size / 2 ;
456459 int y = Math .round (point .y ()) - size / 2 ;
457460 drawIconOutline (context , x , y , size , outlineColor );
458461 context .blit (RenderPipelines .GUI_TEXTURED , skin , x , y , 8 , 8 , size , size ,
459- 64 , 64 , 0xFFFFFFFF );
462+ 8 , 8 , 64 , 64 , 0xFFFFFFFF );
460463 context .blit (RenderPipelines .GUI_TEXTURED , skin , x , y , 40 , 8 , size ,
461- size , 64 , 64 , 0xFFFFFFFF );
464+ size , 8 , 8 , 64 , 64 , 0xFFFFFFFF );
462465 if (drawName && !name .isEmpty ())
463466 drawMarkerLabel (context , name , x + size / 2 , y + size + 2 ,
464- outlineColor , size );
467+ outlineColor , size , nameScale );
465468 }
466469
467470 private void drawMarkerLabel (GuiGraphicsExtractor context , String label ,
468- int centerX , int y , int color , int iconSize )
471+ int centerX , int y , int color , int iconSize , float nameScale )
469472 {
470- float scale = Mth .clamp (iconSize / 8.0F , 0.5F , 2 .0F );
473+ float scale = Mth .clamp (iconSize / 8.0F * nameScale , 0.5F , 6 .0F );
471474 int width = Math .round (MC .font .width (label ) * scale );
472475 int x = centerX - width / 2 ;
473476 int stroke = 0xFF000000 ;
@@ -631,6 +634,7 @@ public void resetToDefaults()
631634 minimapZoom .setValue (2.0 );
632635 minimapIconSize .setValue (8 );
633636 worldMapIconSize .setValue (12 );
637+ playerNameScale .setValue (1.0 );
634638 iconOutline .setChecked (true );
635639 showCenterCross .setChecked (true );
636640 showFrame .setChecked (true );
@@ -689,6 +693,11 @@ public void setMapSamples(int value)
689693 minimapSamples .setValue (value );
690694 }
691695
696+ public void setPlayerNameScale (double value )
697+ {
698+ playerNameScale .setValue (value );
699+ }
700+
692701 public void setMapPosition (int x , int y )
693702 {
694703 minimapPosX .setValue (x );
@@ -836,6 +845,7 @@ public XMapConfig createConfig()
836845 cfg .enabled = !noMap .isChecked ();
837846 cfg .showCenterCross = showCenterCross .isChecked ();
838847 cfg .showPlayerNames = showPlayerNames .isChecked ();
848+ cfg .playerNameScale = playerNameScale .getValue ();
839849 cfg .minimapSize = minimapSize .getValueI ();
840850 cfg .minimapZoom = minimapZoom .getValue ();
841851 cfg .minimapPosX = minimapPosX .getValueI ();
@@ -1076,7 +1086,8 @@ private void renderFullscreenPlayers(GuiGraphicsExtractor context, int mapX,
10761086 renderPlayerHeadMarker (context , point , skin ,
10771087 player .getName ().getString (), markerSize ,
10781088 WURST .getHax ().playerEspHack .getMapaPlayerColor (player ),
1079- createConfig ().showPlayerNames );
1089+ createConfig ().showPlayerNames ,
1090+ (float )createConfig ().playerNameScale );
10801091 }
10811092 }
10821093
0 commit comments