- Timestamp:
- May 17, 2024, 4:52:24 PM (7 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Engine.pas
r80 r83 207 207 FBitmap: TBitmap; 208 208 FBitmapLock: TCriticalSection; 209 FOnClose: TNotifyEvent; 209 210 FOnGameEnd: TNotifyEvent; 210 211 FRedrawPending: Boolean; … … 232 233 procedure DrawMap; 233 234 procedure SetState(AValue: TGameState); 235 procedure ShowMenuItem(Key, Text: string; X, Y: Integer; Canvas: TCanvas); 234 236 function TextOutWordWrap(Canvas: TCanvas; X, Y: Integer; Text: string; Width: Integer): Integer; 235 237 public … … 264 266 property State: TGameState read FState write SetState; 265 267 property OnGameEnd: TNotifyEvent read FOnGameEnd write FOnGameEnd; 268 property OnClose: TNotifyEvent read FOnClose write FOnClose; 266 269 end; 267 270 … … 1611 1614 end; 1612 1615 1616 procedure TEngine.ShowMenuItem(Key, Text: string; X, Y: Integer; Canvas: TCanvas); 1617 begin 1618 Canvas.TextOut(X, Y, '<' + Key + '>'); 1619 Canvas.TextOut(X + 140, Y, Text); 1620 end; 1621 1613 1622 procedure TEngine.DrawMenu; 1614 1623 var … … 1644 1653 Font.Color := clPurple; 1645 1654 Font.Size := 20; 1646 Text := '<F1> ' + SStartGame; 1647 TextOut((MenuWidth - TextWidth(Text)) div 2, Bitmap.Height div 10 * 4, Text); 1648 Text := '<F2> ' + SInstructions; 1649 TextOut((MenuWidth - TextWidth(Text)) div 2, Bitmap.Height div 10 * 4 + 40, Text); 1650 Text := '<F3> ' + SInformation; 1651 TextOut((MenuWidth - TextWidth(Text)) div 2, Bitmap.Height div 10 * 4 + 80, Text); 1652 Text := '<Alt+F4> ' + SExit; 1653 TextOut((MenuWidth - TextWidth(Text)) div 2, Bitmap.Height div 10 * 4 + 120, Text); 1655 1656 ShowMenuItem('F1', SStartGame, MenuWidth div 2 - 180, Bitmap.Height div 10 * 4, Bitmap.Canvas); 1657 ShowMenuItem('F2', SInstructions, MenuWidth div 2 - 180, Bitmap.Height div 10 * 4 + 40, Bitmap.Canvas); 1658 ShowMenuItem('F3', SInformation, MenuWidth div 2 - 180, Bitmap.Height div 10 * 4 + 80, Bitmap.Canvas); 1659 ShowMenuItem('F10', SExit, MenuWidth div 2 - 180, Bitmap.Height div 10 * 4 + 120, Bitmap.Canvas); 1654 1660 1655 1661 Font.Color := clDarkGreen; … … 1947 1953 KeyF3 = 114; 1948 1954 KeyF4 = 115; 1955 KeyF10 = 121; 1949 1956 KeyEsc = 27; 1950 1957 var … … 1963 1970 if Key = KeyF3 then begin 1964 1971 State := gsInformation; 1972 end else 1973 if Key = KeyF10 then begin 1974 if Assigned(FOnClose) then FOnClose(Self); 1965 1975 end; 1966 1976 end else -
trunk/Forms/FormMain.lfm
r74 r83 5 5 Width = 770 6 6 Caption = 'Tunneler' 7 ClientHeight = 5837 ClientHeight = 617 8 8 ClientWidth = 770 9 9 DesignTimePPI = 144 … … 16 16 OnKeyUp = FormKeyUp 17 17 OnShow = FormShow 18 LCLVersion = ' 2.2.4.0'18 LCLVersion = '3.2.0.0' 19 19 object StatusBar1: TStatusBar 20 20 Left = 0 21 21 Height = 28 22 Top = 5 5522 Top = 589 23 23 Width = 770 24 Panels = < 24 Panels = < 25 25 item 26 26 Width = 74 27 end 27 end 28 28 item 29 29 Width = 74 30 end 30 end 31 31 item 32 32 Width = 74 33 end 33 end 34 34 item 35 35 Width = 74 36 end 36 end 37 37 item 38 38 Width = 74 39 end 39 end 40 40 item 41 41 Width = 74 42 end 42 end 43 43 item 44 44 Width = 74 … … 50 50 object Image1: TImage 51 51 Left = 0 52 Height = 5 5552 Height = 589 53 53 Top = 0 54 54 Width = 770 … … 109 109 Caption = 'Exit' 110 110 OnExecute = AExitExecute 111 ShortCut = 32883111 ShortCut = 121 112 112 end 113 113 object ANewGame: TAction -
trunk/Forms/FormMain.pas
r74 r83 183 183 DoubleBuffered := False; 184 184 Engine := TEngine.Create(nil); 185 Engine.OnClose := AExitExecute; 185 186 LoadConfig; 186 187 Engine.InitPlayerPool;
Note:
See TracChangeset
for help on using the changeset viewer.