Changeset 282 for trunk/Forms
- Timestamp:
- Mar 10, 2019, 4:48:41 PM (6 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 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;
Note:
See TracChangeset
for help on using the changeset viewer.