Changeset 79 for trunk/Forms/UFormMain.pas
- Timestamp:
- Feb 11, 2021, 11:20:18 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r72 r79 28 28 MenuItem3: TMenuItem; 29 29 MenuItem4: TMenuItem; 30 MenuItem5: TMenuItem; 31 MenuItemFullScreen: TMenuItem; 30 32 MenuItemMovesHistory: TMenuItem; 31 33 MenuItemTools: TMenuItem; … … 47 49 procedure FormPaint(Sender: TObject); 48 50 procedure FormShow(Sender: TObject); 51 procedure MenuItemFullScreenClick(Sender: TObject); 49 52 procedure TimerDrawTimer(Sender: TObject); 50 53 procedure EraseBackground(DC: HDC); override; … … 56 59 MoveBuffer: array of TMoveDirection; 57 60 MoveBufferLock: TCriticalSection; 61 FullScreen: Boolean; 58 62 procedure AddToMoveBuffer(Direction: TMoveDirection); 59 63 procedure ProcessMoveBuffer; 64 procedure ToggleFullscreen; 60 65 public 61 66 MoveThread: TMoveThread; … … 87 92 88 93 procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 94 const 95 KeyLeft = 37; 96 KeyUp = 38; 97 KeyRight = 39; 98 KeyDown = 40; 89 99 begin 90 100 if Core.Game.Running then begin 91 101 case Key of 92 37: AddToMoveBuffer(drLeft);93 38: AddToMoveBuffer(drUp);94 39: AddToMoveBuffer(drRight);95 40: AddToMoveBuffer(drDown);102 KeyLeft: AddToMoveBuffer(drLeft); 103 KeyUp: AddToMoveBuffer(drUp); 104 KeyRight: AddToMoveBuffer(drRight); 105 KeyDown: AddToMoveBuffer(drDown); 96 106 end; 97 107 //ProcessMoveBuffer; … … 184 194 Core.PersistentForm1.RegistryContext := Core.ApplicationInfo1.GetRegistryContext; 185 195 Core.PersistentForm1.Load(Self); 196 FullScreen := Core.PersistentForm1.FormFullScreen; 186 197 Core.ThemeManager1.UseTheme(Self); 187 198 UpdateInterface; … … 189 200 InitialTileCount then 190 201 Core.Game.New; 202 end; 203 204 procedure TFormMain.MenuItemFullScreenClick(Sender: TObject); 205 begin 206 ToggleFullscreen; 191 207 end; 192 208 … … 235 251 end; 236 252 253 procedure TFormMain.ToggleFullscreen; 254 begin 255 FullScreen := not FullScreen; 256 Core.PersistentForm1.SetFullScreen(FormMain.FullScreen); 257 UpdateInterface; 258 end; 259 237 260 procedure TFormMain.Redraw; 238 261 begin … … 245 268 ToolsVisible: Boolean; 246 269 begin 270 MenuItemFullScreen.Checked := FullScreen; 247 271 MenuItemMovesHistory.Visible := Core.Game.RecordHistory; 248 272 ToolsVisible := False;
Note:
See TracChangeset
for help on using the changeset viewer.