Changeset 30 for trunk/UFormMain.pas


Ignore:
Timestamp:
Mar 4, 2014, 12:18:22 AM (10 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFormMain.pas

    r28 r30  
    3434    ToolButton4: TToolButton;
    3535    procedure FormActivate(Sender: TObject);
     36    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3637    procedure FormCreate(Sender: TObject);
    3738    procedure FormDestroy(Sender: TObject);
     
    132133end;
    133134
     135procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     136begin
     137  Core.Game.Running := False;
     138end;
     139
    134140procedure TFormMain.FormDestroy(Sender: TObject);
    135141begin
     
    176182    end;
    177183    Cell := nil;
    178     OldCell := Core.Game.CurrentPlayer.FocusedCell;
     184    OldCell := Core.Game.CurrentPlayer.View.FocusedCell;
    179185    with Core.Game do
    180186      Cell := Map.PosToCell(CurrentPlayer.View.CanvasToCellPos(Point(X, Y)), CurrentPlayer.View );
    181187    if Assigned(Cell) then begin
    182       Core.Game.CurrentPlayer.FocusedCell := Cell;
     188      Core.Game.CurrentPlayer.View.FocusedCell := Cell;
    183189      StatusBar1.Panels[0].Text := '[' + IntToStr(Cell.Pos.X) + ', ' + IntToStr(Cell.Pos.Y) + ']';
    184190    end else begin
    185       Core.Game.CurrentPlayer.FocusedCell := nil;
     191      Core.Game.CurrentPlayer.View.FocusedCell := nil;
    186192      StatusBar1.Panels[0].Text := '';
    187193    end;
     
    195201  if (Abs(StartMousePoint.X - X) < 5) and (Abs(StartMousePoint.Y - Y) < 5) then begin
    196202    if Core.Game.Running and (Core.Game.CurrentPlayer.Mode = pmHuman) then begin
    197       Core.Game.CurrentPlayer.SelectCell(Point(X, Y));
     203      Core.Game.CurrentPlayer.View.SelectCell(Point(X, Y), Core.Game.CurrentPlayer);
    198204      Redraw;
    199205    end;
Note: See TracChangeset for help on using the changeset viewer.