MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / save

Method save

plugins/dm.objectives/ComponentsDialog.cpp:331–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void 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
371int ComponentsDialog::ShowModal()
372{

Callers

nothing calls this directly

Calls 2

writeToObjectiveMethod · 0.80
GetValueMethod · 0.45

Tested by

no test coverage detected