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

Method OnOK

editor/AmbientSoundPattern.cpp:310–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void CAmbientSoundPattern::OnOK() {
311 // Verify probabilities
312 for (int p = 0; p < Num_ambient_sound_patterns; p++) {
313 asp *asp = &Ambient_sound_patterns[p];
314 if (asp->num_sounds) {
315 int prob = 0;
316
317 for (int s = 0; s < asp->num_sounds; s++)
318 prob += asp->sounds[s].probability;
319
320 if (prob != 100) {
321 OutrageMessageBox("Error: the probabilities for pattern '%s' don't add up to 100.", asp->name);
322 return;
323 }
324 }
325 }
326
327 // Update the data
328 WriteAmbientData();
329
330 CDialog::OnOK();
331}
332
333void CAmbientSoundPattern::OnASPLock() {
334 int n;

Callers

nothing calls this directly

Calls 2

OutrageMessageBoxFunction · 0.85
WriteAmbientDataFunction · 0.85

Tested by

no test coverage detected