| 329 | } |
| 330 | |
| 331 | void ComponentsDialog::save() |
| 332 | { |
| 333 | // Write the objective properties |
| 334 | _objective.description = _objDescriptionEntry->GetValue().ToStdString(); |
| 335 | |
| 336 | // Save the difficulty settings |
| 337 | _diffPanel->writeToObjective(_objective); |
| 338 | |
| 339 | // Set the initial state enum value from the combo box index |
| 340 | _objective.state = static_cast<Objective::State>( |
| 341 | wxutil::ChoiceHelper::GetSelectionId(_objStateCombo)); |
| 342 | |
| 343 | // Determine which checkbox is toggled, then update the appropriate flag |
| 344 | _objective.mandatory = _objMandatoryFlag->GetValue(); |
| 345 | _objective.visible = _objVisibleFlag->GetValue(); |
| 346 | _objective.ongoing = _objOngoingFlag->GetValue(); |
| 347 | _objective.irreversible = _objIrreversibleFlag->GetValue(); |
| 348 | |
| 349 | // Enabling objectives |
| 350 | _objective.enablingObjs = _enablingObjs->GetValue(); |
| 351 | |
| 352 | // Success/failure logic |
| 353 | _objective.logic.successLogic = _successLogic->GetValue(); |
| 354 | _objective.logic.failureLogic = _failureLogic->GetValue(); |
| 355 | |
| 356 | // Completion/Failure script |
| 357 | _objective.completionScript = _completionScript->GetValue(); |
| 358 | _objective.failureScript = _failureScript->GetValue(); |
| 359 | |
| 360 | // Completion/Failure targets |
| 361 | _objective.completionTarget = _completionTarget->GetValue(); |
| 362 | _objective.failureTarget = _failureTarget->GetValue(); |
| 363 | |
| 364 | // Write the components |
| 365 | checkWriteComponent(); |
| 366 | |
| 367 | // Copy the working set over the ones in the objective |
| 368 | _objective.components.swap(_components); |
| 369 | } |
| 370 | |
| 371 | int ComponentsDialog::ShowModal() |
| 372 | { |
nothing calls this directly
no test coverage detected