Changeset 236 for trunk/UClientGUI.pas


Ignore:
Timestamp:
Sep 20, 2018, 3:33:04 PM (6 years ago)
Author:
chronos
Message:
  • Added: Mouse focused and selected cells are now working.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientGUI.pas

    r234 r236  
    383383  UnitMove: TUnitMove;
    384384  I: Integer;
    385 begin
    386   NewSelectedCell := Player.PlayerMap.PosToCell(CanvasToCellPos(Pos));
     385  CellPos: TPoint;
     386  R: TRect;
     387begin
     388  if TGame(Game).Map.Cyclic then begin
     389    R := CellToCanvasRect(TGame(Game).Map.PixelRect);
     390    CellPos := TPoint.Create(
     391      ModNeg(Pos.X - R.P1.X, R.Size.X) + R.P1.X,
     392      ModNeg(Pos.Y - R.P1.Y, R.Size.Y) + R.P1.Y
     393    );
     394    NewSelectedCell := Player.PlayerMap.PosToCell(
     395      CanvasToCellPos(CellPos));
     396  end else begin
     397    NewSelectedCell := Player.PlayerMap.PosToCell(
     398      CanvasToCellPos(Pos));
     399  end;
    387400  if Assigned(NewSelectedCell) then begin
    388401    if Assigned(SelectedCell) and TGame(Game).Map.IsCellsNeighbor(NewSelectedCell.MapCell, SelectedCell.MapCell) then begin
Note: See TracChangeset for help on using the changeset viewer.