Bugfix update for new menu engine

This commit is contained in:
mysticbbs 2012-08-04 19:18:10 -04:00
parent 7190add8d3
commit dd4b943c14
1 changed files with 56 additions and 65 deletions

View File

@ -457,7 +457,7 @@ Begin
For Count := 1 to Data.NumItems Do Begin For Count := 1 to Data.NumItems Do Begin
If (Data.Item[Count]^.ShowType = 2) or If (Data.Item[Count]^.ShowType = 2) or
(Data.Item[Count]^.Text = '') or ((Data.Item[Count]^.Text = '') and (Data.Item[Count]^.HotKey <> 'LINEFEED')) or
(Data.Item[Count]^.HotKey = 'EVERY') or (Data.Item[Count]^.HotKey = 'EVERY') or
(Data.Item[Count]^.HotKey = 'AFTER') or (Data.Item[Count]^.HotKey = 'AFTER') or
(Data.Item[Count]^.HotKey = 'FIRSTCMD') or (Data.Item[Count]^.HotKey = 'FIRSTCMD') or
@ -467,7 +467,7 @@ Begin
If Data.Item[Count]^.HotKey = 'LINEFEED' Then Begin If Data.Item[Count]^.HotKey = 'LINEFEED' Then Begin
If Listed MOD Data.Info.DispCols <> 0 Then Session.io.OutRawLn(''); If Listed MOD Data.Info.DispCols <> 0 Then Session.io.OutRawLn('');
Session.io.OutFull(Data.Item[Count]^.Text); Session.io.OutFullLn(Data.Item[Count]^.Text);
While Listed Mod Data.Info.DispCols <> 0 Do Inc(Listed); While Listed Mod Data.Info.DispCols <> 0 Do Inc(Listed);
End Else Begin End Else Begin
@ -753,6 +753,23 @@ Var
Ch : Char; Ch : Char;
Found : Boolean; Found : Boolean;
ValidKey : Boolean; ValidKey : Boolean;
Function ExecuteGridCommand (NewCmd, ExecType: LongInt) : LongInt;
Begin
If ValidLightBar(NewCmd) Then Begin
Result := ExecuteCommandList(CursorPos, ExecType);
If Result <> 2 Then Begin
DrawBar (CursorPos, False);
CursorPos := NewCmd;
DrawBar (CursorPos, True);
Session.io.BufFlush;
End;
End Else
Result := ExecuteCommandList(CursorPos, ExecType);
End;
Begin Begin
CursorPos := 0; CursorPos := 0;
@ -790,7 +807,9 @@ Begin
For Count := 1 to Data.NumItems Do For Count := 1 to Data.NumItems Do
If ValidLightBar(Count) Then Begin If ValidLightBar(Count) Then Begin
If CursorPos = 0 Then CursorPos := Count; If CursorPos = 0 Then CursorPos := Count;
DrawBar (Count, False); DrawBar (Count, False);
End; End;
@ -814,100 +833,71 @@ Begin
If TBBSCore(Owner).ShutDown Then Exit; If TBBSCore(Owner).ShutDown Then Exit;
If TBBSCore(Owner).io.IsArrow Then Begin If TBBSCore(Owner).io.IsArrow Then Begin
Case Ch of Case Data.Info.MenuType of
1 : Case Ch of
#72, #72,
#75 : Case Data.Info.MenuType of #75 : Begin
1 : Begin
TempPos := CursorPos; TempPos := CursorPos;
While TempPos > 1 Do Begin While TempPos > 1 Do Begin
Dec (TempPos); Dec (TempPos);
If ValidLightBar(TempPos) Then Begin If ValidLightBar(TempPos) Then Begin
DrawBar (CursorPos, False); DrawBar (CursorPos, False);
DrawBar (TempPos, True); DrawBar (TempPos, True);
CursorPos := TempPos; CursorPos := TempPos;
Break; Break;
End; End;
End; End;
End; End;
2 : Case Ch of
#72 : If ValidLightBar(Data.Item[CursorPos]^.JumpUp) Then Begin
ExecuteCommandList(CursorPos, 1);
DrawBar (CursorPos, False);
CursorPos := Data.Item[CursorPos]^.JumpUp;
DrawBar (CursorPos, True);
End;
#75 : If ValidLightBar(Data.Item[CursorPos]^.JumpLeft) Then Begin
ExecuteCommandList(CursorPos, 3);
DrawBar (CursorPos, False);
CursorPos := Data.Item[CursorPos]^.JumpLeft;
DrawBar (CursorPos, True);
End;
End;
End;
#77, #77,
#80 : Case Data.Info.MenuType of #80 : Begin
1 : Begin
TempPos := CursorPos; TempPos := CursorPos;
While TempPos < Data.NumItems Do Begin While TempPos < Data.NumItems Do Begin
Inc (TempPos); Inc (TempPos);
If ValidLightBar(TempPos) Then Begin If ValidLightBar(TempPos) Then Begin
DrawBar (CursorPos, False); DrawBar (CursorPos, False);
DrawBar (TempPos, True); DrawBar (TempPos, True);
CursorPos := TempPos; CursorPos := TempPos;
Break; Break;
End; End;
End; End;
End; End;
2 : Case Ch of
#77 : If ValidLightBar(Data.Item[CursorPos]^.JumpRight) Then Begin
ExecuteCommandList (CursorPos, 4);
DrawBar (CursorPos, False);
CursorPos := Data.Item[CursorPos]^.JumpRight;
DrawBar (CursorPos, True);
End; End;
#80 : If ValidLightBar(Data.Item[CursorPos]^.JumpDown) Then Begin 2 : Begin
ExecuteCommandList (CursorPos, 2); Case Ch of
DrawBar (CursorPos, False); #71 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpHome, 9);
CursorPos := Data.Item[CursorPos]^.JumpDown; #72 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpUp, 1);
DrawBar (CursorPos, True); #73 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpPgUp, 7);
#75 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpLeft, 3);
#77 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpRight, 4);
#79 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpEnd, 10);
#80 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpDown, 2);
#81 : TempPos := ExecuteGridCommand(Data.Item[CursorPos]^.JumpPgDn, 8);
End; End;
End;
End; Case TempPos of
#71 : If Data.Info.MenuType = 2 Then
Case ExecuteCommandList(CursorPos, 9) of
0 : ; 0 : ;
1 : Break; 1 : Break;
2 : Exit; 2 : Exit;
End; End;
#73 : If Data.Info.MenuType = 2 Then
Case ExecuteCommandList(CursorPos, 7) of
0 : ;
1 : Break;
2 : Exit;
End;
#79 : If Data.Info.MenuType = 2 Then
Case ExecuteCommandList(CursorPos, 10) of
0 : ;
1 : Break;
2 : Exit;
End;
#81 : If Data.Info.MenuType = 2 Then
Case ExecuteCommandList(CursorPos, 8) of
0 : ;
1 : Break;
2 : Exit;
End; End;
End; End;
End Else End Else
Case Ch of Case Ch of
#08 : If Length(TempStr) > 0 Then Begin #08 : If Length(TempStr) > 0 Then Begin
Dec (TempStr[0]); Dec (TempStr[0]);
AddChar(#8); AddChar(#8);
End; End;
#09 : If Data.Info.MenuType = 2 Then #09 : If Data.Info.MenuType = 2 Then
Case ExecuteCommandList(CursorPos, 5) of Case ExecuteGridCommand(Data.Item[CursorPos]^.JumpTab, 5) of
0 : ; 0 : ;
1 : Break; 1 : Break;
2 : Exit; 2 : Exit;
@ -924,12 +914,13 @@ Begin
If Found Then Exit Else Break; If Found Then Exit Else Break;
End; End;
#27 : If Data.Info.MenuType = 2 Then #27 : If Data.Info.MenuType = 2 Then begin
Case ExecuteCommandList(CursorPos, 6) of Case ExecuteGridCommand(Data.Item[CursorPos]^.JumpEscape, 6) of
0 : ; 0 : ;
1 : Break; 1 : Break;
2 : Exit; 2 : Exit;
End; End;
end;
Else Else
If Length(TempStr) < mysMaxMenuInput Then Begin If Length(TempStr) < mysMaxMenuInput Then Begin
Found := False; Found := False;