Ignore:
Timestamp:
Nov 25, 2017, 12:27:33 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Improved New game window.
  • Modified: Used newer version of Common and CoolTranslator packages.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        33backup
        44tunneler.exe
         5tunneler.dbg
         6tunneler.lps
        57heaptrclog.trc
        6 tunneler.lps
         8Components/Common/Languages/*.mo
         9Components/CoolTranslator/Demo/lib
  • trunk/Forms/UMainForm.pas

    r33 r34  
    88  Registry, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils, GraphType,
    10   UPersistentForm, UApplicationInfo, UCoolTranslator, LCLType;
     10  UPersistentForm, UApplicationInfo, UCoolTranslator, LCLType, URegistry;
    1111
    1212type
     
    5353    procedure TimerDrawTimer(Sender: TObject);
    5454    procedure TimerEngineTickTimer(Sender: TObject);
    55     procedure EraseBackground(DC: HDC); override;
    5655  private
    5756    OriginalBounds: TRect;
     
    6463    PersistentForm: TPersistentForm;
    6564    Engine: TEngine;
    66   end;
     65    procedure EraseBackground(DC: HDC); override;
     66  end;
    6767
    6868var
     
    8989    StartTime := NowPrecise;
    9090    //Engine.Draw;
    91     DrawDuration := NowPrecise - StartTime;
    9291    try
    9392      Engine.Lock.Acquire;
     
    9594      //  IntToStr(TPlayer(Engine.Players[0]).Position.Y) + ' ' +
    9695      //  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));
    9897      StatusBar1.Panels[3].Text := Format(SRound, [IntToStr(Engine.CurrentRound),
    9998        IntToStr(Engine.MaxRound)]);
     
    118117procedure TMainForm.FormCreate(Sender: TObject);
    119118begin
    120   PersistentForm := TPersistentForm.Create;
    121   PersistentForm.RegistryKey := ApplicationInfo1.RegistryKey;
    122   PersistentForm.RegistryRootKey := HKEY(ApplicationInfo1.RegistryRoot);
     119  PersistentForm := TPersistentForm.Create(nil);
     120  PersistentForm.RegistryContext := RegContext(HKEY(ApplicationInfo1.RegistryRoot),
     121    ApplicationInfo1.RegistryKey);
    123122
    124123  Application.OnDeactivate := FormDeactivate;
     
    130129  Engine.Active := True;
    131130  Image1Resize(Self);
     131
     132  Image1.ControlStyle := Image1.ControlStyle + [csOpaque];
    132133end;
    133134
     
    172173procedure TMainForm.ANewGameExecute(Sender: TObject);
    173174begin
    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;
    175180end;
    176181
     
    212217  PersistentForm.Load(Self);
    213218  CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('cs');
    214   DebugForm.Show;
    215219end;
    216220
Note: See TracChangeset for help on using the changeset viewer.