| 407 | // CObjectDialog message handlers |
| 408 | |
| 409 | void CObjectDialog::InitObjIDComboBox(CComboBox *box) { |
| 410 | int i, first, n; |
| 411 | |
| 412 | box->ResetContent(); |
| 413 | |
| 414 | // Add names of object IDs of current object type |
| 415 | switch (D3EditState.current_obj_type) { |
| 416 | case OBJ_ROBOT: |
| 417 | case OBJ_POWERUP: |
| 418 | case OBJ_CLUTTER: |
| 419 | case OBJ_BUILDING: |
| 420 | first = GetObjectID(D3EditState.current_obj_type); |
| 421 | |
| 422 | if (first == -1) |
| 423 | break; |
| 424 | |
| 425 | if (GetCurrentIndex() == -1) |
| 426 | SetCurrentIndex(first); |
| 427 | |
| 428 | n = first; |
| 429 | do { |
| 430 | int index = box->AddString(Object_info[n].name); |
| 431 | box->SetItemData(index, n); |
| 432 | |
| 433 | if (n == GetCurrentIndex()) |
| 434 | box->SetCurSel(index); |
| 435 | |
| 436 | n = GetNextObjectID(n); |
| 437 | } while (n != first); |
| 438 | |
| 439 | break; |
| 440 | |
| 441 | case OBJ_PLAYER: |
| 442 | for (i = 0; i < MAX_SHIPS; i++) { |
| 443 | if (Ships[i].used) { |
| 444 | int index = box->AddString(Ships[i].name); |
| 445 | box->SetItemData(index, i); |
| 446 | if (i == D3EditState.current_ship) |
| 447 | box->SetCurSel(index); |
| 448 | } |
| 449 | } |
| 450 | break; |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | void CObjectDialog::InitObjTypeComboBox(CComboBox *box) { |
| 455 | box->ResetContent(); |
nothing calls this directly
no test coverage detected