chessbox: Get rid of strings for level 8/9/10

We've been limited to level 7 since approximately forever, so
there's no point in wasting translation strings on anything higher.

Change-Id: Idee0f1f0aa1b99d9efdcaa34d0d3130a54e1628e
This commit is contained in:
Solomon Peachy 2025-02-21 18:13:00 -05:00
parent 7897cded2d
commit 4a6b27a712
2 changed files with 5 additions and 60 deletions

View file

@ -13435,48 +13435,6 @@
*: "Level 7, 40 moves per 240 minutes" *: "Level 7, 40 moves per 240 minutes"
</voice> </voice>
</phrase> </phrase>
<phrase>
id: LANG_CHESSBOX_LEVEL_8
desc: in the chessbox game level selection
user: core
<source>
*: "Level 8: 1 move / 15 min"
</source>
<dest>
*: "Level 8: 1 move / 15 min"
</dest>
<voice>
*: "Level 8, 1 move per 15 minutes"
</voice>
</phrase>
<phrase>
id: LANG_CHESSBOX_LEVEL_9
desc: in the chessbox game level selection
user: core
<source>
*: "Level 9: 1 move / 60 min"
</source>
<dest>
*: "Level 9: 1 move / 60 min"
</dest>
<voice>
*: "Level 9, 1 move per 60 minutes"
</voice>
</phrase>
<phrase>
id: LANG_CHESSBOX_LEVEL_10
desc: in the chessbox game level selection
user: core
<source>
*: "Level 10: 1 move / 600 min"
</source>
<dest>
*: "Level 10: 1 move / 600 min"
</dest>
<voice>
*: "Level 10, 1 move per 600 minutes"
</voice>
</phrase>
<phrase> <phrase>
id: LANG_CHESSBOX_PGN_PARSE_ERROR id: LANG_CHESSBOX_PGN_PARSE_ERROR
desc: in the chessbox game viewer desc: in the chessbox game viewer

View file

@ -35,6 +35,8 @@
#include "opening.h" #include "opening.h"
#include "chessbox_pgn.h" #include "chessbox_pgn.h"
#define MAX_LEVEL 7
/* type definitions */ /* type definitions */
struct cb_command { struct cb_command {
int type; int type;
@ -86,10 +88,7 @@ const char *level_string[] = { ID2P(LANG_CHESSBOX_LEVEL_1) ,
ID2P(LANG_CHESSBOX_LEVEL_4) , ID2P(LANG_CHESSBOX_LEVEL_4) ,
ID2P(LANG_CHESSBOX_LEVEL_5) , ID2P(LANG_CHESSBOX_LEVEL_5) ,
ID2P(LANG_CHESSBOX_LEVEL_6) , ID2P(LANG_CHESSBOX_LEVEL_6) ,
ID2P(LANG_CHESSBOX_LEVEL_7) , ID2P(LANG_CHESSBOX_LEVEL_7) };
ID2P(LANG_CHESSBOX_LEVEL_8) ,
ID2P(LANG_CHESSBOX_LEVEL_9) ,
ID2P(LANG_CHESSBOX_LEVEL_10) };
/* "While thinking" command */ /* "While thinking" command */
int wt_command = COMMAND_NOP; int wt_command = COMMAND_NOP;
@ -243,7 +242,7 @@ static void cb_wt_callback ( void ) {
/* ---- set playing parameters depending on level ---- */ /* ---- set playing parameters depending on level ---- */
static void cb_setlevel ( int lev ) { static void cb_setlevel ( int lev ) {
Level = (lev > 7) ? 7 : ( (lev < 1) ? 1 : lev ) ; Level = (lev > MAX_LEVEL) ? MAX_LEVEL : ( (lev < 1) ? 1 : lev ) ;
switch (Level) { switch (Level) {
case 1 : case 1 :
TCmoves = 60; TCmoves = 60;
@ -273,18 +272,6 @@ static void cb_setlevel ( int lev ) {
TCmoves = 40; TCmoves = 40;
TCminutes = 240; TCminutes = 240;
break; break;
case 8 :
TCmoves = 1;
TCminutes = 15;
break;
case 9 :
TCmoves = 1;
TCminutes = 60;
break;
case 10 :
TCmoves = 1;
TCminutes = 600;
break;
} }
TCflag = (TCmoves > 1); TCflag = (TCmoves > 1);
SetTimeControl(); SetTimeControl();
@ -292,7 +279,7 @@ static void cb_setlevel ( int lev ) {
/* ---- increase playing level ---- */ /* ---- increase playing level ---- */
static void cb_levelup ( void ) { static void cb_levelup ( void ) {
if ( Level == 7 ) if ( Level >= MAX_LEVEL )
cb_setlevel ( 1 ); cb_setlevel ( 1 );
else else
cb_setlevel ( Level+1 ); cb_setlevel ( Level+1 );