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

Method OnSelchangeComboObjID

editor/ObjectDialog.cpp:741–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741void CObjectDialog::OnSelchangeComboObjID() {
742 CComboBox *box = (CComboBox *)GetDlgItem(IDC_COMBO_OBJID);
743
744 switch (D3EditState.current_obj_type) {
745 case OBJ_ROBOT:
746 case OBJ_POWERUP:
747 case OBJ_BUILDING:
748 case OBJ_CLUTTER: {
749 int id = box->GetItemData(box->GetCurSel());
750 ASSERT(Object_info[id].type == D3EditState.current_obj_type);
751 SetCurrentIndex(id);
752 break;
753 }
754
755 case OBJ_PLAYER: {
756 char text[32];
757 int i, j;
758 box->GetLBText(box->GetCurSel(), text);
759 j = 0;
760 for (i = 0; i < MAX_SHIPS; i++)
761 if (Ships[i].used && (stricmp(text, Ships[i].name) == 0)) {
762 j++;
763 break;
764 }
765
766 ASSERT(i < MAX_SHIPS);
767 SetCurrentIndex(i);
768 break;
769 }
770 }
771
772 // Draw picture of current item
773 DrawPicture(GetDlgItem(IDC_OBJ_PALETTE));
774}
775
776void CObjectDialog::OnObjPadDelobj() { HObjectDelete(); }
777

Callers

nothing calls this directly

Calls 1

SetCurrentIndexFunction · 0.85

Tested by

no test coverage detected