void CLightDlg::UpdateDialog(bool updateChecks) { CString title; lightInfo.Defaults(); lightInfoOriginal.Defaults(); if (com_editorActive) { // used from Radiant entity_t *e = SingleLightSelected(); if (e) { lightInfo.FromDict(&e->epairs); lightInfoOriginal.FromDict(&e->epairs); //our original copy of the values that we compare against for apply differences title = "Light Editor"; } else { //find the last brush belonging to the last entity selected and use that as the source e = NULL; for (brush_t *b = selected_brushes.next ; b != &selected_brushes ; b = b->next) { if ((b->owner->eclass->nShowFlags & ECLASS_LIGHT) && !b->entityModel) { e = b->owner; break; } } if (e) { lightInfo.FromDict(&e->epairs); lightInfoOriginal.FromDict(&e->epairs); //our original copy of the values that we compaer against for apply differences title = "Light Editor - (Multiple lights selected)"; } else { title = "Light Editor - (No lights selected)"; } } } else { // used in-game idList<idEntity *> list; list.SetNum(128); int count = gameEdit->GetSelectedEntities(list.Ptr(), list.Num()); list.SetNum(count); if (count > 0) { lightInfo.FromDict(gameEdit->EntityGetSpawnArgs(list[count-1])); title = "Light Editor"; } else { title = "Light Editor - (No entities selected)"; } } SetWindowText(title); UpdateDialogFromLightInfo(); ColorButtons(); if (updateChecks) { EnableControls(); } }
void CLightDlg::OnCheckCenter() { if (reinterpret_cast<CButton*>(GetDlgItem(IDC_CHECK_CENTER))->GetCheck()) { lightInfo.hasCenter = true; lightInfo.lightCenter.x = 0; lightInfo.lightCenter.y = 0; lightInfo.lightCenter.z = 32; } else { lightInfo.hasCenter = false; lightInfo.lightCenter.Zero(); } UpdateDialogFromLightInfo(); SetSpecifics(); }
void CLightDlg::OnCheckParallel() { if ( reinterpret_cast<CButton*>(GetDlgItem(IDC_CHECK_PARALLEL))->GetCheck() ) { lightInfo.hasCenter = true; lightInfo.isParallel = true; lightInfo.lightCenter.x = 0; lightInfo.lightCenter.y = 0; lightInfo.lightCenter.z = 32; } else { lightInfo.isParallel = false; lightInfo.hasCenter = false; } UpdateDialogFromLightInfo(); SetSpecifics(); }
void CLightDlg::OnCheckProjected() { lightInfo.DefaultProjected(); UpdateDialogFromLightInfo(); EnableControls(); }