The GenericReadout was adapted to be able to read a single selected
value, so that the callback to the 'play' button in the sounds dialog
could get the name of the 'user WAV file' without accepting all settings
for the other sounds (which should only happen on 'OK', and might still
be cancelled in stead).
int MakeColors P((void));
void CreateGCs P((int redo));
void CreateAnyPieces P((void));
int MakeColors P((void));
void CreateGCs P((int redo));
void CreateAnyPieces P((void));
+void GenericReadout P((int selected));
Widget shells[10];
Widget marked[10];
Boolean shellUp[10];
Widget shells[10];
Widget marked[10];
Boolean shellUp[10];
- GenericReadout(); // make sure ranks and file settings are read
+ GenericReadout(-1); // make sure ranks and file settings are read
gameInfo.variant = v;
appData.variant = VariantName(v);
gameInfo.variant = v;
appData.variant = VariantName(v);
if(soundFiles[values[3]]) PlaySound(soundFiles[values[3]]);
}
if(soundFiles[values[3]]) PlaySound(soundFiles[values[3]]);
}
{ 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" }
};
{ 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" }
};
+void GenericReadout(int selected)
{
int i, j;
String name, val;
{
int i, j;
String name, val;
char buf[MSG_SIZ], **dest;
float x;
for(i=0; ; i++) { // send all options that had to be OK-ed to engine
char buf[MSG_SIZ], **dest;
float x;
for(i=0; ; i++) { // send all options that had to be OK-ed to engine
+ if(selected >= 0) { if(i < selected) continue; else if(i > selected) break; }
switch(currentOption[i].type) {
case TextBox:
case FileName:
switch(currentOption[i].type) {
case TextBox:
case FileName:
return;
}
if (strcmp(name, _("OK")) == 0) { // save buttons imply OK
return;
}
if (strcmp(name, _("OK")) == 0) { // save buttons imply OK
PopDown(data);
return;
}
if(currentCps) {
PopDown(data);
return;
}
if(currentCps) {
- if(currentOption[data].type == SaveButton) GenericReadout();
+ if(currentOption[data].type == SaveButton) GenericReadout(-1);
snprintf(buf, MSG_SIZ, "option %s\n", name);
SendToProgram(buf, currentCps);
} else ((ButtonCallback*) currentOption[data].target)(data);
snprintf(buf, MSG_SIZ, "option %s\n", name);
SendToProgram(buf, currentCps);
} else ((ButtonCallback*) currentOption[data].target)(data);