Play dialog: the strength slider alone (no Weaker · As me · Stronger)
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

The owner found the relative buttons silly: the slider sets Maia's strength;
named levels (ranks) will come after the study of what Maia's ratings mean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-25 16:42:57 +03:00
parent 053b189614
commit f90c636dd7
2 changed files with 0 additions and 75 deletions

View file

@ -10649,39 +10649,6 @@ const ROWS: &[[&str; 9]] = &[
"Qo‘shimcha, s:",
"Қосымша, с:",
],
[
"Weaker",
"Слабее",
"Plus faible",
"Schwächer",
"Más débil",
"Più debole",
"Mais fraco",
"Kuchsizroq",
"Әлсіздеу",
],
[
"As me",
"Как я",
"Comme moi",
"Wie ich",
"Como yo",
"Come me",
"Como eu",
"Men kabi",
"Мендей",
],
[
"Stronger",
"Сильнее",
"Plus fort",
"Stärker",
"Más fuerte",
"Più forte",
"Mais forte",
"Kuchliroq",
"Күштірек",
],
[
"Play",
"Играть",
@ -10913,17 +10880,6 @@ const ROWS: &[[&str; 9]] = &[
"Lichess shkalasi: Maia 1500 reytingi 1500 bo‘lgan klub o‘yinchisidan kuchsizroq.",
"Lichess шкаласы: Maia 1500 рейтингі 1500 клуб ойыншысынан әлсіздеу.",
],
[
"Enter your rating: Weaker · As me · Stronger will choose for you",
"Укажите рейтинг — сила подберётся кнопками Слабее · Как я · Сильнее",
"Indiquez votre classement : Plus faible · Comme moi · Plus fort choisiront pour vous",
"Geben Sie Ihre Wertung ein: Schwächer · Wie ich · Stärker wählen dann für Sie",
"Indica tu rating: Más débil · Como yo · Más fuerte elegirán por ti",
"Inserisci il tuo rating: Più debole · Come me · Più forte sceglieranno per te",
"Informe seu rating: Mais fraco · Como eu · Mais forte escolherão por você",
"Reytingingizni kiriting: Kuchsizroq · Men kabi · Kuchliroq siz uchun tanlaydi",
"Рейтингіңізді енгізіңіз: Әлсіздеу · Мендей · Күштірек өзі таңдайды",
],
[
"Maia resigned",
"Maia сдалась",

View file

@ -152,11 +152,6 @@ impl Default for PlayPrefs {
pub const STRENGTH_MIN: u32 = 600;
pub const STRENGTH_MAX: u32 = 2600;
/// «As me»: the user's rating rounded to 100, within Maia's range.
pub fn strength_like(rating: u32) -> u32 {
(((rating + 50) / 100) * 100).clamp(STRENGTH_MIN, STRENGTH_MAX)
}
// ----- the clock -----------------------------------------------------------------------
/// Both clocks. Time runs for the side to move from the moment its opponent moved; a
@ -648,8 +643,6 @@ mod tests {
}
}
}
assert_eq!(strength_like(1350), 1400);
assert_eq!(strength_like(300), 600);
}
}
@ -1001,31 +994,7 @@ impl Dialog {
.weak()
.size(11.5),
);
// Relative to the user's rating; without one, a line saying so instead.
let rating = self.rating();
match rating {
Some(r) => {
ui.horizontal(|ui| {
for (label, delta) in [(tr("Weaker"), -200), (tr("As me"), 0), (tr("Stronger"), 200)] {
let target = strength_like((r as i32 + delta).max(0) as u32);
if choice(ui, target == self.prefs.strength, label, [(W - 2.0 * GAP) / 3.0, TILE_H])
.clicked()
{
self.prefs.strength = target;
}
}
});
}
None => {
ui.allocate_ui_with_layout(
egui::vec2(W, TILE_H),
egui::Layout::left_to_right(egui::Align::Center),
|ui| {
ui.label(RichText::new(tr("Enter your rating: Weaker · As me · Stronger will choose for you")).weak());
},
);
}
}
// Colour.
section(ui, tr("Your colour"));