Changeset 282
- Timestamp:
- Mar 10, 2019, 4:48:41 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r281 r282 258 258 object ComboBoxGridType: TComboBox 259 259 Left = 146 260 Height = 38260 Height = 42 261 261 Top = 104 262 262 Width = 304 … … 275 275 object ComboBoxMapShape: TComboBox 276 276 Left = 146 277 Height = 38277 Height = 42 278 278 Top = 144 279 279 Width = 304 -
trunk/Forms/UFormNew.pas
r281 r282 514 514 FormChat.Show; 515 515 Players := TPlayers.Create; 516 Players.Game := GamePreview; 516 517 FormPlayers := TFormPlayers.Create(nil); 517 518 FormPlayers.MinItemCount := MinPlayerCount; -
trunk/Forms/UFormPlayer.lfm
r279 r282 1 1 object FormPlayer: TFormPlayer 2 2 Left = 470 3 Height = 3444 Top = 2195 Width = 5223 Height = 406 4 Top = 157 5 Width = 652 6 6 Caption = 'Player' 7 ClientHeight = 3448 ClientWidth = 5227 ClientHeight = 406 8 ClientWidth = 652 9 9 Constraints.MinHeight = 344 10 10 Constraints.MinWidth = 522 … … 27 27 Height = 43 28 28 Top = 27 29 Width = 33929 Width = 469 30 30 Anchors = [akTop, akLeft, akRight] 31 31 TabOrder = 0 32 32 end 33 33 object ButtonCancel: TButton 34 Left = 27 834 Left = 274 35 35 Height = 25 36 Top = 3 0736 Top = 366 37 37 Width = 75 38 38 Anchors = [akRight, akBottom] … … 42 42 end 43 43 object ButtonOk: TButton 44 Left = 40344 Left = 394 45 45 Height = 25 46 Top = 3 0746 Top = 369 47 47 Width = 75 48 48 Anchors = [akRight, akBottom] … … 55 55 Left = 168 56 56 Height = 38 57 Top = 7258 Width = 33957 Top = 124 58 Width = 469 59 59 Anchors = [akTop, akLeft, akRight] 60 60 ItemHeight = 0 … … 72 72 Left = 24 73 73 Height = 26 74 Top = 7274 Top = 128 75 75 Width = 53 76 76 Caption = 'Mode:' … … 80 80 Left = 24 81 81 Height = 26 82 Top = 1 2882 Top = 176 83 83 Width = 50 84 84 Caption = 'Color:' … … 88 88 Left = 168 89 89 Height = 42 90 Top = 1 2091 Width = 33990 Top = 168 91 Width = 469 92 92 Style = [cbStandardColors, cbExtendedColors, cbCustomColor, cbPrettyNames] 93 93 Anchors = [akTop, akLeft, akRight] … … 98 98 Left = 24 99 99 Height = 26 100 Top = 168100 Top = 216 101 101 Width = 98 102 102 Caption = 'Agressivity:' … … 105 105 object ComboBoxAgressivity: TComboBox 106 106 Left = 168 107 Height = 42108 Top = 168109 Width = 339107 Height = 38 108 Top = 216 109 Width = 469 110 110 Anchors = [akTop, akLeft, akRight] 111 111 ItemHeight = 0 … … 122 122 Left = 24 123 123 Height = 30 124 Top = 2 08124 Top = 256 125 125 Width = 109 126 126 Caption = 'Defensive' … … 130 130 Left = 24 131 131 Height = 26 132 Top = 2 48132 Top = 296 133 133 Width = 94 134 134 Caption = 'Start units:' … … 138 138 Left = 224 139 139 Height = 43 140 Top = 2 40140 Top = 288 141 141 Width = 112 142 142 MaxValue = 99 143 143 TabOrder = 7 144 144 end 145 object ComboBoxNation: TComboBox 146 Left = 168 147 Height = 42 148 Top = 76 149 Width = 469 150 Anchors = [akTop, akLeft, akRight] 151 ItemHeight = 0 152 OnChange = ComboBoxModeChange 153 Style = csDropDownList 154 TabOrder = 8 155 end 156 object Label6: TLabel 157 Left = 24 158 Height = 26 159 Top = 80 160 Width = 63 161 Caption = 'Nation:' 162 ParentColor = False 163 end 145 164 end -
trunk/Forms/UFormPlayer.pas
r279 r282 20 20 ComboBoxMode: TComboBox; 21 21 ComboBoxAgressivity: TComboBox; 22 ComboBoxNation: TComboBox; 22 23 EditName: TEdit; 23 24 Label1: TLabel; … … 26 27 Label4: TLabel; 27 28 Label5: TLabel; 29 Label6: TLabel; 28 30 SpinEditStartUnits: TSpinEdit; 29 31 procedure ComboBoxModeChange(Sender: TObject); … … 48 50 49 51 uses 50 UCore ;52 UCore, UNation; 51 53 52 54 resourcestring … … 111 113 112 114 procedure TFormPlayer.LoadData(Player: TPlayer); 115 var 116 I: Integer; 113 117 begin 118 while ComboBoxNation.Items.Count > TGame(Player.Game).GameSystem.Nations.Count do 119 ComboBoxNation.Items.Delete(ComboBoxNation.Items.Count - 1); 120 while ComboBoxNation.Items.Count < TGame(Player.Game).GameSystem.Nations.Count do 121 ComboBoxNation.Items.Add(''); 122 for I := 0 to TGame(Player.Game).GameSystem.Nations.Count - 1 do begin 123 ComboBoxNation.Items[I] := TGame(Player.Game).GameSystem.Nations[I].Name; 124 ComboBoxNation.Items.Objects[I] := TGame(Player.Game).GameSystem.Nations[I]; 125 end; 126 127 ComboBoxNation.ItemIndex := ComboBoxNation.Items.IndexOfObject(Player.Nation); 128 if (ComboBoxNation.ItemIndex = -1) and (ComboBoxNation.Items.Count > 0) then 129 ComboBoxNation.ItemIndex := 0; 130 114 131 EditName.Text := Player.Name; 115 132 ComboBoxMode.ItemIndex := Integer(Player.Mode); … … 123 140 procedure TFormPlayer.SaveData(Player: TPlayer); 124 141 begin 142 Player.Nation := TNation(ComboBoxNation.Items.Objects[ComboBoxNation.ItemIndex]); 125 143 Player.Name := EditName.Text; 126 144 Player.Mode := TPlayerMode(ComboBoxMode.ItemIndex); -
trunk/Forms/UFormPlayers.lfm
r279 r282 1 1 object FormPlayers: TFormPlayers 2 Left = 7793 Height = 3 604 Top = 2 365 Width = 4802 Left = 566 3 Height = 354 4 Top = 293 5 Width = 682 6 6 Caption = 'Players' 7 ClientHeight = 3 608 ClientWidth = 4807 ClientHeight = 354 8 ClientWidth = 682 9 9 DesignTimePPI = 144 10 10 OnClose = FormClose … … 15 15 object ListView1: TListView 16 16 Left = 0 17 Height = 3 2117 Height = 315 18 18 Top = 0 19 Width = 48019 Width = 682 20 20 Align = alClient 21 21 Columns = < … … 30 30 item 31 31 Caption = 'Color' 32 Width = 80 33 end 34 item 35 Caption = 'Nation' 32 36 Width = 100 33 37 end 34 38 item 35 39 Caption = 'Start units' 36 Width = 6540 Width = 187 37 41 end> 38 42 MultiSelect = True … … 53 57 Left = 0 54 58 Height = 39 55 Top = 3 2156 Width = 48059 Top = 315 60 Width = 682 57 61 Align = alBottom 58 62 Images = Core.ImageListSmall -
trunk/Forms/UFormPlayers.pas
r279 r282 131 131 TempEntry.Id := Players.GetNewId; 132 132 TempEntry.Name := SPlayer + ' ' + IntToStr(TempEntry.Id); 133 TempEntry.Color := PlayerColors[Players.Count]; 133 TempEntry.Nation := Core.Game.GameSystem.Nations.First; 134 TempEntry.Color := TempEntry.Nation.Color; 134 135 TempEntry.Mode := pmComputer; 135 136 TempEntry.Agressivity := caMedium; … … 204 205 Item.SubItems.Add(PlayerModeText[Mode]); 205 206 Item.SubItems.Add(''); // Do not show color text 207 if Assigned(Nation) then Item.SubItems.Add(Nation.Name) 208 else Item.SubItems.Add(''); 206 209 Item.SubItems.Add(IntToStr(StartUnits)); 207 210 end; -
trunk/Languages/xtactics.cs.po
r281 r282 678 678 msgstr "Počátečních jednotek:" 679 679 680 #: tformplayer.label6.caption 681 msgid "Nation:" 682 msgstr "" 683 680 684 #: tformplayers.aadd.caption 681 685 msgctxt "tformplayers.aadd.caption" … … 724 728 725 729 #: tformplayers.listview1.columns[3].caption 730 #, fuzzy 731 #| msgid "Start units" 726 732 msgctxt "tformplayers.listview1.columns[3].caption" 733 msgid "Nation" 734 msgstr "Počátečních jednotek" 735 736 #: tformplayers.listview1.columns[4].caption 737 #, fuzzy 738 #| msgid "Start units" 739 msgctxt "tformplayers.listview1.columns[4].caption" 727 740 msgid "Start units" 728 741 msgstr "Počátečních jednotek" … … 1310 1323 msgid "64-bit UInt read overflow." 1311 1324 msgstr "Přetečení při čtení 64-bit UInt" 1325 -
trunk/Languages/xtactics.po
r281 r282 665 665 msgstr "" 666 666 667 #: tformplayer.label6.caption 668 msgid "Nation:" 669 msgstr "" 670 667 671 #: tformplayers.aadd.caption 668 672 msgctxt "tformplayers.aadd.caption" … … 709 713 710 714 #: tformplayers.listview1.columns[3].caption 715 msgctxt "tformplayers.listview1.columns[3].caption" 716 msgid "Nation" 717 msgstr "" 718 719 #: tformplayers.listview1.columns[4].caption 720 msgctxt "tformplayers.listview1.columns[4].caption" 711 721 msgid "Start units" 712 722 msgstr "" -
trunk/UCore.pas
r281 r282 9 9 UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator, 10 10 URegistry, ULastOpenedList, UTheme, Registry, Menus, UFormClient, UPlayer, 11 UGameServer, UGameClient, fgl, UServerList, UGameSystem, UUnit ;11 UGameServer, UGameClient, fgl, UServerList, UGameSystem, UUnit, Graphics; 12 12 13 13 type … … 118 118 Core: TCore; 119 119 120 const 121 clOrange = $009Aff; 122 clBrown = $a52A2A; 123 120 124 121 125 implementation … … 517 521 PreferedMapType := mtNone; 518 522 MaxPlayerCount := 3; 523 with Nations.AddNew('Nation 1') do begin 524 Color := clBlue; 525 end; 526 with Nations.AddNew('Nation 2') do begin 527 Color := clRed; 528 end; 529 with Nations.AddNew('Nation 3') do begin 530 Color := clGreen; 531 end; 532 with Nations.AddNew('Nation 4') do begin 533 Color := clOrange; 534 end; 535 with Nations.AddNew('Nation 5') do begin 536 Color := clPurple; 537 end; 538 with Nations.AddNew('Nation 6') do begin 539 Color := clMaroon; 540 end; 541 with Nations.AddNew('Nation 7') do begin 542 Color := clAqua; 543 end; 544 with Nations.AddNew('Nation 8') do begin 545 Color := clFuchsia; 546 end; 519 547 with UnitKinds.AddNew('Unit') do begin 520 548 Moves := 1; … … 525 553 with GameSystems.AddNew('HexWars') do begin 526 554 PreferedMapType := mtHexagonVertical; 527 MaxPlayerCount := 3; 555 UnitsMoveImmediately := False; 556 MaxPlayerCount := 8; 557 with Nations.AddNew('Nation 1') do begin 558 Color := clBlue; 559 end; 560 with Nations.AddNew('Nation 2') do begin 561 Color := clRed; 562 end; 563 with Nations.AddNew('Nation 3') do begin 564 Color := clGreen; 565 end; 566 with Nations.AddNew('Nation 4') do begin 567 Color := clOrange; 568 end; 569 with Nations.AddNew('Nation 5') do begin 570 Color := clPurple; 571 end; 572 with Nations.AddNew('Nation 6') do begin 573 Color := clMaroon; 574 end; 575 with Nations.AddNew('Nation 7') do begin 576 Color := clAqua; 577 end; 578 with Nations.AddNew('Nation 8') do begin 579 Color := clFuchsia; 580 end; 528 581 with UnitKinds.AddNew('Unit') do begin 529 582 Moves := 1; … … 534 587 with GameSystems.AddNew('Civilization I') do begin 535 588 PreferedMapType := mtSquare; 589 UnitsMoveImmediately := True; 590 MaxPlayerCount := 3; 591 with Nations.AddNew('Americans') do begin 592 Color := clFuchsia; 593 end; 594 with UnitKinds.AddNew('Scout') do begin 595 Moves := 1; 596 Power := 1; 597 end; 598 with UnitKinds.AddNew('Settler') do begin 599 Moves := 1; 600 Power := 1; 601 end; 602 end; 603 604 with GameSystems.AddNew('Civilization II') do begin 605 PreferedMapType := mtIsometric; 606 UnitsMoveImmediately := True; 536 607 MaxPlayerCount := 3; 537 608 with UnitKinds.AddNew('Scout') do begin … … 545 616 end; 546 617 547 with GameSystems.AddNew('Civilization II ') do begin618 with GameSystems.AddNew('Civilization III') do begin 548 619 PreferedMapType := mtIsometric; 620 UnitsMoveImmediately := True; 549 621 MaxPlayerCount := 3; 550 622 with UnitKinds.AddNew('Scout') do begin … … 558 630 end; 559 631 560 with GameSystems.AddNew('Civilization I II') do begin632 with GameSystems.AddNew('Civilization IV') do begin 561 633 PreferedMapType := mtIsometric; 634 UnitsMoveImmediately := True; 562 635 MaxPlayerCount := 3; 563 636 with UnitKinds.AddNew('Scout') do begin … … 571 644 end; 572 645 573 with GameSystems.AddNew('Civilization IV') do begin 574 PreferedMapType := mtIsometric; 646 with GameSystems.AddNew('Civilization V') do begin 647 PreferedMapType := mtHexagonHorizontal; 648 UnitsMoveImmediately := True; 575 649 MaxPlayerCount := 3; 576 650 with UnitKinds.AddNew('Scout') do begin … … 584 658 end; 585 659 586 with GameSystems.AddNew('Civilization V ') do begin660 with GameSystems.AddNew('Civilization VI') do begin 587 661 PreferedMapType := mtHexagonHorizontal; 662 UnitsMoveImmediately := True; 588 663 MaxPlayerCount := 3; 589 664 with UnitKinds.AddNew('Scout') do begin … … 597 672 end; 598 673 599 with GameSystems.AddNew('Civilization VI') do begin600 PreferedMapType := mtHexagonHorizontal;601 MaxPlayerCount := 3;602 with UnitKinds.AddNew('Scout') do begin603 Moves := 1;604 Power := 1;605 end;606 with UnitKinds.AddNew('Settler') do begin607 Moves := 1;608 Power := 1;609 end;610 end;611 612 674 with GameSystems.AddNew('Dune 2') do begin 613 675 PreferedMapType := mtSquare; 676 UnitsMoveImmediately := True; 614 677 MaxPlayerCount := 3; 678 with Nations.AddNew('Attreides') do begin 679 Color := clBlue; 680 end; 681 with Nations.AddNew('Harkonen') do begin 682 Color := clRed; 683 end; 684 with Nations.AddNew('Ordos') do begin 685 Color := clGreen; 686 end; 687 with Nations.AddNew('Fremens') do begin 688 Color := clBrown; 689 end; 690 with Nations.AddNew('Sardaukers') do begin 691 Color := clPurple; 692 end; 693 with Nations.AddNew('Merceneries') do begin 694 Color := clOrange; 695 end; 615 696 with UnitKinds.AddNew('Light Infantry') do begin 616 697 Moves := 1; … … 629 710 with GameSystems.AddNew('Battle Isle 2') do begin 630 711 PreferedMapType := mtHexagonHorizontal; 712 UnitsMoveImmediately := True; 631 713 MaxPlayerCount := 8; 632 714 with UnitKinds.AddNew('Demon 132') do begin … … 650 732 with GameSystems.AddNew('Panzer General') do begin 651 733 PreferedMapType := mtHexagonHorizontal; 734 UnitsMoveImmediately := True; 652 735 MaxPlayerCount := 2; 736 with Nations.AddNew('Germany') do begin 737 Color := clBlue; 738 end; 739 with Nations.AddNew('Russia') do begin 740 Color := clRed; 741 end; 742 with Nations.AddNew('Alliance') do begin 743 Color := clGreen; 744 end; 653 745 with UnitKinds.AddNew('Rifle Team') do begin 654 746 Moves := 1; -
trunk/UGame.pas
r281 r282 118 118 119 119 const 120 clOrange = $009Aff;121 PlayerColors: array[0..7] of TColor = (clBlue, clRed, clGreen, clOrange,122 clPurple, clMaroon, clAqua, clFuchsia);123 120 ComputerAggroProbability: array[TComputerAgressivity] of Single = (0.9, 0.7, 0.5); 124 121 -
trunk/UGameSystem.pas
r281 r282 7 7 uses 8 8 Classes, SysUtils, fgl, UUnit, DOM, XMLRead, XMLWrite, UXMLUtils, XMLConf, 9 FileUtil, UMapType ;9 FileUtil, UMapType, UNation; 10 10 11 11 type … … 22 22 UnitsMoveImmediately: Boolean; 23 23 PreferedMapType: TMapType; 24 Nations: TNations; 24 25 constructor Create; 25 26 destructor Destroy; override; … … 75 76 begin 76 77 UnitKinds := TUnitKinds.Create; 78 Nations := TNations.Create; 77 79 end; 78 80 79 81 destructor TGameSystem.Destroy; 80 82 begin 83 Nations.Free; 81 84 UnitKinds.Free; 82 85 inherited Destroy; … … 86 89 begin 87 90 UnitKinds.Clear; 91 Nations.Clear; 88 92 end; 89 93 … … 102 106 PreferedMapType := Source.PreferedMapType; 103 107 UnitKinds.Assign(Source.UnitKinds); 108 Nations.Assign(Source.Nations); 104 109 end; 105 110 … … 116 121 if Assigned(NewNode) then 117 122 UnitKinds.LoadFromNode(NewNode); 123 NewNode := Node.FindNode('Nations'); 124 if Assigned(NewNode) then 125 Nations.LoadFromNode(NewNode); 118 126 end; 119 127 … … 130 138 Node.AppendChild(NewNode); 131 139 UnitKinds.SaveToNode(NewNode); 140 NewNode := Node.OwnerDocument.CreateElement('Nations'); 141 Node.AppendChild(NewNode); 142 Nations.SaveToNode(NewNode); 132 143 end; 133 144 -
trunk/UPlayer.pas
r274 r282 7 7 uses 8 8 Classes, SysUtils, Graphics, UMap, DOM, fgl, XMLConf, UXMLUtils, Math, 9 UGeometry, UUnit ;9 UGeometry, UUnit, UNation; 10 10 11 11 type … … 120 120 Moves: TUnitMoves; 121 121 Units: TUnits; 122 Nation: TNation; 122 123 function IsAllowedMoveTarget(CellFrom, CellTo: TPlayerCell): Boolean; 123 124 procedure ReduceMovesPower; … … 895 896 Agressivity := Source.Agressivity; 896 897 Defensive := Source.Defensive; 898 Nation := Source.Nation; 897 899 end; 898 900 … … 906 908 Defensive := GetValue(DOMString(Path + '/Defensive'), False); 907 909 Agressivity := TComputerAgressivity(GetValue(DOMString(Path + '/Agressivity'), 0)); 910 Nation := TGame(Game).GameSystem.Nations.FindById(GetValue(DOMString(Path + '/Nation'), 0)); 908 911 end; 909 912 end; … … 918 921 SetValue(DOMString(Path + '/Defensive'), Defensive); 919 922 SetValue(DOMString(Path + '/Agressivity'), Integer(Agressivity)); 923 if Assigned(Nation) then 924 SetValue(DOMString(Path + '/Nation'), Nation.Id) 925 else SetValue(DOMString(Path + '/Nation'), 0) 920 926 end; 921 927 end; -
trunk/xtactics.lpi
r279 r282 109 109 </Item7> 110 110 </RequiredPackages> 111 <Units Count="4 1">111 <Units Count="42"> 112 112 <Unit0> 113 113 <Filename Value="xtactics.lpr"/> … … 334 334 <ResourceBaseClass Value="Form"/> 335 335 </Unit40> 336 <Unit41> 337 <Filename Value="UNation.pas"/> 338 <IsPartOfProject Value="True"/> 339 </Unit41> 336 340 </Units> 337 341 </ProjectOptions>
Note:
See TracChangeset
for help on using the changeset viewer.