Changeset 86


Ignore:
Timestamp:
Nov 5, 2014, 11:02:00 PM (10 years ago)
Author:
chronos
Message:
  • Modified: If Ctrl key is released then deselect currently selected player cell.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r79 r86  
    1212  OnCreate = FormCreate
    1313  OnDestroy = FormDestroy
     14  OnKeyUp = FormKeyUp
    1415  OnShow = FormShow
    1516  LCLVersion = '1.3'
  • trunk/Forms/UFormMain.pas

    r85 r86  
    7575    procedure FormCreate(Sender: TObject);
    7676    procedure FormDestroy(Sender: TObject);
     77    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    7778    procedure FormShow(Sender: TObject);
    7879    procedure MenuItem19Click(Sender: TObject);
     
    305306end;
    306307
     308procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState
     309  );
     310begin
     311  if (Key = 27) or (Key = 17) then
     312  if Assigned(Core.Game.CurrentPlayer) then begin
     313    Core.Game.CurrentPlayer.View.SelectedCell := nil;
     314    Redraw;
     315  end;
     316end;
     317
    307318procedure TFormMain.FormShow(Sender: TObject);
    308319begin
  • trunk/UGame.pas

    r85 r86  
    24482448  PrevPlayer: TPlayer;
    24492449begin
     2450  CurrentPlayer.View.SelectedCell := nil;
    24502451  MoveAll(CurrentPlayer);
    24512452  Map.Grow(CurrentPlayer);
Note: See TracChangeset for help on using the changeset viewer.