Changeset 28
- Timestamp:
- Mar 3, 2014, 8:53:04 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Languages/xtactics.cs.po
r26 r28 48 48 msgstr "." 49 49 50 #: tformmain.toolbar1.caption 51 msgid "ToolBar1" 52 msgstr "" 53 50 54 #: tformmove.buttoncancel.caption 55 msgctxt "tformmove.buttoncancel.caption" 51 56 msgid "Cancel" 52 57 msgstr "" 53 58 54 59 #: tformmove.buttonok.caption 60 msgctxt "tformmove.buttonok.caption" 55 61 msgid "Ok" 56 62 msgstr "" … … 68 74 msgstr "" 69 75 76 #: tformnew.buttoncancel.caption 77 msgctxt "tformnew.buttoncancel.caption" 78 msgid "Cancel" 79 msgstr "" 80 81 #: tformnew.buttonok.caption 82 msgctxt "tformnew.buttonok.caption" 83 msgid "Ok" 84 msgstr "" 85 86 #: tformnew.buttonplayeradd.caption 87 msgid "Add" 88 msgstr "" 89 90 #: tformnew.buttonplayerremove.caption 91 msgid "Remove" 92 msgstr "" 93 94 #: tformnew.caption 95 msgid "New game" 96 msgstr "" 97 98 #: tformnew.checkboxvoid.caption 99 msgid "Inaccessible places" 100 msgstr "" 101 102 #: tformnew.label1.caption 103 msgid "Map size:" 104 msgstr "" 105 106 #: tformnew.label2.caption 107 msgid "x" 108 msgstr "" 109 110 #: tformnew.listview1.columns[0].caption 111 msgid "Name" 112 msgstr "" 113 114 #: tformnew.listview1.columns[1].caption 115 msgid "Type" 116 msgstr "" 117 118 #: tformnew.listview1.columns[2].caption 119 msgid "Color" 120 msgstr "" 121 122 #: tformnew.listview1.columns[3].caption 123 msgid "Start units" 124 msgstr "" 125 70 126 #: ucore.splayerwins 71 127 msgctxt "ucore.splayerwins" -
trunk/Languages/xtactics.po
r26 r28 39 39 msgstr "" 40 40 41 #: tformmain.toolbar1.caption 42 msgid "ToolBar1" 43 msgstr "" 44 41 45 #: tformmove.buttoncancel.caption 46 msgctxt "tformmove.buttoncancel.caption" 42 47 msgid "Cancel" 43 48 msgstr "" 44 49 45 50 #: tformmove.buttonok.caption 51 msgctxt "tformmove.buttonok.caption" 46 52 msgid "Ok" 47 53 msgstr "" … … 59 65 msgstr "" 60 66 67 #: tformnew.buttoncancel.caption 68 msgctxt "TFORMNEW.BUTTONCANCEL.CAPTION" 69 msgid "Cancel" 70 msgstr "" 71 72 #: tformnew.buttonok.caption 73 msgctxt "TFORMNEW.BUTTONOK.CAPTION" 74 msgid "Ok" 75 msgstr "" 76 77 #: tformnew.buttonplayeradd.caption 78 msgid "Add" 79 msgstr "" 80 81 #: tformnew.buttonplayerremove.caption 82 msgid "Remove" 83 msgstr "" 84 85 #: tformnew.caption 86 msgid "New game" 87 msgstr "" 88 89 #: tformnew.checkboxvoid.caption 90 msgid "Inaccessible places" 91 msgstr "" 92 93 #: tformnew.label1.caption 94 msgid "Map size:" 95 msgstr "" 96 97 #: tformnew.label2.caption 98 msgid "x" 99 msgstr "" 100 101 #: tformnew.listview1.columns[0].caption 102 msgid "Name" 103 msgstr "" 104 105 #: tformnew.listview1.columns[1].caption 106 msgid "Type" 107 msgstr "" 108 109 #: tformnew.listview1.columns[2].caption 110 msgid "Color" 111 msgstr "" 112 113 #: tformnew.listview1.columns[3].caption 114 msgid "Start units" 115 msgstr "" 116 61 117 #: ucore.splayerwins 62 118 msgctxt "ucore.splayerwins" -
trunk/UCore.lfm
r22 r28 8 8 Width = 752 9 9 object ActionList1: TActionList 10 Images = ImageList1 10 11 left = 252 11 12 top = 72 … … 36 37 end 37 38 end 39 object ImageList1: TImageList 40 left = 248 41 top = 152 42 end 38 43 end -
trunk/UCore.pas
r26 r28 19 19 AGameNew: TAction; 20 20 AGameRestart: TAction; 21 ImageList1: TImageList; 21 22 procedure AExitExecute(Sender: TObject); 22 23 procedure AGameEndExecute(Sender: TObject); -
trunk/UFormMain.lfm
r23 r28 16 16 object PaintBox1: TPaintBox 17 17 Left = 0 18 Height = 5 6919 Top = 018 Height = 537 19 Top = 32 20 20 Width = 775 21 21 Align = alClient … … 36 36 Panels = < 37 37 item 38 Width = 50 38 Width = 100 39 end 40 item 41 Width = 100 42 end 43 item 44 Width = 100 39 45 end> 40 46 SimplePanel = False 41 47 end 48 object ToolBar1: TToolBar 49 Left = 0 50 Top = 0 51 Width = 775 52 ButtonHeight = 32 53 ButtonWidth = 32 54 Caption = 'ToolBar1' 55 Images = Core.ImageList1 56 ParentShowHint = False 57 ShowCaptions = True 58 ShowHint = True 59 TabOrder = 1 60 object ToolButton1: TToolButton 61 Left = 1 62 Top = 2 63 Action = Core.AGameNew 64 end 65 object ToolButton2: TToolButton 66 Left = 45 67 Top = 2 68 Action = Core.AGameEndTurn 69 end 70 object ToolButton3: TToolButton 71 Left = 120 72 Top = 2 73 Action = Core.AGameEnd 74 end 75 object ToolButton4: TToolButton 76 Left = 157 77 Top = 2 78 Action = Core.AGameRestart 79 end 80 end 42 81 object MainMenu1: TMainMenu 82 Images = Core.ImageList1 43 83 left = 72 44 84 top = 48 -
trunk/UFormMain.lrt
r22 r28 1 1 TFORMMAIN.CAPTION=xTactics 2 TFORMMAIN.TOOLBAR1.CAPTION=ToolBar1 2 3 TFORMMAIN.MENUITEM1.CAPTION=Game 3 4 TFORMMAIN.MENUITEM5.CAPTION=- -
trunk/UFormMain.pas
r25 r28 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 UGame, LCLType, Menus, ActnList, ComCtrls, types ;9 UGame, LCLType, Menus, ActnList, ComCtrls, types, dateutils; 10 10 11 11 const … … 28 28 StatusBar1: TStatusBar; 29 29 Timer1: TTimer; 30 ToolBar1: TToolBar; 31 ToolButton1: TToolButton; 32 ToolButton2: TToolButton; 33 ToolButton3: TToolButton; 34 ToolButton4: TToolButton; 30 35 procedure FormActivate(Sender: TObject); 31 36 procedure FormCreate(Sender: TObject); … … 96 101 var 97 102 NewCaption: string; 103 DrawStart: TDateTime; 98 104 begin 99 105 if RedrawPending then begin 100 106 RedrawPending := False; 107 DrawStart := Now; 101 108 PaintBox1.Repaint; 109 StatusBar1.Panels[1].Text := IntToStr(Trunc((Now - DrawStart) / OneMillisecond)) + ' ms'; 102 110 103 111 NewCaption := 'xTactics'; -
trunk/UFormNew.pas
r19 r28 72 72 ListView1.Refresh; 73 73 ButtonPlayerRemove.Enabled := Assigned(ListView1.Selected); 74 ButtonPlayerAdd.Enabled := Players.Count < MaxPlayerCount; 74 75 end; 75 76 … … 96 97 begin 97 98 NewPlayer := TPlayer.Create; 98 NewPlayer.Name := 'Player x';99 NewPlayer.Color := clYellow;99 NewPlayer.Name := 'Player ' + IntToStr(Players.Count + 1); 100 NewPlayer.Color := PlayerColors[Players.Count]; 100 101 Players.Add(NewPlayer); 101 102 ReloadView; … … 125 126 126 127 procedure TFormNew.Save(Game: TGame); 128 var 129 I: Integer; 127 130 begin 131 while Game.Players.Count > Players.Count do 132 Game.Players.Delete(Game.Players.Count - 1); 133 while Game.Players.Count < Players.Count do 134 Game.Players.Add(TPlayer.Create); 135 for I := 0 to Game.Players.Count - 1 do begin 136 TPlayer(Game.Players[I]).Assign(TPlayer(Players[I])); 137 TPlayer(Game.Players[I]).Game := Game; 138 end; 128 139 Game.VoidEnabled := CheckBoxVoid.Checked; 129 140 Game.Map.Size := Point(SpinEditMapSizeX.Value, SpinEditMapSizeY.Value); -
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.