Changeset 34 for trunk/Forms/UMainForm.pas
- Timestamp:
- Nov 25, 2017, 12:27:33 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 3 3 backup 4 4 tunneler.exe 5 tunneler.dbg 6 tunneler.lps 5 7 heaptrclog.trc 6 tunneler.lps 8 Components/Common/Languages/*.mo 9 Components/CoolTranslator/Demo/lib
-
- Property svn:ignore
-
trunk/Forms/UMainForm.pas
r33 r34 8 8 Registry, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 9 ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils, GraphType, 10 UPersistentForm, UApplicationInfo, UCoolTranslator, LCLType ;10 UPersistentForm, UApplicationInfo, UCoolTranslator, LCLType, URegistry; 11 11 12 12 type … … 53 53 procedure TimerDrawTimer(Sender: TObject); 54 54 procedure TimerEngineTickTimer(Sender: TObject); 55 procedure EraseBackground(DC: HDC); override;56 55 private 57 56 OriginalBounds: TRect; … … 64 63 PersistentForm: TPersistentForm; 65 64 Engine: TEngine; 66 end; 65 procedure EraseBackground(DC: HDC); override; 66 end; 67 67 68 68 var … … 89 89 StartTime := NowPrecise; 90 90 //Engine.Draw; 91 DrawDuration := NowPrecise - StartTime;92 91 try 93 92 Engine.Lock.Acquire; … … 95 94 // IntToStr(TPlayer(Engine.Players[0]).Position.Y) + ' ' + 96 95 // IntToStr(TPlayer(Engine.Players[0]).Direction); 97 StatusBar1.Panels[2].Text := FloatToStr(RoundTo( DrawDuration / OneMillisecond, -2));96 StatusBar1.Panels[2].Text := FloatToStr(RoundTo(Engine.DrawDuration / OneMillisecond, -2)); 98 97 StatusBar1.Panels[3].Text := Format(SRound, [IntToStr(Engine.CurrentRound), 99 98 IntToStr(Engine.MaxRound)]); … … 118 117 procedure TMainForm.FormCreate(Sender: TObject); 119 118 begin 120 PersistentForm := TPersistentForm.Create ;121 PersistentForm.Registry Key := ApplicationInfo1.RegistryKey;122 PersistentForm.RegistryRootKey := HKEY(ApplicationInfo1.RegistryRoot);119 PersistentForm := TPersistentForm.Create(nil); 120 PersistentForm.RegistryContext := RegContext(HKEY(ApplicationInfo1.RegistryRoot), 121 ApplicationInfo1.RegistryKey); 123 122 124 123 Application.OnDeactivate := FormDeactivate; … … 130 129 Engine.Active := True; 131 130 Image1Resize(Self); 131 132 Image1.ControlStyle := Image1.ControlStyle + [csOpaque]; 132 133 end; 133 134 … … 172 173 procedure TMainForm.ANewGameExecute(Sender: TObject); 173 174 begin 174 if NewGameForm.ShowModal = mrOk then Engine.NewGame; 175 NewGameForm.LoadData(Engine); 176 if NewGameForm.ShowModal = mrOk then begin 177 NewGameForm.SaveData(Engine); 178 Engine.NewGame; 179 end; 175 180 end; 176 181 … … 212 217 PersistentForm.Load(Self); 213 218 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('cs'); 214 DebugForm.Show;215 219 end; 216 220
Note:
See TracChangeset
for help on using the changeset viewer.