- Timestamp:
- Sep 23, 2018, 1:43:52 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Languages/xtactics.cs.po
r253 r258 230 230 msgstr "Vykonat" 231 231 232 #: tformmain.astatusbarvisible.caption233 msgid "Status bar visible"234 msgstr "Viditelná stavová lišta"235 236 232 #: tformmain.atoolbarbigicons.caption 237 233 msgctxt "tformmain.atoolbarbigicons.caption" … … 278 274 msgid "Help" 279 275 msgstr "Nápověda" 276 277 #: tformmain.menuitem22.caption 278 msgctxt "tformmain.menuitem22.caption" 279 msgid "Statusbar visible" 280 msgstr "Viditelná stavová lišta" 280 281 281 282 #: tformmain.menuitem8.caption … … 354 355 #: tformnew.aplayermodify.caption 355 356 msgctxt "tformnew.aplayermodify.caption" 356 msgid "Modify "357 msgid "Modify player" 357 358 msgstr "Upravit" 358 359 … … 378 379 msgstr "Odstranit" 379 380 381 #: tformnew.button1.caption 382 msgctxt "tformnew.button1.caption" 383 msgid "Add" 384 msgstr "Přidat" 385 386 #: tformnew.button2.caption 387 msgctxt "tformnew.button2.caption" 388 msgid "Remove" 389 msgstr "Odstranit" 390 391 #: tformnew.button3.caption 392 msgctxt "tformnew.button3.caption" 393 msgid "Modify" 394 msgstr "Upravit" 395 380 396 #: tformnew.buttoncancel.caption 381 397 msgctxt "tformnew.buttoncancel.caption" … … 392 408 msgid "Ok" 393 409 msgstr "Ok" 410 411 #: tformnew.buttonplayeradd.caption 412 msgctxt "tformnew.buttonplayeradd.caption" 413 msgid "Add" 414 msgstr "Přidat" 415 416 #: tformnew.buttonplayermodify.caption 417 msgctxt "tformnew.buttonplayermodify.caption" 418 msgid "Modify" 419 msgstr "Upravit" 420 421 #: tformnew.buttonplayerremove.caption 422 msgctxt "tformnew.buttonplayerremove.caption" 423 msgid "Remove" 424 msgstr "Odstranit" 394 425 395 426 #: tformnew.caption … … 1059 1090 msgid "64-bit UInt read overflow." 1060 1091 msgstr "Přetečení při čtení 64-bit UInt" 1061 -
trunk/Languages/xtactics.po
r250 r258 220 220 msgstr "" 221 221 222 #: tformmain.astatusbarvisible.caption223 msgid "Status bar visible"224 msgstr ""225 226 222 #: tformmain.atoolbarbigicons.caption 227 223 msgctxt "tformmain.atoolbarbigicons.caption" … … 269 265 msgstr "" 270 266 267 #: tformmain.menuitem22.caption 268 msgctxt "tformmain.menuitem22.caption" 269 msgid "Statusbar visible" 270 msgstr "" 271 271 272 #: tformmain.menuitem8.caption 272 273 msgctxt "tformmain.menuitem8.caption" … … 342 343 #: tformnew.aplayermodify.caption 343 344 msgctxt "tformnew.aplayermodify.caption" 344 msgid "Modify "345 msgid "Modify player" 345 346 msgstr "" 346 347 … … 365 366 msgstr "" 366 367 368 #: tformnew.button1.caption 369 msgctxt "tformnew.button1.caption" 370 msgid "Add" 371 msgstr "" 372 373 #: tformnew.button2.caption 374 msgctxt "tformnew.button2.caption" 375 msgid "Remove" 376 msgstr "" 377 378 #: tformnew.button3.caption 379 msgctxt "tformnew.button3.caption" 380 msgid "Modify" 381 msgstr "" 382 367 383 #: tformnew.buttoncancel.caption 368 384 msgctxt "TFORMNEW.BUTTONCANCEL.CAPTION" … … 378 394 msgctxt "TFORMNEW.BUTTONOK.CAPTION" 379 395 msgid "Ok" 396 msgstr "" 397 398 #: tformnew.buttonplayeradd.caption 399 msgctxt "tformnew.buttonplayeradd.caption" 400 msgid "Add" 401 msgstr "" 402 403 #: tformnew.buttonplayermodify.caption 404 msgctxt "tformnew.buttonplayermodify.caption" 405 msgid "Modify" 406 msgstr "" 407 408 #: tformnew.buttonplayerremove.caption 409 msgctxt "tformnew.buttonplayerremove.caption" 410 msgid "Remove" 380 411 msgstr "" 381 412 -
trunk/UGeometry.pas
r248 r258 123 123 124 124 function TypedMod(Numerator, Denominator: Integer): Integer; overload; 125 function TypedMod(Numerator, Denominator: Single): Single; overload;125 //function TypedMod(Numerator, Denominator: Single): Single; overload; 126 126 function TypedDivide(Divident, Divisor: Integer): Integer; overload; 127 127 function TypedDivide(Divident, Divisor: Single): Single; overload; … … 146 146 end; 147 147 148 function TypedMod(Numerator, Denominator: Single): Single; overload;148 {function TypedMod(Numerator, Denominator: Single): Single; overload; 149 149 begin 150 150 //Result := FMod(Numerator, Denominator); 151 end; 151 end;} 152 152 153 153 function TypedDivide(Divident, Divisor: Integer): Integer; -
trunk/UMap.pas
r248 r258 467 467 end; 468 468 469 {procedure TMap.Paint(Canvas: TCanvas; View: TView);470 var471 I: Integer;472 Cell: TCell;473 PosFrom, PosTo: TPoint;474 Angle: Double;475 ArrowCenter: TPoint;476 Move: TUnitMove;477 CellLink: TCellLink;478 begin479 with Canvas, View do480 try481 Lock;482 483 // Draw cell links484 Pen.Color := clBlack;485 Pen.Style := psSolid;486 Pen.Width := 3;487 for CellLink in CellLinks do488 with CellLink do begin489 if Length(Points) >= 2 then begin490 MoveTo(PointToStdPoint(View.CellToCanvasPos(Points[0])));491 for I := 1 to Length(Points) - 1 do492 LineTo(PointToStdPoint(View.CellToCanvasPos(Points[I])));493 end;494 end;495 496 // Draw cells497 for Cell in Cells do begin498 if (Cell.Terrain <> ttVoid) and Cell.IsVisible(View) then begin499 if Assigned(SelectedCell) and (SelectedCell.MapCell = Cell) then500 Brush.Color := clGreen501 else if Assigned(SelectedCell) and IsCellsNeighbor(SelectedCell.MapCell, Cell) then502 Brush.Color := clPurple503 else Brush.Color := Cell.GetColor;504 //Pen.Color := clBlack;505 PaintCell(Canvas, Cell.PosPx, IntToStr(Cell.Power), View, Cell);506 end;507 end;508 finally509 Unlock;510 end;511 end;512 }513 514 469 function TMap.GetNewCellId: Integer; 515 470 begin … … 647 602 Result := Cell.PosPx; 648 603 end; 649 650 {procedure TMap.PaintCell(Canvas: TCanvas; Pos: TPoint; Text: string; View: TView;651 Cell: TCell);652 var653 I: Integer;654 TextPos: TPoint;655 Points: array of Classes.TPoint;656 TextSize: TSize;657 begin658 if Cell.Extra = etObjectiveTarget then begin659 Text := Text + '!';660 end;661 with Canvas do begin662 if Assigned(View.FocusedCell) and (View.FocusedCell.MapCell = Cell) then begin663 Pen.Color := clYellow;664 Pen.Style := psSolid;665 Pen.Width := 1;666 end else667 if Cell.Terrain = ttCity then begin668 // Cannot set clear border as it will display shifted on gtk2669 //Pen.Style := psClear;670 Pen.Color := clBlack;671 Pen.Style := psSolid;672 Pen.Width := 3;673 end else begin674 // Cannot set clear border as it will display shifted on gtk2675 //Pen.Style := psClear;676 Pen.Color := Brush.Color;677 Pen.Style := psSolid;678 Pen.Width := 0;679 end;680 // Transform view681 SetLength(Points, Length(Cell.Polygon.Points));682 for I := 0 to Length(Points) - 1 do683 Points[I] := PointToStdPoint(View.CellToCanvasPos(Cell.Polygon.Points[I]));684 Brush.Style := bsSolid;685 //Polygon(Points, False, 0, Length(Points));686 TCanvasEx.PolygonEx(Canvas, Points, False);687 //MoveTo(Points[0].X, Points[0].Y);688 //LineTo(Points[1].X, Points[1].Y);689 690 // Show cell text691 if (Cell.Power <> 0) or (Cell.Extra = etObjectiveTarget) then begin692 Pen.Style := psSolid;693 Font.Color := clWhite;694 Brush.Style := bsClear;695 Font.Size := Trunc(42 * View.Zoom);696 TextPos := View.CellToCanvasPos(Pos);697 TextSize := TextExtent(Text);698 TCanvasEx.TextOutEx(Canvas, Round(TextPos.X) - TextSize.cx div 2,699 Round(TextPos.Y) - TextSize.cy div 2, Text, False);700 end;701 end;702 end;703 }704 604 705 605 procedure TMap.ComputePlayerStats; … … 1010 910 procedure TCell.ConnectTo(Cell: TCell); 1011 911 begin 912 if Cell = Self then 913 raise Exception.Create('Can''t connect map cell to itself'); 1012 914 // Connect only if already not connected 1013 915 if Neighbors.IndexOf(Cell) < 0 then begin … … 1068 970 var 1069 971 I: Integer; 972 Cell: TCell; 1070 973 begin 1071 974 Player := TGame(Map.Game).Players.FindById(PlayerId); 1072 975 1073 976 Neighbors.Count := Length(NeighborsId); 977 for I := 0 to Length(NeighborsId) - 1 do 978 Neighbors[I] := nil; 1074 979 for I := 0 to Length(NeighborsId) - 1 do begin 1075 Neighbors[I] := Map.Cells.FindById(NeighborsId[I]); 980 Cell := Map.Cells.FindById(NeighborsId[I]); 981 if not Assigned(Cell) then 982 raise Exception.Create('Neighbor cell id not found ' + IntToStr(NeighborsId[I])); 983 if Neighbors.IndexOf(Cell) <> -1 then 984 raise Exception.Create('Duplicate neighbor cell ' + IntToStr(NeighborsId[I]) + ' found for cell ' + IntToStr(Id)); 985 Neighbors[I] := Cell; 1076 986 end; 1077 987 end; -
trunk/UMapType.pas
r248 r258 489 489 for Y := -1 to 1 do 490 490 for X := -1 to 1 do 491 for J := 0 to Cells.Count - 1 do begin 491 for J := 0 to Cells.Count - 1 do 492 if J <> I then begin 492 493 P := Cells[J].Polygon; 493 494 P.Move(TPoint.Create(X * AreaSize.X, Y * AreaSize.Y)); -
trunk/UPlayer.pas
r248 r258 217 217 218 218 procedure TPlayerCell.LoadFromNode(Node: TDOMNode); 219 var 220 C: TCell; 221 CellId: Integer; 219 222 begin 220 223 Explored := ReadBoolean(Node, 'Explored', False); 221 MapCell := TGame(List.Map.Player.Game).Map.Cells.FindById(ReadInteger(Node, 'MapCell', 0)); 224 CellId := ReadInteger(Node, 'MapCell', 0); 225 C := TGame(List.Map.Player.Game).Map.Cells.FindById(CellId); 226 if not Assigned(C) then 227 raise Exception.Create('Cell map not found ' + IntToStr(CellId)); 228 if List.SearchCell(C) <> nil then 229 raise Exception.Create('Map cell used twice ' + IntToStr(CellId)); 230 MapCell := C; 222 231 end; 223 232 224 233 procedure TPlayerCell.ConnectTo(Cell: TPlayerCell); 225 234 begin 235 if Cell = Self then 236 raise Exception.Create('Can''t connect player cell to itself'); 226 237 if (Cell.Neighbors.IndexOf(Self) = -1) and 227 (Neighbors.IndexOf(Cell) = -1) then begin ;238 (Neighbors.IndexOf(Cell) = -1) then begin 228 239 Cell.Neighbors.Add(Self); 229 240 Neighbors.Add(Cell); … … 282 293 begin 283 294 for I := MovesFrom.Count - 1 downto 0 do 284 TUnitMove(MovesFrom[I]).List.Remove(TUnitMove(MovesFrom[I])); 295 if TUnitMove(MovesFrom[I]).List.Remove(TUnitMove(MovesFrom[I])) = -1 then 296 raise Exception.Create('MoveFrom cell remove error'); 285 297 FreeAndNil(MovesFrom); 286 298 for I := MovesTo.Count - 1 downto 0 do 287 TUnitMove(MovesTo[I]).List.Remove(TUnitMove(MovesTo[I])); 299 if TUnitMove(MovesTo[I]).List.Remove(TUnitMove(MovesTo[I])) = -1 then 300 raise Exception.Create('MoveTo cell remove error'); 288 301 FreeAndNil(MovesTo); 289 302 for I := Neighbors.Count - 1 downto 0 do … … 672 685 if FCellFrom = AValue then Exit; 673 686 if Assigned(AValue) and not Assigned(FCellFrom) then begin 674 AValue.MovesFrom.Add(Self); 687 if AValue.MovesFrom.IndexOf(Self) = -1 then 688 AValue.MovesFrom.Add(Self) 689 else raise Exception.Create('Unit move already exists'); 675 690 end else 676 691 if not Assigned(AValue) and Assigned(FCellFrom) then begin 677 FCellFrom.MovesFrom.Remove(Self); 692 if FCellFrom.MovesFrom.IndexOf(Self) <> -1 then 693 FCellFrom.MovesFrom.Remove(Self) 694 else raise Exception.Create('Unit move not found'); 678 695 end; 679 696 FCellFrom := AValue;
Note:
See TracChangeset
for help on using the changeset viewer.