@@ -16,7 +16,7 @@ const json Config::DEFAULT_CONFIG =
1616 { " rapidFire" , true },
1717 { " fastReload" , false },
1818
19- { " sensitivity" , 8 },
19+ { " sensitivity" , 8.0 },
2020 { " zoomSensitivity" , 1.0 },
2121 { " colorThreshold" , 20 },
2222
@@ -168,7 +168,7 @@ bool Config::Validate(const json& j) const
168168 { " augKey" , 0 , 0xFE },
169169 { " sgKey" , 0 , 0xFE },
170170 { " offKey" , 0 , 0xFE },
171- { " sensitivity" , 1 , 8 },
171+ { " sensitivity" , 1.0 , 8.0 },
172172 { " zoomSensitivity" , 0.01 , 3.0 },
173173 { " colorThreshold" , 0 , 20 },
174174 { " confirmationKey" , 0 , 0xFE },
@@ -351,8 +351,8 @@ void Config::ConfigureSettings()
351351 sensitivity = GetValidatedInput (
352352 " Enter your mouse sensitivity for general gameplay.\n "
353353 " This controls how fast your cursor moves in the game.\n "
354- " Range: 1 (slow) to 8 (fast).\n "
355- " Example: 8\n > " , 1 , 8 );
354+ " Range: 1.0 (slow) to 8.0 (fast).\n "
355+ " Example: 8.0 \n > " , 1.0 , 8.0 );
356356
357357 zoomSensitivity = GetValidatedInput (
358358 " Enter your mouse sensitivity when zoomed in (e.g., aiming down sights).\n "
@@ -590,11 +590,8 @@ void Config::PrintSuccess() const
590590 printLine (" Rapid Fire" , (rapidFire ? " ENABLED" : " DISABLED" ));
591591 printLine (" Fast Reload" , (fastReload ? " ENABLED" : " DISABLED" ));
592592
593- printLine (" Sensitivity" , to_string (sensitivity));
594-
595- ostringstream oss;
596- oss << fixed << setprecision (2 ) << zoomSensitivity;
597- printLine (" Zoom Sensitivity" , oss.str ());
593+ printLine (" Sensitivity" , FormatFloat (sensitivity));
594+ printLine (" Zoom Sensitivity" , FormatFloat (zoomSensitivity));
598595
599596 printLine (" Color Bot Threshold" , to_string (colorThreshold));
600597
@@ -674,6 +671,13 @@ void Config::FromJson(const json& j)
674671 readKey (" offKey" , offKey);
675672}
676673
674+ string Config::FormatFloat (double value, int precision)
675+ {
676+ ostringstream oss;
677+ oss << fixed << setprecision (precision) << value;
678+ return oss.str ();
679+ }
680+
677681void Config::Save () const
678682{
679683 ofstream file (" Config.json" );
0 commit comments