| 407 | } |
| 408 | |
| 409 | void TransactionScreen::updateFormValues(bool queueHighlightUpdate) |
| 410 | { |
| 411 | int leftIndex = getLeftIndex(); |
| 412 | int rightIndex = getRightIndex(); |
| 413 | |
| 414 | // Crew |
| 415 | lqDelta = 0; |
| 416 | lq2Delta = 0; |
| 417 | |
| 418 | // Update storage |
| 419 | cargoDelta = 0; |
| 420 | cargo2Delta = 0; |
| 421 | bioDelta = 0; |
| 422 | bio2Delta = 0; |
| 423 | moneyDelta = 0; |
| 424 | |
| 425 | for (auto &l : transactionControls) |
| 426 | { |
| 427 | for (auto &c : l.second) |
| 428 | { |
| 429 | // if this control is linked to others, only update calculations for one control of the |
| 430 | // linked group |
| 431 | // if this control is not linked, update calculations |
| 432 | if (!c->getLinked() || c->getLinked()->front().lock() == c) |
| 433 | { |
| 434 | lqDelta += c->getCrewDelta(leftIndex); |
| 435 | lq2Delta += c->getCrewDelta(rightIndex); |
| 436 | cargoDelta += c->getCargoDelta(leftIndex); |
| 437 | bioDelta += c->getBioDelta(leftIndex); |
| 438 | cargo2Delta += c->getCargoDelta(rightIndex); |
| 439 | bio2Delta += c->getBioDelta(rightIndex); |
| 440 | moneyDelta += c->getPriceDelta(); |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | if (queueHighlightUpdate) |
| 446 | { |
| 447 | framesUntilHighlightUpdate = HIGHLIGHT_UPDATE_DELAY; |
| 448 | } |
| 449 | else |
| 450 | { |
| 451 | updateBaseHighlight(); |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | void TransactionScreen::updateBaseHighlight() |
| 456 | { |
no test coverage detected