Changeset 86 for trunk/Core.pas
- Timestamp:
- Jun 7, 2024, 12:47:11 PM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r85 r86 1 unit UCore; 2 3 {$mode delphi} 1 unit Core; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, Theme, PersistentForm, ApplicationInfo, Translator, 9 RegistryEx, UGame, ActnList, Forms, Controls, Dialogs;7 RegistryEx, ScaleDPI, Game, ActnList, Forms, Controls, Dialogs; 10 8 11 9 type … … 25 23 ApplicationInfo1: TApplicationInfo; 26 24 PersistentForm1: TPersistentForm; 25 ScaleDPI1: TScaleDPI; 27 26 ThemeManager1: TThemeManager; 28 27 Translator1: TTranslator; … … 61 60 62 61 uses 63 UFormMain, UFormSettings, UFormNew, UFormHelp, UFormComputer, FormAbout,64 UFormHistory;62 FormMain, FormSettings, FormNew, FormHelp, FormComputer, FormAbout, FormEx, 63 FormHistory; 65 64 66 65 resourcestring … … 69 68 SWinCaption = 'Win'; 70 69 SWinMessage = 'You reached %s and won! You can continue to play to get higher score.'; 70 71 procedure Translate; 72 begin 73 Game.Translate; 74 end; 71 75 72 76 { TCore } … … 90 94 Game.OnGameOver := GameOver; 91 95 LoadConfig; 96 97 TFormEx.ScaleDPI := ScaleDPI1; 98 TFormEx.Translator := Translator1; 99 TFormEx.ThemeManager := ThemeManager1; 100 TFormEx.PersistentForm := PersistentForm1; 92 101 end; 93 102 94 103 procedure TCore.ASettingsExecute(Sender: TObject); 104 var 105 FormSettings: TFormSettings; 95 106 begin 96 107 FormSettings := TFormSettings.Create(nil); 97 108 try 98 109 if FormSettings.ShowModal = mrOk then begin 99 FormMain. Redraw;100 FormMain. UpdateInterface;110 FormMain.FormMain.Redraw; 111 FormMain.FormMain.UpdateInterface; 101 112 UpdateInterface; 102 113 end; … … 125 136 126 137 procedure TCore.AComputerExecute(Sender: TObject); 138 var 139 FormComputer: TFormComputer; 127 140 begin 128 141 FormComputer := TFormComputer.Create(nil); … … 136 149 procedure TCore.AExitExecute(Sender: TObject); 137 150 begin 138 FormMain. Close;151 FormMain.FormMain.Close; 139 152 end; 140 153 141 154 procedure TCore.AHelpExecute(Sender: TObject); 155 var 156 FormHelp: TFormHelp; 142 157 begin 143 158 FormHelp := TFormHelp.Create(nil); … … 150 165 151 166 procedure TCore.AHistoryExecute(Sender: TObject); 167 var 168 FormHistory: TFormHistory; 152 169 begin 153 170 FormHistory := TFormHistory.Create(nil); … … 160 177 161 178 procedure TCore.ANewExecute(Sender: TObject); 179 var 180 FormNew: TFormNew; 162 181 begin 163 182 FormNew := TFormNew.Create(nil); … … 168 187 Game.New; 169 188 UpdateInterface; 170 FormMain. UpdateInterface;189 FormMain.FormMain.UpdateInterface; 171 190 end; 172 191 finally … … 183 202 procedure TCore.Translator1Translate(Sender: TObject); 184 203 begin 185 UGame.Translate;204 Translate; 186 205 end; 187 206 … … 193 212 procedure TCore.GamePaint(Sender: TObject); 194 213 begin 195 if Assigned(FormMain ) thenFormMain.Redraw;214 if Assigned(FormMain.FormMain) then FormMain.FormMain.Redraw; 196 215 end; 197 216 198 217 procedure TCore.GameWin(Sender: TObject); 199 218 begin 200 TThread.Synchronize(FormMain. MoveThread, GameWinSync);219 TThread.Synchronize(FormMain.FormMain.MoveThread, GameWinSync); 201 220 end; 202 221 … … 208 227 procedure TCore.GameOver(Sender: TObject); 209 228 begin 210 TThread.Synchronize(FormMain. MoveThread, GameOverSync);229 TThread.Synchronize(FormMain.FormMain.MoveThread, GameOverSync); 211 230 end; 212 231
Note:
See TracChangeset
for help on using the changeset viewer.