Final menu format for 1.10.

This commit is contained in:
mysticbbs 2012-07-24 16:30:01 -04:00
parent 3f217b6262
commit d806eec5cf
1 changed files with 28 additions and 13 deletions

View File

@ -43,21 +43,28 @@ Type
cRight : Byte; cRight : Byte;
End; End;
Function DeleteFile (FN : String) : Boolean; Procedure PurgeWildcard (WC: String);
Var Var
F : File; D : SearchRec;
Begin Begin
Assign (F, FN); FindFirst (WC, AnyFile, D);
{ SetFAttr (F, Archive);}
{$I-} Erase (F); {$I+} While DosError = 0 Do Begin
DeleteFile := (IoResult = 0); If D.Attr AND Directory <> 0 Then Continue;
FileErase (D.Name);
FindNext(D);
End;
FindClose(D);
End; End;
Function RenameFile (Old, New: String) : Boolean; Function RenameFile (Old, New: String) : Boolean;
Var Var
OldF : File; OldF : File;
Begin Begin
DeleteFile(New); FileErase(New);
Assign (OldF, Old); Assign (OldF, Old);
{$I-} ReName (OldF, New); {$I+} {$I-} ReName (OldF, New); {$I+}
@ -120,12 +127,12 @@ Begin
WriteLn ('Converting: ' + Dir.Name); WriteLn ('Converting: ' + Dir.Name);
If Not ReNameFile(Path + Dir.Name, Path + JustFileName(Dir.Name) + '.old') Then Begin If Not ReNameFile(Path + Dir.Name, Path + JustFileName(Dir.Name) + '.oldmnu') Then Begin
WriteLn('Unable to rename menu file: ' + Dir.Name); WriteLn('Unable to rename menu file: ' + Dir.Name);
Halt; Halt;
End; End;
Assign (OldF, Path + JustFileName(Dir.Name) + '.old'); Assign (OldF, Path + JustFileName(Dir.Name) + '.oldmnu');
Reset (OldF); Reset (OldF);
Assign (NewF, Path + Dir.Name); Assign (NewF, Path + Dir.Name);
@ -235,14 +242,20 @@ Begin
For Count := 1 to NewItems Do Begin For Count := 1 to NewItems Do Begin
NewItem[Count].ReDraw := 1; NewItem[Count].ReDraw := 1;
NewItem[Count].TimerType := 0;
FlagStr := strPadR(
strI2S(NewItem[Count].ReDraw) +
strI2S(NewItem[Count].TimerType) +
strI2S(NewItem[Count].ShowType)
, 20, '0');
WriteLn (NewF, NewItem[Count].Text); WriteLn (NewF, NewItem[Count].Text);
WriteLn (NewF, NewItem[Count].TextLo); WriteLn (NewF, NewItem[Count].TextLo);
WriteLn (NewF, NewItem[Count].TextHi); WriteLn (NewF, NewItem[Count].TextHi);
WriteLn (NewF, NewItem[Count].HotKey); WriteLn (NewF, NewItem[Count].HotKey);
WriteLn (NewF, NewItem[Count].Access); WriteLn (NewF, NewItem[Count].Access);
WriteLn (NewF, NewItem[Count].ReDraw); WriteLn (NewF, FlagStr);
WriteLn (NewF, NewItem[Count].ShowType);
WriteLn (NewF, NewItem[Count].Timer); WriteLn (NewF, NewItem[Count].Timer);
WriteLn (NewF, NewItem[Count].X); WriteLn (NewF, NewItem[Count].X);
WriteLn (NewF, NewItem[Count].Y); WriteLn (NewF, NewItem[Count].Y);
@ -279,11 +292,13 @@ Begin
End; End;
FindClose(Dir); FindClose(Dir);
PurgeWildcard('*.oldmnu');
End; End;
Begin Begin
WriteLn; WriteLn;
WriteLn ('Mystic BBS Menu File Converter for Mystic BBS v1.10'); WriteLn ('Mystic BBS Menu File Converter for Mystic BBS v1.10 A15');
WriteLn; WriteLn;
WriteLn ('THIS SHOULD ONLY BE EXECUTED ONCE IN YOUR MENUS DIRECTORY!'); WriteLn ('THIS SHOULD ONLY BE EXECUTED ONCE IN YOUR MENUS DIRECTORY!');
WriteLn; WriteLn;