diff options
author | Thanasis Antoniou | 2019-09-05 10:37:47 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-09-05 10:39:51 +0300 |
commit | 5941ab78584147a751602b4a90061899fb63e0b2 (patch) | |
tree | 32ca34f767fd4a9916730bac6ae09a1cf371904a /engines/bladerunner/ui | |
parent | b04be6f9e1e50f93fb9a57471907d5789c93e120 (diff) | |
download | scummvm-rg350-5941ab78584147a751602b4a90061899fb63e0b2.tar.gz scummvm-rg350-5941ab78584147a751602b4a90061899fb63e0b2.tar.bz2 scummvm-rg350-5941ab78584147a751602b4a90061899fb63e0b2.zip |
BLADERUNNER: Fix displaying of clues in KIA
Fixes bug where clues with no type would appear in KIA sections
"End of Act 2" would appear in Sadik's and Clovis' suspect pages, and in Bradbury crime page, whereas Sadik's photo would not appear in Sadik's page.
Diffstat (limited to 'engines/bladerunner/ui')
-rw-r--r-- | engines/bladerunner/ui/kia_section_clues.cpp | 22 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_crimes.cpp | 22 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_suspects.cpp | 11 |
3 files changed, 30 insertions, 25 deletions
diff --git a/engines/bladerunner/ui/kia_section_clues.cpp b/engines/bladerunner/ui/kia_section_clues.cpp index d4437f728b..9b9f6b7c00 100644 --- a/engines/bladerunner/ui/kia_section_clues.cpp +++ b/engines/bladerunner/ui/kia_section_clues.cpp @@ -57,7 +57,7 @@ KIASectionClues::KIASectionClues(BladeRunnerEngine *vm, ActorClues *clues) : KIA _buttons = new UIImagePicker(_vm, 2); - _cluesScrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, _vm->_gameInfo->getClueCount(), 1, false, Common::Rect(312, 172, 500, 376), Common::Rect(506, 160, 506, 394)); + _cluesScrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, kClueCount, 1, false, Common::Rect(312, 172, 500, 376), Common::Rect(506, 160, 506, 394)); _uiContainer->add(_cluesScrollBox); _filterScrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, 128, 1, false, Common::Rect(142, 162, 291, 376), Common::Rect(120, 160, 120, 370)); @@ -283,9 +283,10 @@ void KIASectionClues::populateFilters() { }; for (int i = 0; i < kClueCount; ++i) { - if (_clues->isAcquired(i)) { - int assetType = _vm->_crimesDatabase->getAssetType(i); - int crimeId = _vm->_crimesDatabase->getCrime(i); + int clueId = _clues->getClueIdByIndex(i); + if (_clues->isAcquired(clueId)) { + int assetType = _vm->_crimesDatabase->getAssetType(clueId); + int crimeId = _vm->_crimesDatabase->getCrime(clueId); if (_debugIntangible || assetType != -1) { availableFilters[getLineIdForAssetType(assetType)] = true; availableFilters[getLineIdForCrimeId(crimeId)] = true; @@ -382,18 +383,19 @@ void KIASectionClues::populateFilters() { void KIASectionClues::populateClues() { _cluesScrollBox->clearLines(); for (int i = 0; i < kClueCount; ++i) { - if (_clues->isAcquired(i)) { - int assetType = _vm->_crimesDatabase->getAssetType(i); - int crimeId = _vm->_crimesDatabase->getCrime(i); + int clueId = _clues->getClueIdByIndex(i); + if (_clues->isAcquired(clueId)) { + int assetType = _vm->_crimesDatabase->getAssetType(clueId); + int crimeId = _vm->_crimesDatabase->getCrime(clueId); if (assetType != -1 || _debugIntangible) { if (_filters[getLineIdForAssetType(assetType)] && _filters[getLineIdForCrimeId(crimeId)]) { int flags = 0x30; - if (_clues->isPrivate(i)) { + if (_clues->isPrivate(clueId)) { flags = 0x08; - } else if (_clues->isViewed(i)) { + } else if (_clues->isViewed(clueId)) { flags = 0x10; } - _cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(i), i, flags); + _cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(clueId), clueId, flags); } } } diff --git a/engines/bladerunner/ui/kia_section_crimes.cpp b/engines/bladerunner/ui/kia_section_crimes.cpp index 6369a8f3f4..9061fff78b 100644 --- a/engines/bladerunner/ui/kia_section_crimes.cpp +++ b/engines/bladerunner/ui/kia_section_crimes.cpp @@ -287,9 +287,10 @@ void KIASectionCrimes::onButtonPressed(int buttonId) { void KIASectionCrimes::populateAcquiredClues() { _acquiredClueCount = 0; for (int i = 0; i < kClueCount; ++i) { - if (_clues->isAcquired(i)) { - _acquiredClues[_acquiredClueCount].clueId = i; - _acquiredClues[_acquiredClueCount].actorId = _clues->getFromActorId(i); + int clueId = _clues->getClueIdByIndex(i); + if (_clues->isAcquired(clueId)) { + _acquiredClues[_acquiredClueCount].clueId = clueId; + _acquiredClues[_acquiredClueCount].actorId = _clues->getFromActorId(clueId); ++_acquiredClueCount; } } @@ -375,18 +376,19 @@ void KIASectionCrimes::populateSuspects() { void KIASectionCrimes::populateVisibleClues() { _cluesScrollBox->clearLines(); if (_crimeSelected != -1) { - for (uint i = 0; i < _vm->_gameInfo->getClueCount(); ++i) { - if (_vm->_crimesDatabase->getAssetType(i) != -1 - && _vm->_crimesDatabase->getCrime(i) == _crimeSelected - && _clues->isAcquired(i) + for (uint i = 0; i < kClueCount; ++i) { + int clueId = _clues->getClueIdByIndex(i); + if (_vm->_crimesDatabase->getAssetType(clueId) != -1 + && _vm->_crimesDatabase->getCrime(clueId) == _crimeSelected + && _clues->isAcquired(clueId) ) { int flags = 0x30; - if (_clues->isPrivate(i)) { + if (_clues->isPrivate(clueId)) { flags = 0x08; - } else if (_clues->isViewed(i)) { + } else if (_clues->isViewed(clueId)) { flags = 0x10; } - _cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(i), i, flags); + _cluesScrollBox->addLine(_vm->_crimesDatabase->getClueText(clueId), clueId, flags); } } _cluesScrollBox->sortLines(); diff --git a/engines/bladerunner/ui/kia_section_suspects.cpp b/engines/bladerunner/ui/kia_section_suspects.cpp index cfe3fc3252..ba1f6a5f7f 100644 --- a/engines/bladerunner/ui/kia_section_suspects.cpp +++ b/engines/bladerunner/ui/kia_section_suspects.cpp @@ -66,7 +66,7 @@ KIASectionSuspects::KIASectionSuspects(BladeRunnerEngine *vm, ActorClues *clues) _replicantCheckBox = new UICheckBox(_vm, checkBoxCallback, this, Common::Rect(142, 338, 275, 348), 1, _replicantFilter); _nonReplicantCheckBox = new UICheckBox(_vm, checkBoxCallback, this, Common::Rect(142, 348, 275, 358), 1, _nonReplicantFilter); _othersCheckBox = new UICheckBox(_vm, checkBoxCallback, this, Common::Rect(142, 358, 275, 368), 1, _othersFilter); - _cluesScrollBox = new UIScrollBox(_vm, scrollBoxCallback, this,_vm->_gameInfo->getClueCount(), 1, false, Common::Rect(312, 172, 500, 376), Common::Rect(506, 160, 506, 394)); + _cluesScrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, kClueCount, 1, false, Common::Rect(312, 172, 500, 376), Common::Rect(506, 160, 506, 394)); _crimesScrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, 50, 1, false, Common::Rect(154, 258, 291, 298), Common::Rect(120, 249, 120, 297)); _uiContainer->add(_whereaboutsCheckBox); _uiContainer->add(_MOCheckBox); @@ -380,9 +380,10 @@ void KIASectionSuspects::onButtonPressed(int buttonId) { void KIASectionSuspects::populateAcquiredClues() { _acquiredClueCount = 0; for (int i = 0; i < kClueCount; ++i) { - if (_clues->isAcquired(i)) { - _acquiredClues[_acquiredClueCount].clueId = i; - _acquiredClues[_acquiredClueCount].actorId = _clues->getFromActorId(i); + int clueId = _clues->getClueIdByIndex(i); + if (_clues->isAcquired(clueId)) { + _acquiredClues[_acquiredClueCount].clueId = clueId; + _acquiredClues[_acquiredClueCount].actorId = _clues->getFromActorId(clueId); ++_acquiredClueCount; } } @@ -453,7 +454,7 @@ void KIASectionSuspects::populateVisibleClues() { for (int i = 0; i < _acquiredClueCount; ++i) { int clueId = _acquiredClues[i].clueId; - if (_vm->_crimesDatabase->getAssetType(i) != -1) { + if (_vm->_crimesDatabase->getAssetType(clueId) != -1) { SuspectDatabaseEntry *suspect = _vm->_suspectsDatabase->get(_suspectSelected); bool showClue = false; |