- if(mainmenu==4){
- nummenuitems=10;
- if(keyselect!=0)sprintf (menustring[0], "Forwards: %s",KeyToChar(forwardkey));
- else sprintf (menustring[0], "Forwards: _");
- startx[0]=10;
- starty[0]=400;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- if(keyselect!=1)sprintf (menustring[1], "Back: %s",KeyToChar(backkey));
- else sprintf (menustring[1], "Back: _");
- startx[1]=10+40;
- starty[1]=360;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;
-
- if(keyselect!=2)sprintf (menustring[2], "Left: %s",KeyToChar(leftkey));
- else sprintf (menustring[2], "Left: _");
- startx[2]=10+40;
- starty[2]=320;
- endx[2]=startx[2]+strlen(menustring[2])*10;
- endy[2]=starty[2]+20;
- movex[2]=0;
- movey[2]=0;
-
- if(keyselect!=3)sprintf (menustring[3], "Right: %s",KeyToChar(rightkey));
- else sprintf (menustring[3], "Right: _");
- startx[3]=10+30;
- starty[3]=280;
- endx[3]=startx[3]+strlen(menustring[3])*10;
- endy[3]=starty[3]+20;
- movex[3]=0;
- movey[3]=0;
-
- if(keyselect!=4)sprintf (menustring[4], "Crouch: %s",KeyToChar(crouchkey));
- else sprintf (menustring[4], "Crouch: _");
- startx[4]=10+20;
- starty[4]=240;
- endx[4]=startx[4]+strlen(menustring[4])*10;
- endy[4]=starty[4]+20;
- movex[4]=0;
- movey[4]=0;
-
- if(keyselect!=5)sprintf (menustring[5], "Jump: %s",KeyToChar(jumpkey));
- else sprintf (menustring[5], "Jump: _");
- startx[5]=10+40;
- starty[5]=200;
- endx[5]=startx[5]+strlen(menustring[5])*10;
- endy[5]=starty[5]+20;
- movex[5]=0;
- movey[5]=0;
-
- if(keyselect!=6)sprintf (menustring[6], "Draw: %s",KeyToChar(drawkey));
- else sprintf (menustring[6], "Draw: _");
- startx[6]=10+40;
- starty[6]=160;
- endx[6]=startx[6]+strlen(menustring[6])*10;
- endy[6]=starty[6]+20;
- movex[6]=0;
- movey[6]=0;
-
- if(keyselect!=7)sprintf (menustring[7], "Throw: %s",KeyToChar(throwkey));
- else sprintf (menustring[7], "Throw: _");
- startx[7]=10+30;
- starty[7]=120;
- endx[7]=startx[7]+strlen(menustring[7])*10;
- endy[7]=starty[7]+20;
- movex[7]=0;
- movey[7]=0;
-
- if(keyselect!=8)sprintf (menustring[8], "Attack: %s",KeyToChar(attackkey));
- else sprintf (menustring[8], "Attack: _");
- startx[8]=10+20;
- starty[8]=80;
- endx[8]=startx[8]+strlen(menustring[8])*10;
- endy[8]=starty[8]+20;
- movex[8]=0;
- movey[8]=0;
-
-
-
- sprintf (menustring[9], "Back");
- startx[9]=10;
- endx[9]=startx[9]+strlen(menustring[9])*10;
- starty[9]=10;
- endy[9]=starty[9]+20;
- movex[9]=0;
- movey[9]=0;
- }
- if(mainmenu==5){
- nummenuitems=7+accountcampaignchoicesmade[accountactive]+campaignchoicenum;
-
- sprintf (menustring[0], "%s",accountname[accountactive]);
- startx[0]=5;
- starty[0]=400;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- sprintf (menustring[1], "Tutorial");
- startx[1]=5;
- starty[1]=300;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;
-
- sprintf (menustring[2], "Challenge");
- startx[2]=5;
- starty[2]=240;
- endx[2]=startx[2]+strlen(menustring[2])*10;
- endy[2]=starty[2]+20;
- movex[2]=0;
- movey[2]=0;
-
- sprintf (menustring[3], "Delete User");
- startx[3]=400;
- starty[3]=10;
- endx[3]=startx[3]+strlen(menustring[3])*10;
- endy[3]=starty[3]+20;
- movex[3]=0;
- movey[3]=0;
-
- sprintf (menustring[4], "Main Menu");
- startx[4]=5;
- starty[4]=10;
- endx[4]=startx[4]+strlen(menustring[4])*10;
- endy[4]=starty[4]+20;
- movex[4]=0;
- movey[4]=0;
-
- sprintf (menustring[5], "Change User");
- startx[5]=5;
- endx[5]=startx[5]+strlen(menustring[5])*10;
- starty[5]=180;
- endy[5]=starty[5]+20;
- movex[5]=0;
- movey[5]=0;
-
- //World
-
- sprintf (menustring[6], "World");
- startx[6]=30+120;
- starty[6]=30+480-400-50;
- endx[6]=startx[6]+400;
- endy[6]=30+480-50;
- movex[6]=0;
- movey[6]=0;
-
- if(accountcampaignchoicesmade[accountactive])
- for(i=0;i<accountcampaignchoicesmade[accountactive];i++){
- sprintf (menustring[7+i], campaigndescription[levelorder[i]]);
- startx[7+i]=30+120+campaignlocationx[levelorder[i]]*400/512;
- starty[7+i]=30+30+(512-campaignlocationy[levelorder[i]])*400/512;
- endx[7+i]=startx[7+i]+10;
- endy[7+i]=starty[7+i]+10;
- movex[7+i]=0;
- movey[7+i]=0;
- }
-
- if(campaignchoicenum>0)
- for(i=accountcampaignchoicesmade[accountactive];i<accountcampaignchoicesmade[accountactive]+campaignchoicenum;i++){
- sprintf (menustring[7+i], campaigndescription[levelorder[i]]);
- startx[7+i]=30+120+campaignlocationx[campaignchoicewhich[i-(accountcampaignchoicesmade[accountactive])]]*400/512;
- starty[7+i]=30+30+(512-campaignlocationy[campaignchoicewhich[i-(accountcampaignchoicesmade[accountactive])]])*400/512;
- endx[7+i]=startx[7+i]+10;
- endy[7+i]=starty[7+i]+10;
- movex[7+i]=0;
- movey[7+i]=0;
- }
-
- /*sprintf (menustring[7], "Dot");
- startx[7]=120+260*400/512;
- starty[7]=30+(512-184)*400/512;
- endx[7]=startx[7]+10;
- endy[7]=starty[7]+10;
- movex[7]=0;
- movey[7]=0;
-
- sprintf (menustring[8], "Dot");
- startx[8]=120+129*400/512;
- starty[8]=30+(512-284)*400/512;
- endx[8]=startx[8]+10;
- endy[8]=starty[8]+10;
- movex[8]=0;
- movey[8]=0;
-
- sprintf (menustring[9], "Dot");
- startx[9]=120+358*400/512;
- starty[9]=30+(512-235)*400/512;
- endx[9]=startx[9]+10;
- endy[9]=starty[9]+10;
- movex[9]=0;
- movey[9]=0;
-
- sprintf (menustring[10], "Dot");
- startx[10]=120+359*400/512;
- starty[10]=30+(512-308)*400/512;
- endx[10]=startx[10]+10;
- endy[10]=starty[10]+10;
- movex[10]=0;
- movey[10]=0;
-
- sprintf (menustring[11], "Dot");
- startx[11]=120+288*400/512;
- starty[11]=30+(512-277)*400/512;
- endx[11]=startx[11]+10;
- endy[11]=starty[11]+10;
- movex[11]=0;
- movey[11]=0;*/
- }
-
- if(mainmenu==6){
- nummenuitems=3;
-
- sprintf (menustring[0], "Are you sure you want to delete this user?");
- startx[0]=10;
- starty[0]=400;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- sprintf (menustring[1], "Yes");
- startx[1]=10;
- starty[1]=360;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;
-
- sprintf (menustring[2], "No");
- startx[2]=10;
- starty[2]=320;
- endx[2]=startx[2]+strlen(menustring[2])*10;
- endy[2]=starty[2]+20;
- movex[2]=0;
- movey[2]=0;
-
- sprintf (menustring[3], "Extra 4");
- startx[3]=10;
- starty[3]=280;
- endx[3]=startx[3]+strlen(menustring[3])*10;
- endy[3]=starty[3]+20;
- movex[3]=0;
- movey[3]=0;
-
- sprintf (menustring[4], "Extra 5");
- startx[4]=10;
- starty[4]=240;
- endx[4]=startx[4]+strlen(menustring[4])*10;
- endy[4]=starty[4]+20;
- movex[4]=0;
- movey[4]=0;
-
- sprintf (menustring[5], "Back");
- startx[5]=10;
- endx[5]=startx[5]+strlen(menustring[5])*10;
- starty[5]=10;
- endy[5]=starty[5]+20;
- movex[5]=0;
- movey[5]=0;
- }
-
- if(mainmenu==7){
- nummenuitems=numaccounts+2;
-
- int num;
-
- if(numaccounts<8)
- sprintf (menustring[0], "New User");
- else
- sprintf (menustring[0], "No More Users");
- startx[0]=10;
- starty[0]=400;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- if(entername)startx[0]+=10;
-
-
- num=1;
- if(numaccounts)
- for(i=0;i<numaccounts;i++){
- sprintf (menustring[num], "%s",accountname[i]);
- startx[num]=10;
- starty[num]=360-20-20*num;
- endx[num]=startx[num]+strlen(menustring[num])*10;
- endy[num]=starty[num]+20;
- movex[num]=0;
- movey[num]=0;
-
- num++;
- }
-
- sprintf (menustring[num], "Back");
- startx[num]=10;
- endx[num]=startx[num]+strlen(menustring[num])*10;
- starty[num]=10;
- endy[num]=starty[num]+20;
- movex[num]=0;
- movey[num]=0;
- }
- if(mainmenu==8){
- nummenuitems=3;
-
- sprintf (menustring[0], "Easier");
- startx[0]=10;
- starty[0]=400;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- sprintf (menustring[1], "Difficult");
- startx[1]=10;
- starty[1]=360;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;
-
- sprintf (menustring[2], "Insane");
- startx[2]=10;
- starty[2]=320;
- endx[2]=startx[2]+strlen(menustring[2])*10;
- endy[2]=starty[2]+20;
- movex[2]=0;
- movey[2]=0;
- }
- if(mainmenu==9){
- int tempncl;
- //tempncl=numchallengelevels;
- //numchallengelevels=9;
- nummenuitems=2+numchallengelevels;
- char temp[255];
-
- for(j=0;j<numchallengelevels;j++){
- for(i=0;i<255;i++)menustring[j][i]='\0';
- sprintf (temp, "Level %d",j+1);
- strcpy(menustring[j],temp);
- for(i=0;i<17;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
- menustring[j][17]='\0';
- sprintf (temp, "%d",(int)accounthighscore[accountactive][j]);
- strcat(menustring[j],temp);
- for(i=18;i<32;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
- menustring[j][32]='\0';
- sprintf (temp, "%d:",(int)(((int)accountfasttime[accountactive][j]-(int)(accountfasttime[accountactive][j])%60)/60));
- strcat(menustring[j],temp);
- if((int)(accountfasttime[accountactive][j])%60<10)strcat(menustring[j],"0");
- sprintf (temp, "%d",(int)(accountfasttime[accountactive][j])%60);
- strcat(menustring[j],temp);
-
- startx[j]=10;
- starty[j]=400-j*25;
- endx[j]=startx[j]+strlen(menustring[j])*10;
- endy[j]=starty[j]+20;
- movex[j]=0;
- movey[j]=0;
- }
-
- sprintf (menustring[numchallengelevels], "Back");
- startx[numchallengelevels]=10;
- endx[numchallengelevels]=startx[numchallengelevels]+strlen(menustring[numchallengelevels])*10;
- starty[numchallengelevels]=10;
- endy[numchallengelevels]=starty[numchallengelevels]+20;
- movex[numchallengelevels]=0;
- movey[numchallengelevels]=0;
-
- sprintf (menustring[numchallengelevels+1], " High Score Best Time");
- startx[numchallengelevels+1]=10;
- starty[numchallengelevels+1]=440;
- endx[numchallengelevels+1]=startx[numchallengelevels+1]+strlen(menustring[numchallengelevels+1])*10;
- endy[numchallengelevels+1]=starty[numchallengelevels+1]+20;
- movex[numchallengelevels+1]=0;
- movey[numchallengelevels+1]=0;
-
- //numchallengelevels=tempncl;
-
- }
- if(mainmenu==11){
- nummenuitems=2+numchallengelevels;
- char temp[255];
-
- for(j=0;j<numchallengelevels;j++){
- for(i=0;i<255;i++)menustring[j][i]='\0';
- sprintf (temp, "Level %d",j+1);
- strcpy(menustring[j],temp);
- for(i=0;i<17;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
- menustring[j][17]='\0';
- sprintf (temp, "%d",(int)accounthighscore[accountactive][j]);
- strcat(menustring[j],temp);
- for(i=18;i<32;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
- menustring[j][32]='\0';
- sprintf (temp, "%d:",(int)(((int)accountfasttime[accountactive][j]-(int)(accountfasttime[accountactive][j])%60)/60));
- strcat(menustring[j],temp);
- if((int)(accountfasttime[accountactive][j])%60<10)strcat(menustring[j],"0");
- sprintf (temp, "%d",(int)(accountfasttime[accountactive][j])%60);
- strcat(menustring[j],temp);
-
- startx[j]=10;
- starty[j]=360-j*40;
- endx[j]=startx[j]+strlen(menustring[j])*10;
- endy[j]=starty[j]+20;
- movex[j]=0;
- movey[j]=0;
- }
-
- sprintf (menustring[numchallengelevels], "Back");
- startx[numchallengelevels]=10;
- endx[numchallengelevels]=startx[numchallengelevels]+strlen(menustring[numchallengelevels])*10;
- starty[numchallengelevels]=10;
- endy[numchallengelevels]=starty[numchallengelevels]+20;
- movex[numchallengelevels]=0;
- movey[numchallengelevels]=0;
-
- sprintf (menustring[numchallengelevels+1], " High Score Best Time");
- startx[numchallengelevels+1]=10;
- starty[numchallengelevels+1]=400;
- endx[numchallengelevels+1]=startx[numchallengelevels+1]+strlen(menustring[numchallengelevels+1])*10;
- endy[numchallengelevels+1]=starty[numchallengelevels+1]+20;
- movex[numchallengelevels+1]=0;
- movey[numchallengelevels+1]=0;
-
- }
- if(mainmenu==10){
- nummenuitems=6;
- char temp[255];
-
- sprintf (menustring[0], "Congratulations!");
- startx[0]=220;
- starty[0]=330;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- sprintf (menustring[1], "You have avenged your family and");
- startx[1]=140;
- starty[1]=300;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;
-
- sprintf (menustring[2], "restored peace to the island of Lugaru.");
- startx[2]=110;
- starty[2]=270;
- endx[2]=startx[2]+strlen(menustring[2])*10;
- endy[2]=starty[2]+20;
- movex[2]=0;
- movey[2]=0;
-
- sprintf (menustring[3], "Back");
- startx[3]=10;
- endx[3]=startx[3]+strlen(menustring[3])*10;
- starty[3]=10;
- endy[3]=starty[3]+20;
- movex[3]=0;
- movey[3]=0;
-
- for(i=0;i<255;i++)menustring[4][i]='\0';
- sprintf (temp, "Your score:");
- strcpy(menustring[4],temp);
- for(i=0;i<20;i++)if(menustring[4][i]=='\0')menustring[4][i]=' ';
- menustring[4][20]='\0';
- sprintf (temp, "%d",(int)accountcampaignscore[accountactive]);
- strcat(menustring[4],temp);
- startx[4]=190;
- endx[4]=startx[4]+strlen(menustring[4])*10;
- starty[4]=200;
- endy[4]=starty[4]+20;
- movex[4]=0;
- movey[4]=0;
- /*
- for(i=0;i<255;i++)menustring[5][i]='\0';
- sprintf (temp, "Your time:");
- strcpy(menustring[5],temp);
- for(i=0;i<20;i++)if(menustring[5][i]=='\0')menustring[5][i]=' ';
- menustring[5][20]='\0';
- sprintf (temp, "%d",(int)accountcampaigntime[accountactive]);
- strcat(menustring[5],temp);
- startx[5]=200;
- endx[5]=startx[5]+strlen(menustring[5])*10;
- starty[5]=180;
- endy[5]=starty[5]+20;
- movex[5]=0;
- movey[5]=0;
- */
- for(i=0;i<255;i++)menustring[5][i]='\0';
- sprintf (temp, "Highest score:");
- strcpy(menustring[5],temp);
- for(i=0;i<20;i++)if(menustring[5][i]=='\0')menustring[5][i]=' ';
- menustring[5][20]='\0';
- sprintf (temp, "%d",(int)accountcampaignhighscore[accountactive]);
- strcat(menustring[5],temp);
- startx[5]=190;
- endx[5]=startx[5]+strlen(menustring[5])*10;
- starty[5]=180;
- endy[5]=starty[5]+20;
- movex[5]=0;
- movey[5]=0;
- /*
- for(i=0;i<255;i++)menustring[7][i]='\0';
- sprintf (temp, "Lowest time:");
- strcpy(menustring[7],temp);
- for(i=0;i<20;i++)if(menustring[7][i]=='\0')menustring[7][i]=' ';
- menustring[7][20]='\0';
- sprintf (temp, "%d",(int)accountcampaignfasttime[accountactive]);
- strcat(menustring[7],temp);
- startx[7]=200;
- endx[7]=startx[7]+strlen(menustring[7])*10;
- starty[7]=130;
- endy[7]=starty[7]+20;
- movex[7]=0;
- movey[7]=0;*/
- }
- }
-
- if(mainmenu==12){
- menupulse+=multiplier*2;
-
- nummenuitems=6;
- char temp[255];
-
- sprintf (menustring[0], "Register now for only $19.95!");
- startx[0]=160;
- starty[0]=270;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- sprintf (menustring[1], "Confront raiders, wolves, and more!");
- startx[1]=130;
- starty[1]=240;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;
-
- sprintf (menustring[2], "Fight using swords, staves and armor!");
- startx[2]=125;
- starty[2]=210;
- endx[2]=startx[2]+strlen(menustring[2])*10;
- endy[2]=starty[2]+20;
- movex[2]=0;
- movey[2]=0;
-
- if(!tryquit)sprintf (menustring[3], "Back");
- else sprintf (menustring[3], "Quit");
- startx[3]=10;
- endx[3]=startx[3]+strlen(menustring[3])*10;
- starty[3]=10;
- endy[3]=starty[3]+20;
- movex[3]=0;
- movey[3]=0;
-
- sprintf (menustring[4], "Register now!");
- startx[4]=250;
- endx[4]=startx[4]+strlen(menustring[4])*10;
- starty[4]=140;
- endy[4]=starty[4]+20;
- movex[4]=0;
- movey[4]=0;
-
- sprintf (menustring[5], "Enter registration code!");
- startx[5]=190;
- endx[5]=startx[5]+strlen(menustring[5])*10;
- starty[5]=120;
- endy[5]=starty[5]+20;
- movex[5]=0;
- movey[5]=0;
- }
-
- if(mainmenu==15){
- nummenuitems=2;
- char temp[255];
-
- sprintf (menustring[0], "Thank you for supporting Wolfire Software!");
- startx[0]=100;
- starty[0]=270;
- endx[0]=startx[0]+strlen(menustring[0])*10;
- endy[0]=starty[0]+20;
- movex[0]=0;
- movey[0]=0;
-
- sprintf (menustring[1], "Back");
- startx[1]=10;
- endx[1]=startx[1]+strlen(menustring[1])*10;
- starty[1]=10;
- endy[1]=starty[1]+20;
- movex[1]=0;
- movey[1]=0;