ReDraw and GO to new menus now work with TIMER functions
This commit is contained in:
parent
82a8f5f185
commit
5251c6249a
|
@ -24,6 +24,7 @@ Type
|
||||||
UseLongKey : Boolean;
|
UseLongKey : Boolean;
|
||||||
UseTimer : Boolean;
|
UseTimer : Boolean;
|
||||||
TimerCount : LongInt;
|
TimerCount : LongInt;
|
||||||
|
TimerReload : Boolean;
|
||||||
ViewOnly : Boolean;
|
ViewOnly : Boolean;
|
||||||
|
|
||||||
Constructor Create (O: Pointer);
|
Constructor Create (O: Pointer);
|
||||||
|
@ -34,7 +35,7 @@ Type
|
||||||
Function LoadMenu (Forced: Boolean) : Boolean;
|
Function LoadMenu (Forced: Boolean) : Boolean;
|
||||||
Procedure ExecuteMenu (Load, Forced, View, Action: Boolean);
|
Procedure ExecuteMenu (Load, Forced, View, Action: Boolean);
|
||||||
Function ExecuteCommandList (Num, JumpID: LongInt) : Byte;
|
Function ExecuteCommandList (Num, JumpID: LongInt) : Byte;
|
||||||
Function ExecuteByHotkey (Key: String; Interval: LongInt) : Boolean;
|
Function ExecuteByHotkey (Key: String; Interval: LongInt) : Byte;
|
||||||
Function ExecuteCommand (Cmd, CmdData: String) : Boolean;
|
Function ExecuteCommand (Cmd, CmdData: String) : Boolean;
|
||||||
Function ShowMenu : Boolean;
|
Function ShowMenu : Boolean;
|
||||||
Procedure GenerateMenu;
|
Procedure GenerateMenu;
|
||||||
|
@ -367,25 +368,26 @@ Begin
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function TMenuEngine.ExecuteByHotkey (Key: String; Interval: LongInt) : Boolean;
|
Function TMenuEngine.ExecuteByHotkey (Key: String; Interval: LongInt) : Byte;
|
||||||
|
// 0 = no commands ran, 1 = commands ran, 2 = load new menu
|
||||||
Var
|
Var
|
||||||
Count : LongInt;
|
Count : LongInt;
|
||||||
Begin
|
Begin
|
||||||
Result := False;
|
Result := 0;
|
||||||
Key := strUpper(Key);
|
Key := strUpper(Key);
|
||||||
|
|
||||||
For Count := 1 to Data.NumItems Do Begin
|
For Count := 1 to Data.NumItems Do Begin
|
||||||
|
|
||||||
If Data.Item[Count] = Nil Then Begin
|
If Data.Item[Count] = Nil Then Begin
|
||||||
Result := True;
|
Result := 2;
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If Data.Item[Count]^.HotKey = Key Then
|
If Data.Item[Count]^.HotKey = Key Then
|
||||||
If (Key <> 'TIMER') or ((Key = 'TIMER') And (Interval MOD Data.Item[Count]^.Timer = 0)) Then
|
If (Key <> 'TIMER') or ((Key = 'TIMER') And (Interval MOD Data.Item[Count]^.Timer = 0)) Then Begin
|
||||||
If ExecuteCommandList(Count, -1) = 2 Then Begin
|
Result := ExecuteCommandList(Count, -1);
|
||||||
Result := True;
|
|
||||||
Exit;
|
If Result = 2 Then Exit;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -453,7 +455,7 @@ Begin
|
||||||
TBBSCore(Owner).io.BufFlush;
|
TBBSCore(Owner).io.BufFlush;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If ExecuteByHotKey('AFTER', 0) Then Exit;
|
If ExecuteByHotKey('AFTER', 0) = 2 Then Exit;
|
||||||
|
|
||||||
If Data.Info.Footer <> '' Then
|
If Data.Info.Footer <> '' Then
|
||||||
TBBSCore(Owner).io.OutFull(Data.Info.Footer);
|
TBBSCore(Owner).io.OutFull(Data.Info.Footer);
|
||||||
|
@ -498,7 +500,7 @@ Var
|
||||||
Begin
|
Begin
|
||||||
While Not TBBSCore(Owner).ShutDown Do Begin
|
While Not TBBSCore(Owner).ShutDown Do Begin
|
||||||
If Not ViewOnly Then
|
If Not ViewOnly Then
|
||||||
If ExecuteByHotKey('EVERY', 0) Then Exit;
|
If ExecuteByHotKey('EVERY', 0) = 2 Then Exit;
|
||||||
|
|
||||||
If ReDraw Then GenerateMenu;
|
If ReDraw Then GenerateMenu;
|
||||||
|
|
||||||
|
@ -517,6 +519,11 @@ Begin
|
||||||
|
|
||||||
If TBBSCore(Owner).ShutDown Then Exit;
|
If TBBSCore(Owner).ShutDown Then Exit;
|
||||||
|
|
||||||
|
If UseTimer And (Ch = #02) Then Begin
|
||||||
|
If TimerReload Then Exit;
|
||||||
|
If ReDraw Then Break;
|
||||||
|
End;
|
||||||
|
|
||||||
Case Ch of
|
Case Ch of
|
||||||
#08 : If Length(Temp) > 0 Then Begin
|
#08 : If Length(Temp) > 0 Then Begin
|
||||||
Dec (Temp[0]);
|
Dec (Temp[0]);
|
||||||
|
@ -568,7 +575,7 @@ Begin
|
||||||
If ViewOnly Then Exit;
|
If ViewOnly Then Exit;
|
||||||
|
|
||||||
If Not TBBSCore(Owner).ShutDown Then
|
If Not TBBSCore(Owner).ShutDown Then
|
||||||
If ExecuteByHotKey(Temp, 0) Then
|
If ExecuteByHotKey(Temp, 0) = 2 Then
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -708,6 +715,11 @@ Begin
|
||||||
While Not TBBSCore(Owner).ShutDown Do Begin
|
While Not TBBSCore(Owner).ShutDown Do Begin
|
||||||
Ch := Session.io.GetKey;
|
Ch := Session.io.GetKey;
|
||||||
|
|
||||||
|
If UseTimer And (Ch = #02) Then Begin
|
||||||
|
If TimerReload Then Exit;
|
||||||
|
If ReDraw Then Break;
|
||||||
|
End;
|
||||||
|
|
||||||
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
|
||||||
|
@ -895,11 +907,16 @@ Procedure TMenuEngine.ExecuteMenu (Load, Forced, View, Action: Boolean);
|
||||||
|
|
||||||
Function TimerController (Forced: Boolean) : Boolean;
|
Function TimerController (Forced: Boolean) : Boolean;
|
||||||
Begin
|
Begin
|
||||||
Result := False;
|
|
||||||
|
|
||||||
Inc (TimerCount);
|
Inc (TimerCount);
|
||||||
|
|
||||||
ExecuteByHotkey('TIMER', TimerCount);
|
Case ExecuteByHotkey('TIMER', TimerCount) of
|
||||||
|
0 : Result := False;
|
||||||
|
1 : Result := True;
|
||||||
|
2 : Begin
|
||||||
|
TimerReload := True;
|
||||||
|
Result := True;
|
||||||
|
End;
|
||||||
|
End;
|
||||||
|
|
||||||
If TimerCount = 100000 Then TimerCount := 0;
|
If TimerCount = 100000 Then TimerCount := 0;
|
||||||
End;
|
End;
|
||||||
|
@ -950,6 +967,7 @@ Begin
|
||||||
ReDraw := True;
|
ReDraw := True;
|
||||||
UseLongKey := False;
|
UseLongKey := False;
|
||||||
TimerCount := 0;
|
TimerCount := 0;
|
||||||
|
TimerReload := False;
|
||||||
|
|
||||||
For Count := 1 to Data.NumItems Do Begin
|
For Count := 1 to Data.NumItems Do Begin
|
||||||
If (Data.Item[Count]^.HotKey = 'EVERY') or
|
If (Data.Item[Count]^.HotKey = 'EVERY') or
|
||||||
|
|
Loading…
Reference in New Issue