MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UpdateDialog

Method UpdateDialog

editor/WorldWeaponsDialog.cpp:887–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885#define NULL_NAME "<none>"
886
887void CWorldWeaponsDialog::UpdateDialog() {
888 CEdit *ebox;
889 CButton *bbox;
890 int n = D3EditState.current_weapon;
891 char str[50];
892
893 if (Num_weapons < 1) {
894 bbox = (CButton *)GetDlgItem(IDC_NEXT_WEAPON);
895 bbox->EnableWindow(FALSE);
896 bbox = (CButton *)GetDlgItem(IDC_PREV_WEAPON);
897 bbox->EnableWindow(FALSE);
898
899 return;
900 } else {
901 bbox = (CButton *)GetDlgItem(IDC_NEXT_WEAPON);
902 bbox->EnableWindow(TRUE);
903 bbox = (CButton *)GetDlgItem(IDC_PREV_WEAPON);
904 bbox->EnableWindow(TRUE);
905 }
906
907 if (!Weapons[n].used)
908 n = D3EditState.current_weapon = GetNextWeapon(n);
909
910 ebox = (CEdit *)GetDlgItem(IDC_WEAPON_VCLIP_EDIT);
911 if (Weapons[n].flags & WF_HUD_ANIMATED)
912 ebox->SetWindowText(GameVClips[Weapons[n].hud_image_handle].name);
913 else
914 ebox->SetWindowText(GameBitmaps[Weapons[n].hud_image_handle].name);
915
916 ebox = (CEdit *)GetDlgItem(IDC_WEAPON_DISCHARGE_EDIT);
917
918 if (Weapons[n].flags & WF_IMAGE_BITMAP)
919 ebox->SetWindowText(GameBitmaps[Weapons[n].fire_image_handle].name);
920 else if (Weapons[n].flags & WF_IMAGE_VCLIP)
921 ebox->SetWindowText(GameVClips[Weapons[n].fire_image_handle].name);
922 else
923 ebox->SetWindowText(Poly_models[Weapons[n].fire_image_handle].name);
924
925 bbox = (CButton *)GetDlgItem(IDC_CHECKIN_WEAPON);
926 if (mng_FindTrackLock(Weapons[n].name, PAGETYPE_WEAPON) == -1) {
927 bbox->EnableWindow(FALSE);
928 bbox = (CButton *)GetDlgItem(IDC_LOCK_WEAPON);
929 bbox->EnableWindow(TRUE);
930 } else {
931 bbox->EnableWindow(TRUE);
932 bbox = (CButton *)GetDlgItem(IDC_LOCK_WEAPON);
933 bbox->EnableWindow(FALSE);
934 }
935
936 SendDlgItemMessage(IDC_WEAPON_PULLDOWN, CB_RESETCONTENT, 0, 0);
937
938 for (int i = 0; i < MAX_WEAPONS; i++) {
939 if (Weapons[i].used)
940 SendDlgItemMessage(IDC_WEAPON_PULLDOWN, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)Weapons[i].name);
941 }
942 SendDlgItemMessage(IDC_WEAPON_PULLDOWN, CB_SELECTSTRING, 0, (LPARAM)(LPCTSTR)Weapons[n].name);
943
944 SendDlgItemMessage(IDC_FIRE_SOUND_PULLDOWN, CB_RESETCONTENT, 0, 0);

Callers

nothing calls this directly

Calls 4

GetNextWeaponFunction · 0.85
mng_FindTrackLockFunction · 0.85
PageInPolymodelFunction · 0.85
ComputeDefaultSizeFunction · 0.85

Tested by

no test coverage detected