Program USINIT;

{This module will display the title panel and determine if instructions
are to be displayed.  Campaign will be selected. Module to select
navy will be chained.

Display title
If display instructions
.   Do until last page shown
.   .   Page instructions from external file
.   .   Display page
.   .   Wait for entry or time out
.   End
End
Display campaign selections
Select campaign
Chain NAVY Module}

{$I common.pas}
{$I putpic.pas}
{$I border.pas}

Procedure Rtn2cont;
Begin
      gotoxy(26,21);
      FastWrite('PRESS ANY KEY TO CONTINUE',15,0,1);
      uncursor;
      read(kbd,c);
end;

Begin
Clrscr;
Border(34,10,16,8,1,7,0);
border(36,11,11,6,1,7,0);
window(39,12,44,15);
clrScr;
NormVideo;
writeln('W A R');
writeln(' O N ');
writeln('T H E');
write('S E A');
Window(1,1,80,25);
gotoxy(27,22);                                          {Display instructions}
FastWrite('DO YOU WANT INSTRUCTIONS(Y/N)? ',15,0,1);
uncursor;
Read(kbd,c);
If (c='Y') or (c='y') then
   begin
      Clrscr;
      Border(1,1,79,23,1,7,0);
      window(3,2,78,22);                                {Set instr window}
      Assign(Source,'us.ins');                          {Set to read instr data}
      Reset(Source);
      i:=1;                                       {Read instr line and disp}
      repeat                                      {until .page found}
         Gotoxy(2,i);
         i:=i+1;
         Readln(Source,Line);
         if (line<>'.page') then
            FastWrite(Line,15,0,2)
         else
            begin
               i:=1;
               Rtn2Cont;                      {Display return to continue}
               ClrScr;
            end;
      until EOF(Source);
      Rtn2Cont;                               {Display return to continue}
      ClrScr;
   end;
Window(1,1,80,24);
Clrscr;
Border(1,1,79,23,1,7,0);                      {Select campaign to fight}
Gotoxy(30,8);
Fastwrite('CAMPAIGNS AVAILABLE',7,0,1);
Gotoxy(25,10);
Fastwrite('1. ATLANTIC (English vs. German)',7,0,1);
Gotoxy(25,11);
FastWrite('2. ATLANTIC (German vs. English)',7,0,1);
Gotoxy(25,12);
Fastwrite('3. PACIFIC  (US vs. Japan)',7,0,1);
Gotoxy(25,13);
Fastwrite('4. BATTLEWAGONS (Hypothetical)',7,0,1);
Gotoxy(25,14);
Fastwrite('5. SOLOMONS  (Japan vs. US)',7,0,1);
Gotoxy(25,15);
Fastwrite('6. SPECIAL BATTLES (English vs. Germany)',7,0,1);
Gotoxy(25,16);
Fastwrite('7. HYPOTHETICAL (USA vs. Germany)',7,0,1);
Gotoxy(25,22);
Fastwrite('Enter campaign number to continue',7,0,1);
uncursor;
read(kbd,c);
Name:='atlantic';                          {Default to atlantic campaign.}
case c of
  '2' : Name:='atlanti2';
  '3' : Name:='pacific';
  '4' : Name:='pacific2';
  '5' : Name:='solomons';
  '6' : Name:='specbat';
  '7' : Name:='hypoth';
end; {case}
quitsw:=0;
Assign(nextprog,'navy.chn');
Chain(nextprog);
end.