@@ -105,9 +105,9 @@ public enum Alignment {
105105
106106 private final Setting <Boolean > showCps = sgGeneral .add (new BoolSetting .Builder ()
107107 .name ("Show CPS" )
108- .description ("Shows CPS on mouse buttons in Clicks preset ." )
109- .defaultValue (true )
110- .visible (() -> preset .get () == Preset .Clicks )
108+ .description ("Shows clicks per second on keys ." )
109+ .defaultValue (false )
110+ .visible (() -> preset .get () != Preset .Custom )
111111 .onChanged (b -> onPresetChanged (preset .get ()))
112112 .build ()
113113 );
@@ -293,25 +293,25 @@ private void onPresetChanged(Preset preset) {
293293
294294 switch (preset ) {
295295 case Movement -> {
296- keys .add (l .key (mc .options .forwardKey , l .ux (1 ), 0 ));
297- keys .add (l .key (mc .options .leftKey , 0 , l .y (1 )));
298- keys .add (l .key (mc .options .backKey , l .ux (1 ), l .y (1 )));
299- keys .add (l .key (mc .options .rightKey , l .ux (2 ), l .y (1 )));
300- keys .add (l .key (mc .options .sneakKey , 0 , l .y (2 )));
301- keys .add (l .key (mc .options .jumpKey , l .ux (1 ), l .y (2 ), KeyDimensions .UNIT_2U ));
296+ keys .add (l .key (mc .options .forwardKey , l .ux (1 ), 0 ). setShowCps ( showCps . get ()) );
297+ keys .add (l .key (mc .options .leftKey , 0 , l .y (1 )). setShowCps ( showCps . get ()) );
298+ keys .add (l .key (mc .options .backKey , l .ux (1 ), l .y (1 )). setShowCps ( showCps . get ()) );
299+ keys .add (l .key (mc .options .rightKey , l .ux (2 ), l .y (1 )). setShowCps ( showCps . get ()) );
300+ keys .add (l .key (mc .options .sneakKey , 0 , l .y (2 )). setShowCps ( showCps . get ()) );
301+ keys .add (l .key (mc .options .jumpKey , l .ux (1 ), l .y (2 ), KeyDimensions .UNIT_2U ). setShowCps ( showCps . get ()) );
302302 }
303303 case Clicks -> {
304304 keys .add (l .key (mc .options .attackKey , "LMB" , 0 , 0 ).setShowCps (showCps .get ()));
305305 keys .add (l .key (mc .options .useKey , "RMB" , l .ux (1 ), 0 ).setShowCps (showCps .get ()));
306306 }
307307 case Actions -> {
308- keys .add (l .key (mc .options .dropKey , 0 , 0 ));
309- keys .add (l .key (mc .options .swapHandsKey , l .ux (1 ), 0 ));
310- keys .add (l .key (mc .options .inventoryKey , l .ux (2 ), 0 ));
308+ keys .add (l .key (mc .options .dropKey , 0 , 0 ). setShowCps ( showCps . get ()) );
309+ keys .add (l .key (mc .options .swapHandsKey , l .ux (1 ), 0 ). setShowCps ( showCps . get ()) );
310+ keys .add (l .key (mc .options .inventoryKey , l .ux (2 ), 0 ). setShowCps ( showCps . get ()) );
311311 }
312312 case Hotbar -> {
313313 for (int i = 0 ; i < 9 ; i ++) {
314- keys .add (l .key (mc .options .hotbarKeys [i ], l .ux (i ), 0 ));
314+ keys .add (l .key (mc .options .hotbarKeys [i ], l .ux (i ), 0 ). setShowCps ( showCps . get ()) );
315315 }
316316 }
317317 case Keyboard -> {
@@ -320,6 +320,7 @@ private void onPresetChanged(Preset preset) {
320320 } else {
321321 buildIsoLayout (l );
322322 }
323+ for (Key key : keys ) key .setShowCps (showCps .get ());
323324 }
324325 case Custom -> keys .addAll (customKeys .get ());
325326 }
@@ -601,7 +602,7 @@ public void render(HudRenderer renderer) {
601602 Color txtColor = getColor (textColor .get (), mutableColor );
602603
603604 double padding = 2 * s ;
604- double availableWidth = kW - padding * 1 ;
605+ double availableWidth = kW - padding * 2 ;
605606
606607 if (!key .showCps ) {
607608 double textScale = Math .min (1.0 , availableWidth / renderer .textWidth (text , 1.0 ));
0 commit comments