void Encounter::OnMainMenuButtonClicked(int id) { int originalId = id; // No buttons are in the list for conversations that aren't available, // so we want to bump up the ID to account for these. for (int i = 0; i <= id; i++) { Conversation *pConversation = allConversationList[i]; if (!pConversation->GetIsEnabled() || (pConversation->GetDisappearsAfterCompleted() && pConversation->GetHasBeenCompleted())) { id++; } } PrepNextConversation(allConversationList[id], originalId); }
void Encounter::RefreshButtonArrayContents() { vector<ButtonArrayLoadParameters> loadParametersList; for (unsigned int i = 0; i < conversationList.size(); i++) { Conversation *pConversation = conversationList[i]; if (pConversation->GetIsEnabled()) { ButtonArrayLoadParameters loadParameters; loadParameters.text = pConversation->GetName(); if (pConversation->GetIsLocked()) { loadParameters.lockCount = pConversation->GetLockCount(); } loadParameters.unlockedLockCount = 0; vector<Conversation::UnlockCondition *> *pUnlockConditions = pConversation->GetUnlockConditions(); for (unsigned int i = 0; i < pUnlockConditions->size(); i++) { Conversation::UnlockCondition *pUnlockCondition = (*pUnlockConditions)[i]; if (pUnlockCondition->GetIsConditionMet() && !pUnlockCondition->GetHasHandledMetCondition()) { loadParameters.unlockedLockCount++; pUnlockCondition->SetHasHandledMetCondition(true); } } loadParameters.showCheckBox = pConversation->GetHasBeenCompleted(); loadParametersList.push_back(loadParameters); } } for (unsigned int i = 0; i < interrogationList.size(); i++) { Interrogation *pInterrogation = interrogationList[i]; if (!pInterrogation->GetHasBeenCompleted()) { if (pInterrogation->GetIsEnabled()) { ButtonArrayLoadParameters loadParameters; char text[256]; snprintf(text, 256, gpLocalizableContent->GetText("Encounter/InterrogationDesignationFormatText").c_str(), pInterrogation->GetName().c_str()); loadParameters.text = string(text); loadParametersList.push_back(loadParameters); } } } for (unsigned int i = 0; i < confrontationList.size(); i++) { Confrontation *pConfrontation = confrontationList[i]; if (!pConfrontation->GetHasBeenCompleted()) { if (pConfrontation->GetIsEnabled()) { ButtonArrayLoadParameters loadParameters; char text[256]; snprintf(text, 256, gpLocalizableContent->GetText("Encounter/ConfrontationDesignationFormatText").c_str(), pConfrontation->GetName().c_str()); loadParameters.text = string(text); loadParametersList.push_back(loadParameters); } } } pMainMenuButtonArray->Load(loadParametersList); pPresentEvidenceTab->SetIsEnabled(Case::GetInstance()->GetEvidenceManager()->GetHasEvidence()); }