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

Method InitObjIDComboBox

editor/ObjectDialog.cpp:409–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407// CObjectDialog message handlers
408
409void 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
454void CObjectDialog::InitObjTypeComboBox(CComboBox *box) {
455 box->ResetContent();

Callers

nothing calls this directly

Calls 5

GetCurrentIndexFunction · 0.85
SetCurrentIndexFunction · 0.85
GetNextObjectIDFunction · 0.85
AddStringMethod · 0.80
GetObjectIDFunction · 0.50

Tested by

no test coverage detected