- Timestamp:
- Sep 26, 2014, 1:58:41 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r58 r62 16 16 WindowState = wsMaximized 17 17 object PaintBox1: TPaintBox 18 Left = 019 Height = 5 4720 Top = 3221 Width = 7 7518 Left = 40 19 Height = 579 20 Top = 0 21 Width = 735 22 22 Align = alClient 23 23 OnMouseDown = PaintBox1MouseDown … … 49 49 object ToolBar1: TToolBar 50 50 Left = 0 51 Height = 579 51 52 Top = 0 52 Width = 775 53 Width = 40 54 Align = alLeft 53 55 ButtonHeight = 32 54 56 ButtonWidth = 32 … … 64 66 end 65 67 object ToolButton2: TToolButton 66 Left = 3367 Top = 268 Left = 1 69 Top = 34 68 70 Action = Core.AGameEndTurn 69 71 end 70 72 object ToolButton3: TToolButton 71 Left = 6572 Top = 273 Left = 1 74 Top = 66 73 75 Action = Core.AGameEnd 74 76 end 75 77 object ToolButton4: TToolButton 76 Left = 9777 Top = 278 Left = 1 79 Top = 98 78 80 Action = Core.AGameRestart 79 81 end 80 82 object ToolButton5: TToolButton 81 Left = 1 2982 Top = 283 Left = 1 84 Top = 130 83 85 Action = Core.ASettings 84 86 end 85 87 object ToolButton6: TToolButton 86 Left = 1 7187 Top = 288 Left = 1 89 Top = 194 88 90 Action = AZoomIn 89 91 end 90 92 object ToolButton7: TToolButton 91 Left = 20392 Top = 2 93 Left = 1 94 Top = 226 93 95 Action = AZoomOut 94 96 end 95 97 object ToolButton8: TToolButton 96 Left = 23597 Top = 2 98 Left = 1 99 Top = 258 98 100 Action = AZoomAll 99 101 end 100 102 object ToolButton9: TToolButton 101 Left = 1 61102 Top = 2103 Width = 10103 Left = 1 104 Top = 162 105 Width = 32 104 106 Caption = 'ToolButton9' 105 107 Style = tbsSeparator -
trunk/Forms/UFormMain.pas
r58 r62 180 180 ToolBar1.ButtonHeight := 32 + 6; 181 181 ToolBar1.Height := 32 + 10; 182 ToolBar1.Width := 32 + 10; 182 183 end else begin 183 184 ToolBar1.ButtonWidth := 16 + 7; 184 185 ToolBar1.ButtonHeight := 16 + 6; 185 186 ToolBar1.Height := 16 + 10; 187 ToolBar1.Width := 16 + 10; 186 188 ToolBar1.Images := Core.ImageListSmall; 187 189 end; -
trunk/UCore.lfm
r58 r62 1714 1714 VersionSuffix = 'alfa' 1715 1715 CompanyName = 'Chronosoft' 1716 CompanyHomePage = 'http:// chronosoft.zdechov.net/xtactics/'1717 HomePage = 'http:// chronosoft.zdechov.net'1716 CompanyHomePage = 'http://svn.zdechov.net/trac/xtactics' 1717 HomePage = 'http://svn.zdechov.net/trac/xtactics' 1718 1718 AuthorsName = 'Chronos' 1719 1719 AppName = 'xTactics' 1720 ReleaseDate = 41 7161720 ReleaseDate = 41908 1721 1721 RegistryKey = '\Software\xTactics' 1722 1722 RegistryRoot = rrKeyCurrentUser -
trunk/UGame.pas
r60 r62 237 237 procedure SetRunning(AValue: Boolean); 238 238 procedure UpdateRepeatMoves(Player: TPlayer); 239 procedure CheckCounterMove(Move: TUnitMove); 239 240 public 240 241 Players: TPlayers; … … 524 525 SetLength(Points, 8); 525 526 SetLength(FPoints, 8); 526 ArrowSize := Point(Trunc(DefaultCellSize.X / 4* View.Zoom),527 Trunc(DefaultCellSize.Y / 4* View.Zoom));527 ArrowSize := Point(Trunc(DefaultCellSize.X / 3 * View.Zoom), 528 Trunc(DefaultCellSize.Y / 3 * View.Zoom)); 528 529 FPoints[0] := FloatPoint(+0.5 * ArrowSize.X, +0 * ArrowSize.Y); 529 530 FPoints[1] := FloatPoint(+0 * ArrowSize.X, +0.5 * ArrowSize.Y); … … 546 547 Brush.Style := bsClear; 547 548 Font.Color := clBlack; 548 Font.Size := Trunc( 16 * View.Zoom);549 Font.Size := Trunc(26 * View.Zoom); 549 550 TextOut(Pos.X - TextWidth(Text) div 2, 550 551 Pos.Y - TextHeight(Text) div 2, Text); … … 1288 1289 end; 1289 1290 if Confirm then begin 1290 if Assigned(OldMove) then begin 1291 // Already have such move 1292 if (CountOnce = 0) and (CountRepeat = 0) then Moves.Delete(I) 1293 else begin 1294 TUnitMove(Moves[I]).CountOnce := CountOnce; 1295 TUnitMove(Moves[I]).CountRepeat := CountRepeat; 1291 if Assigned(OldMove) then begin 1292 // Already have such move 1293 if (CountOnce = 0) and (CountRepeat = 0) then Moves.Delete(I) 1294 else begin 1295 OldMove.CountOnce := CountOnce; 1296 OldMove.CountRepeat := CountRepeat; 1297 CheckCounterMove(OldMove); 1298 end; 1299 end else begin 1300 // Add new move 1301 if (CountOnce > 0) or (CountRepeat > 0) then begin 1302 NewMove := TUnitMove(Moves[Moves.Add(TUnitMove.Create)]); 1303 NewMove.List := Moves; 1304 NewMove.CellFrom := CellFrom; 1305 NewMove.CellTo := CellTo; 1306 NewMove.CountOnce := CountOnce; 1307 NewMove.CountRepeat := CountRepeat; 1308 CheckCounterMove(NewMove); 1296 1309 end; 1297 end else begin 1298 // Add new move 1299 if (CountOnce > 0) or (CountRepeat > 0) then begin 1300 NewMove := TUnitMove(Moves[Moves.Add(TUnitMove.Create)]); 1301 NewMove.List := Moves; 1302 NewMove.CellFrom := CellFrom; 1303 NewMove.CellTo := CellTo; 1304 NewMove.CountOnce := CountOnce; 1305 NewMove.CountRepeat := CountRepeat; 1306 end; 1307 end; 1310 end; 1311 1308 1312 end; 1309 1313 end; … … 1336 1340 CountOnce := CountRepeat 1337 1341 else CountOnce := CellFrom.GetAvialPower; 1342 end; 1343 end; 1344 1345 procedure TGame.CheckCounterMove(Move: TUnitMove); 1346 var 1347 I: Integer; 1348 CounterMove: TUnitMove; 1349 begin 1350 I := 0; 1351 while (I < Moves.Count) and ((TUnitMove(Moves[I]).CellTo <> Move.CellFrom) and 1352 (TUnitMove(Moves[I]).CellFrom <> Move.CellTo)) do Inc(I); 1353 if I < Moves.Count then CounterMove := TUnitMove(Moves[I]) 1354 else CounterMove := nil; 1355 if Assigned(CounterMove) then begin 1356 // For now, just remove counter move 1357 Moves.Remove(CounterMove); 1338 1358 end; 1339 1359 end; … … 1644 1664 Angle: Double; 1645 1665 ArrowCenter: TPoint; 1666 Move: TUnitMove; 1646 1667 begin 1647 1668 with Canvas, View do … … 1658 1679 Pen.Color := clBlack; 1659 1680 PaintCell(Canvas, Cell.PosPx, IntToStr(Cell.GetAvialPower), View, Cell); 1660 1661 // Draw arrows1662 Pen.Color := clCream;1663 for I := 0 to Cell.MovesFrom.Count - 1 do begin1664 PosFrom := CellToPos(Cell);1665 PosTo := CellToPos(TUnitMove(Cell.MovesFrom[I]).CellTo);1666 if TUnitMove(Cell.MovesFrom[I]).CountRepeat > 0 then Pen.Width := 21667 else Pen.Width := 1;1668 Angle := ArcTan((PosTo.Y - PosFrom.Y) / (PosTo.X - PosFrom.X));1669 if Sign(PosTo.X - PosFrom.X) = -1 then Angle := Angle + Pi;1670 ArrowCenter := View.CellToCanvasPos(Point(Trunc(PosFrom.X + (PosTo.X - PosFrom.X) / 3),1671 Trunc(PosFrom.Y + (PosTo.Y - PosFrom.Y) / 3)));1672 DrawArrow(Canvas, View, ArrowCenter,1673 Angle, IntToStr(TUnitMove(Cell.MovesFrom[I]).CountOnce));1674 end;1675 1681 end; 1682 1683 end; 1684 1685 // Draw arrows 1686 Pen.Color := clCream; 1687 for I := 0 to Game.Moves.Count - 1 do begin 1688 Move := TUnitMove(Game.Moves[I]); 1689 PosFrom := CellToPos(Move.CellFrom); 1690 PosTo := CellToPos(Move.CellTo); 1691 if Move.CountRepeat > 0 then Pen.Width := 2 1692 else Pen.Width := 1; 1693 Angle := ArcTan((PosTo.Y - PosFrom.Y) / (PosTo.X - PosFrom.X)); 1694 if Sign(PosTo.X - PosFrom.X) = -1 then Angle := Angle + Pi; 1695 ArrowCenter := View.CellToCanvasPos(Point(Trunc(PosFrom.X + (PosTo.X - PosFrom.X) / 2), 1696 Trunc(PosFrom.Y + (PosTo.Y - PosFrom.Y) / 2))); 1697 DrawArrow(Canvas, View, ArrowCenter, 1698 Angle, IntToStr(Move.CountOnce)); 1676 1699 end; 1677 1700 finally -
trunk/xtactics.lpi
r59 r62 24 24 <Version Value="11"/> 25 25 <Target> 26 <Filename Value=" xtactics"/>26 <Filename Value="lib/$(TargetCPU)-$(TargetOS)/xtactics"/> 27 27 </Target> 28 28 <SearchPaths> 29 29 <IncludeFiles Value="$(ProjOutDir)"/> 30 <OtherUnitFiles Value="Forms"/> 30 31 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 31 32 </SearchPaths> … … 161 162 <Version Value="11"/> 162 163 <Target> 163 <Filename Value=" xtactics"/>164 <Filename Value="lib/$(TargetCPU)-$(TargetOS)/xtactics"/> 164 165 </Target> 165 166 <SearchPaths>
Note:
See TracChangeset
for help on using the changeset viewer.