Changeset 8 for trunk/UGame.pas


Ignore:
Timestamp:
Feb 12, 2014, 9:32:54 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Cell selection and deselection on left mouse button up.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r7 r8  
    110110
    111111procedure TPlayer.SelectCell(Pos: TPoint);
    112 begin
    113   SelectedCell := Game.Map.PosToCell(Pos, View, ViewZoom);
     112var
     113  NewSelectedCell: TPoint;
     114begin
     115  NewSelectedCell := Game.Map.PosToCell(Pos, View, ViewZoom);
     116  if (NewSelectedCell.X = SelectedCell.X) and (NewSelectedCell.Y = SelectedCell.Y) then
     117    SelectedCell := Point(-1, -1)
     118    else SelectedCell := NewSelectedCell;
    114119end;
    115120
Note: See TracChangeset for help on using the changeset viewer.