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

Method OnInitDialog

editor/ObjectDialog.cpp:465–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465BOOL CObjectDialog::OnInitDialog() {
466 CComboBox *box;
467 int current;
468
469 CDialog::OnInitDialog();
470
471 // Init types combo box
472 InitObjTypeComboBox((CComboBox *)GetDlgItem(IDC_COMBO_OBJTYPE));
473
474 // Init IDs combo box
475 InitObjIDComboBox((CComboBox *)GetDlgItem(IDC_COMBO_OBJID));
476
477 // Get index of current item
478 current = GetCurrentIndex();
479 ASSERT(current != -1);
480
481 // set selection in object movement combobox and move axis.
482 box = (CComboBox *)GetDlgItem(IDC_COORDSYS_SELECT);
483 if (D3EditState.object_move_mode == REL_OBJECT)
484 box->SelectString(-1, "Local");
485 else if (D3EditState.object_move_mode == REL_VIEWER)
486 box->SelectString(-1, "Viewer");
487 else {
488 D3EditState.object_move_mode = REL_OBJECT;
489 box->SelectString(-1, "Local");
490 }
491
492 ObjMoveManager.SetMoveAxis(D3EditState.object_move_axis);
493
494 CButton *btn = NULL;
495
496 switch (D3EditState.object_move_axis) {
497 case OBJMOVEAXIS_X:
498 btn = (CButton *)GetDlgItem(IDC_OBJMOVEX);
499 break;
500 case OBJMOVEAXIS_Y:
501 btn = (CButton *)GetDlgItem(IDC_OBJMOVEY);
502 break;
503 case OBJMOVEAXIS_Z:
504 btn = (CButton *)GetDlgItem(IDC_OBJMOVEZ);
505 break;
506 case OBJMOVEAXIS_XY:
507 btn = (CButton *)GetDlgItem(IDC_OBJMOVEXY);
508 break;
509 case OBJMOVEAXIS_P:
510 btn = (CButton *)GetDlgItem(IDC_OBJMOVEP);
511 break;
512 case OBJMOVEAXIS_H:
513 btn = (CButton *)GetDlgItem(IDC_OBJMOVEH);
514 break;
515 case OBJMOVEAXIS_B:
516 btn = (CButton *)GetDlgItem(IDC_OBJMOVEB);
517 break;
518 case OBJMOVEAXIS_PH:
519 btn = (CButton *)GetDlgItem(IDC_OBJMOVEPH);
520 break;
521
522 default:

Callers

nothing calls this directly

Calls 3

GetCurrentIndexFunction · 0.85
SetMoveAxisMethod · 0.80
SetCheckMethod · 0.80

Tested by

no test coverage detected