From 102627e2d5346294752619a4cb0c4aa1d54939b9 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 1 Sep 2013 20:35:43 +0200 Subject: [PATCH] Fix engine-defined names --- backend.c | 1 + dialogs.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index 2da18a9..78e8431 100644 --- a/backend.c +++ b/backend.c @@ -10003,6 +10003,7 @@ NonStandardBoardSize () { /* [HGM] Awkward testing. Should really be a table */ int overruled = gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; + if( gameInfo.variant == VariantUnknown ) return 0; // engine-defined name never needs prefix if( gameInfo.variant == VariantXiangqi ) overruled = gameInfo.boardWidth != 9 || gameInfo.boardHeight != 10 || gameInfo.holdingsSize != 0; if( gameInfo.variant == VariantShogi ) diff --git a/dialogs.c b/dialogs.c index bfab653..da0f4a1 100644 --- a/dialogs.c +++ b/dialogs.c @@ -455,6 +455,12 @@ static Option variantDescriptors[] = { { VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, { VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, { VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, +{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, +{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, +{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, +{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, +{ VariantUnknown, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, +{ VariantUnknown, SAME_ROW,135, NULL, (void*) &Pick, "#FFFFFF", NULL, -1, NULL }, { 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } }; @@ -501,17 +507,17 @@ NewVariantProc () sprintf(warning, _("All variants not supported by first engine\n(currently %s) are disabled"), first.tidy); if(!start) while(variantDescriptors[start].type != -1) start++; // locate first spare last = -1; - for(i=0; i<6; i++) { // create buttons for engine-defined variants + for(i=0; variantDescriptors[start+i].type != EndMark; i++) { // create buttons for engine-defined variants char *v = EngineDefinedVariant(&first, i); if(v) { last = i; ASSIGN(variantDescriptors[start+i].name, v); variantDescriptors[start+i].type = Button; } else variantDescriptors[start+i].type = -1; - if(!(last&1)) { // odd number, add filler + } + if(!(last&1)) { // odd number, add filler ASSIGN(variantDescriptors[start+last+1].name, " "); variantDescriptors[start+last+1].type = Button; - } } GenericPopUp(variantDescriptors, _("New Variant"), TransientDlg, BoardWindow, MODAL, 0); } -- 1.7.0.4