Changeset 47 for trunk/Forms/UFormNewGame.pas
- Timestamp:
- Apr 24, 2019, 11:41:52 AM (6 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNewGame.pas
r46 r47 1 unit U NewGameForm;1 unit UFormNewGame; 2 2 3 3 {$mode delphi}{$H+} … … 11 11 type 12 12 13 { T NewGameForm}14 15 T NewGameForm= class(TForm)13 { TFormNewGame } 14 15 TFormNewGame = class(TForm) 16 16 ButtonStart: TButton; 17 17 ButtonCancel: TButton; 18 CheckBoxEnabled: TCheckBox; 18 19 ColorButton1: TColorButton; 19 20 ColorButton2: TColorButton; … … 35 36 Label9: TLabel; 36 37 ListView1: TListView; 38 procedure CheckBoxEnabledChange(Sender: TObject); 37 39 procedure ColorButton1ColorChanged(Sender: TObject); 38 40 procedure ColorButton2ColorChanged(Sender: TObject); … … 73 75 74 76 var 75 NewGameForm: TNewGameForm;77 FormNewGame: TFormNewGame; 76 78 77 79 … … 83 85 UCore; 84 86 85 { T NewGameForm}86 87 procedure T NewGameForm.ListView1Change(Sender: TObject; Item: TListItem;87 { TFormNewGame } 88 89 procedure TFormNewGame.ListView1Change(Sender: TObject; Item: TListItem; 88 90 Change: TItemChange); 89 91 begin … … 92 94 end; 93 95 94 procedure T NewGameForm.ListView1CustomDrawSubItem(Sender: TCustomListView;96 procedure TFormNewGame.ListView1CustomDrawSubItem(Sender: TCustomListView; 95 97 Item: TListItem; SubItem: Integer; State: TCustomDrawState; 96 98 var DefaultDraw: Boolean); … … 104 106 end; 105 107 106 procedure T NewGameForm.ListView1Data(Sender: TObject; Item: TListItem);108 procedure TFormNewGame.ListView1Data(Sender: TObject; Item: TListItem); 107 109 begin 108 110 if Item.Index < Players.Count then … … 116 118 end; 117 119 118 procedure T NewGameForm.ListView1SelectItem(Sender: TObject; Item: TListItem;120 procedure TFormNewGame.ListView1SelectItem(Sender: TObject; Item: TListItem; 119 121 Selected: Boolean); 120 122 begin … … 129 131 EditRight.Text := IntToStr(Keys.Right); 130 132 EditShoot.Text := IntToStr(Keys.Shoot); 133 CheckBoxEnabled.Checked := Enabled; 131 134 end; 132 135 UpdateInterface; 133 136 end; 134 137 135 procedure T NewGameForm.ReloadList;138 procedure TFormNewGame.ReloadList; 136 139 begin 137 140 ListView1.Items.Count := Players.Count; … … 139 142 end; 140 143 141 procedure T NewGameForm.UpdateInterface;144 procedure TFormNewGame.UpdateInterface; 142 145 begin 143 146 EditUp.Enabled := Assigned(ListView1.Selected); … … 149 152 ColorButton1.Enabled := Assigned(ListView1.Selected); 150 153 ColorButton2.Enabled := Assigned(ListView1.Selected); 151 end; 152 153 procedure TNewGameForm.LoadData(Engine: TEngine); 154 CheckBoxEnabled.Enabled := Assigned(ListView1.Selected); 155 end; 156 157 procedure TFormNewGame.LoadData(Engine: TEngine); 154 158 begin 155 159 Players.Assign(Engine.PlayerPool); 156 160 end; 157 161 158 procedure T NewGameForm.SaveData(Engine: TEngine);162 procedure TFormNewGame.SaveData(Engine: TEngine); 159 163 begin 160 164 Engine.PlayerPool.Assign(Players); 161 165 end; 162 166 163 procedure T NewGameForm.ColorButton1ColorChanged(Sender: TObject);167 procedure TFormNewGame.ColorButton1ColorChanged(Sender: TObject); 164 168 begin 165 169 if Assigned(ListView1.Selected) then … … 170 174 end; 171 175 172 procedure TNewGameForm.ColorButton2ColorChanged(Sender: TObject); 176 procedure TFormNewGame.CheckBoxEnabledChange(Sender: TObject); 177 begin 178 if Assigned(ListView1.Selected) then 179 with TPlayer(ListView1.Selected.Data) do begin 180 Enabled := CheckBoxEnabled.Checked; 181 ReloadList; 182 end; 183 end; 184 185 procedure TFormNewGame.ColorButton2ColorChanged(Sender: TObject); 173 186 begin 174 187 if Assigned(ListView1.Selected) then … … 179 192 end; 180 193 181 procedure T NewGameForm.EditDownChange(Sender: TObject);194 procedure TFormNewGame.EditDownChange(Sender: TObject); 182 195 var 183 196 Value: Integer; … … 190 203 end; 191 204 192 procedure T NewGameForm.EditDownKeyDown(Sender: TObject; var Key: Word;205 procedure TFormNewGame.EditDownKeyDown(Sender: TObject; var Key: Word; 193 206 Shift: TShiftState); 194 207 begin … … 196 209 end; 197 210 198 procedure T NewGameForm.EditLeftChange(Sender: TObject);211 procedure TFormNewGame.EditLeftChange(Sender: TObject); 199 212 var 200 213 Value: Integer; … … 207 220 end; 208 221 209 procedure T NewGameForm.EditLeftKeyDown(Sender: TObject; var Key: Word;222 procedure TFormNewGame.EditLeftKeyDown(Sender: TObject; var Key: Word; 210 223 Shift: TShiftState); 211 224 begin … … 213 226 end; 214 227 215 procedure T NewGameForm.EditNameChange(Sender: TObject);228 procedure TFormNewGame.EditNameChange(Sender: TObject); 216 229 begin 217 230 if Assigned(ListView1.Selected) then … … 222 235 end; 223 236 224 procedure T NewGameForm.EditRightChange(Sender: TObject);237 procedure TFormNewGame.EditRightChange(Sender: TObject); 225 238 var 226 239 Value: Integer; … … 233 246 end; 234 247 235 procedure T NewGameForm.EditRightKeyDown(Sender: TObject; var Key: Word;248 procedure TFormNewGame.EditRightKeyDown(Sender: TObject; var Key: Word; 236 249 Shift: TShiftState); 237 250 begin … … 239 252 end; 240 253 241 procedure T NewGameForm.EditShootChange(Sender: TObject);254 procedure TFormNewGame.EditShootChange(Sender: TObject); 242 255 var 243 256 Value: Integer; … … 250 263 end; 251 264 252 procedure T NewGameForm.EditShootKeyDown(Sender: TObject; var Key: Word;265 procedure TFormNewGame.EditShootKeyDown(Sender: TObject; var Key: Word; 253 266 Shift: TShiftState); 254 267 begin … … 256 269 end; 257 270 258 procedure T NewGameForm.EditUpChange(Sender: TObject);271 procedure TFormNewGame.EditUpChange(Sender: TObject); 259 272 var 260 273 Value: Integer; … … 267 280 end; 268 281 269 procedure T NewGameForm.EditUpKeyDown(Sender: TObject; var Key: Word;282 procedure TFormNewGame.EditUpKeyDown(Sender: TObject; var Key: Word; 270 283 Shift: TShiftState); 271 284 begin … … 273 286 end; 274 287 275 procedure T NewGameForm.FormCreate(Sender: TObject);288 procedure TFormNewGame.FormCreate(Sender: TObject); 276 289 begin 277 290 Core.CoolTranslator1.TranslateComponentRecursive(Self); … … 279 292 end; 280 293 281 procedure T NewGameForm.FormDestroy(Sender: TObject);294 procedure TFormNewGame.FormDestroy(Sender: TObject); 282 295 begin 283 296 FreeAndNil(Players); 284 297 end; 285 298 286 procedure T NewGameForm.FormShow(Sender: TObject);299 procedure TFormNewGame.FormShow(Sender: TObject); 287 300 begin 288 301 ReloadList;
Note:
See TracChangeset
for help on using the changeset viewer.