Changeset 28 for trunk/UGame.pas
- Timestamp:
- Mar 3, 2014, 8:53:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r27 r28 12 12 CellMulX = 1.12; 13 13 CellMulY = 1.292; 14 MaxPlayerCount = 8; 14 15 15 16 type … … 64 65 function CanvasToCellRect(Pos: TRect): TRect; 65 66 function CellToCanvasRect(Pos: TRect): TRect; 67 procedure Assign(Source: TView); 66 68 property DestRect: TRect read FDestRect write SetDestRect; 67 69 property Zoom: Double read FZoom write SetZoom; … … 164 166 const 165 167 PlayerModeText: array[TPlayerMode] of string = ('Human', 'Computer'); 168 clOrange = $009Aff; 169 PlayerColors: array[0..7] of TColor = (clBlue, clRed, clGreen, clOrange, clPurple, clMaroon, clAqua, clFuchsia); 166 170 167 171 … … 310 314 Result.TopLeft := CellToCanvasPos(Pos.TopLeft); 311 315 Result.BottomRight := CellToCanvasPos(Pos.BottomRight); 316 end; 317 318 procedure TView.Assign(Source: TView); 319 begin 320 SourceRect := Source.SourceRect; 321 DestRect := Source.DestRect; 322 Zoom := Source.Zoom; 312 323 end; 313 324 … … 398 409 StartUnits := Source.StartUnits; 399 410 SelectedCell := Source.SelectedCell; 400 View.Zoom := Source.View.Zoom; 411 FocusedCell := Source.FocusedCell; 412 View.Assign(Source.View); 401 413 end; 402 414 … … 481 493 482 494 procedure TGame.SetRunning(AValue: Boolean); 495 var 496 I: Integer; 483 497 begin 484 498 if FRunning = AValue then Exit; … … 486 500 if Players.Count < 2 then raise Exception.Create(SMinimumPlayers); 487 501 FRunning := AValue; 488 end else FRunning := AValue; 502 end else begin 503 FRunning := AValue; 504 for I := 0 to Players.Count - 1 do 505 with TPlayer(Players[I]) do begin 506 SelectedCell := nil; 507 FocusedCell := nil; 508 end; 509 end; 489 510 end; 490 511 … … 739 760 end else begin 740 761 Pen.Color := clBlack; 741 Pen.Style := psClear; 762 // Cannot set clear border as it will display shifted on gtk2 763 //Pen.Style := psClear; 764 Pen.Color := Brush.Color; 765 Pen.Style := psSolid; 742 766 end; 743 767 Points := GetHexagonPolygon(Point(Trunc(Pos.X), Trunc(Pos.Y)), Point(Trunc(HexSize.X), Trunc(HexSize.Y))); 744 Polygon(Points); 768 Polygon(Points, False, 0, Length(Points)); 769 //Rectangle(Trunc(Pos.X), Trunc(Pos.Y), Trunc(Pos.X + HexSize.X), Trunc(Pos.Y + HexSize.Y)); 745 770 Pen.Style := psSolid; 746 771 Font.Color := clWhite;
Note:
See TracChangeset
for help on using the changeset viewer.