Minor adjustement to the last patch : replaced the "prog make version" fields in the scenario editor with a switch that controls legacy compatibility (as "prog make version" is to be handled by the editor itself).

Chokboyz

git-svn-id: http://openexile.googlecode.com/svn/trunk@158 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
Chokboyz
2010-09-28 20:44:44 +00:00
parent d83aa6b55c
commit ab9d0cfa93
3 changed files with 39 additions and 36 deletions

View File

@@ -51,17 +51,17 @@
LTEXT "2_0", 26, 257, 414, 38, 15
}
803 DIALOG 10, 10, 505, 520
803 DIALOG 10, 10, 505, 455
STYLE WS_POPUP | WS_DLGFRAME
{
DEFPUSHBUTTON "", 1, 279, 470, 31, 10
DEFPUSHBUTTON "", 1, 279, 427, 31, 10
LTEXT "6_0", 2, 181, 85, 43, 16
LTEXT "6_0", 3, 234, 85, 43, 16
LTEXT "6_0", 4, 287, 85, 43, 16
LTEXT "6_0", 5, 181, 109, 243, 47
LTEXT "6_0", 6, 181, 164, 243, 47
LTEXT "6_0", 7, 181, 219, 243, 65
LTEXT "1_63", 8, 395, 487, 54, 16
LTEXT "1_63", 8, 395, 407, 54, 16
LTEXT "5_716", 9, 8, 8, 36, 36
LTEXT "This is where you can define the various pieces of information the user will see when deciding whether or not to play your scenario. The meanings of all these fields are given in the documentation.", 10, 50, 23, 372, 53
LTEXT "~Scenario Details", 11, 50, 6, 256, 17
@@ -89,14 +89,9 @@
LTEXT "2_0", 33, 423, 344, 26, 15
LTEXT "*Don't automatically adjust difficulty", 34, 50, 367, 50, 15
LTEXT "2_0", 35, 260, 371, 32, 15
LTEXT "6_0", 36, 201,397, 43, 16
LTEXT "6_0", 37, 201,424, 43, 16
LTEXT "6_0", 38, 254,424, 43, 16
LTEXT "6_0", 39, 307,424, 43, 16
LTEXT "*Minimum Version:", 40, 50,397, 120, 14
LTEXT "*Program Make Version:", 41, 50,424, 120, 14
LTEXT "N.B: setting the major _program make version_ number (the first one) to 1 force the legacy compatibility. Therefore, legacy scenarii _program make version_ should always be of the form 1.x.x", 42, 50,444, 320, 53
}
LTEXT "*Enable legacy compatibility", 36, 50, 387, 50, 15
LTEXT "2_0", 37, 260, 391, 32, 15
}
804 DIALOG 10, 10, 639, 391
STYLE WS_POPUP | WS_DLGFRAME

View File

@@ -2323,14 +2323,10 @@ Boolean save_scen_details()
scenario.adjust_diff = cd_get_led(803,35);
scenario.ver[0] = CDGN(803,2);
scenario.ver[1] = CDGN(803,3);
scenario.ver[2] = CDGN(803,4);
scenario.min_run_ver = CDGN(803,36);
scenario.prog_make_ver[0] = CDGN(803,37);
scenario.prog_make_ver[1] = CDGN(803,38);
scenario.prog_make_ver[2] = CDGN(803,39);
scenario.ver[2] = CDGN(803,4);
for (i = 0; i < 3; i++)
if (cre(scenario.ver[i],
0,9,"The digits in the version number must be in the 0 to 9 range.","",803) == TRUE) return FALSE;
0,9,"The digits in the version number must be in the 0 to 9 range.","",803) == true) return false;
CDGT(803,5,(char *) str);
str[59] = 0;
strcpy(scen_strs[1],(char *) str);
@@ -2338,25 +2334,34 @@ Boolean save_scen_details()
str[59] = 0;
strcpy(scen_strs[2],(char *) str);
CDGT(803,7,scen_strs[3]);
//enable legacy compatibility switch
if(cd_get_led(803,37) == 1)
scenario.prog_make_ver[0]=1;
else
scenario.prog_make_ver[0]=2;
return TRUE;
return true;
}
void put_scen_details_in_dlog()
{
cd_set_led_range(803,30,33,scenario.difficulty);
cd_set_led_range(803,21,24,scenario.rating);
cd_set_led(803,35,scenario.adjust_diff);
cd_set_led(803,35,scenario.adjust_diff);
CDSN(803,2,scenario.ver[0]);
CDSN(803,3,scenario.ver[1]);
CDSN(803,4,scenario.ver[2]);
CDST(803,5,scen_strs[1]);
CDST(803,6,scen_strs[2]);
CDST(803,7,scen_strs[3]);
CDSN(803,36,scenario.min_run_ver);
CDSN(803,37,scenario.prog_make_ver[0]);
CDSN(803,38,scenario.prog_make_ver[1]);
CDSN(803,39,scenario.prog_make_ver[2]);
//enable legacy compatibility switch
if(scenario.prog_make_ver[0]==1)
cd_set_led(803,37,1);
else
cd_set_led(803,37,0);
}
void edit_scen_details_event_filter (short item_hit)
@@ -2368,6 +2373,9 @@ void edit_scen_details_event_filter (short item_hit)
break;
case 35:
cd_set_led(803,35,1 - cd_get_led(803,35));
break;
case 37://enable legacy compatibility switch
cd_set_led(803,37,1 - cd_get_led(803,37));
break;
default:
cd_hit_led_range(803,21,24,item_hit);