| 685 | } |
| 686 | |
| 687 | void CWorldObjectsPlayerDialog::UpdateDialog() { |
| 688 | CEdit *ebox; |
| 689 | CButton *bbox; |
| 690 | // CStatic *stext; |
| 691 | int n = D3EditState.current_ship; |
| 692 | char str[50]; |
| 693 | char txt[50]; |
| 694 | |
| 695 | if (Num_ships < 1) { |
| 696 | bbox = (CButton *)GetDlgItem(IDC_PSHIP_NEXT); |
| 697 | bbox->EnableWindow(FALSE); |
| 698 | bbox = (CButton *)GetDlgItem(IDC_PSHIP_PREV); |
| 699 | bbox->EnableWindow(FALSE); |
| 700 | bbox = (CButton *)GetDlgItem(IDC_PSHIP_COCKPIT); |
| 701 | bbox->EnableWindow(FALSE); |
| 702 | return; |
| 703 | } else { |
| 704 | bbox = (CButton *)GetDlgItem(IDC_PSHIP_NEXT); |
| 705 | bbox->EnableWindow(TRUE); |
| 706 | bbox = (CButton *)GetDlgItem(IDC_PSHIP_PREV); |
| 707 | bbox->EnableWindow(TRUE); |
| 708 | bbox = (CButton *)GetDlgItem(IDC_PSHIP_COCKPIT); |
| 709 | bbox->EnableWindow(TRUE); |
| 710 | } |
| 711 | |
| 712 | if (!Ships[n].used) |
| 713 | n = D3EditState.current_ship = GetNextShip(n); |
| 714 | |
| 715 | ebox = (CEdit *)GetDlgItem(IDC_PSHIP_NAME_EDIT); |
| 716 | ebox->SetWindowText(Ships[n].name); |
| 717 | |
| 718 | ebox = (CEdit *)GetDlgItem(IDC_PSHIP_MODEL_NAME_EDIT); |
| 719 | |
| 720 | if (m_lod == 0) |
| 721 | ebox->SetWindowText(Poly_models[Ships[n].model_handle].name); |
| 722 | else if (m_lod == 1) { |
| 723 | if (Ships[n].med_render_handle == -1) |
| 724 | ebox->SetWindowText("No model defined"); |
| 725 | else |
| 726 | ebox->SetWindowText(Poly_models[Ships[n].med_render_handle].name); |
| 727 | } else { |
| 728 | if (Ships[n].lo_render_handle == -1) |
| 729 | ebox->SetWindowText("No model defined"); |
| 730 | else |
| 731 | ebox->SetWindowText(Poly_models[Ships[n].lo_render_handle].name); |
| 732 | } |
| 733 | |
| 734 | // Do LOD distance edit box |
| 735 | ebox = (CEdit *)GetDlgItem(IDC_LOD_DISTANCE_EDIT); |
| 736 | |
| 737 | if (m_lod == 0) |
| 738 | ebox->SetWindowText("0"); |
| 739 | else if (m_lod == 1) { |
| 740 | sprintf(txt, "%f", Ships[n].med_lod_distance); |
| 741 | ebox->SetWindowText(txt); |
| 742 | } else { |
| 743 | sprintf(txt, "%f", Ships[n].lo_lod_distance); |
| 744 | ebox->SetWindowText(txt); |
nothing calls this directly
no test coverage detected