| 120 | void CUITalkWnd::NeedUpdateQuestions() { m_bNeedToUpdateQuestions = true; } |
| 121 | |
| 122 | void CUITalkWnd::UpdateQuestions() |
| 123 | { |
| 124 | UITalkDialogWnd->ClearQuestions(); |
| 125 | |
| 126 | //если нет активного диалога, то |
| 127 | //режима выбора темы |
| 128 | if (!m_pCurrentDialog) |
| 129 | { |
| 130 | m_pOurDialogManager->UpdateAvailableDialogs(m_pOthersDialogManager); |
| 131 | int number = 0; |
| 132 | for (u32 i = 0; i < m_pOurDialogManager->AvailableDialogs().size(); ++i) |
| 133 | { |
| 134 | const DIALOG_SHARED_PTR& phrase_dialog = m_pOurDialogManager->AvailableDialogs()[i]; |
| 135 | AddQuestion(phrase_dialog->DialogCaption(), phrase_dialog->GetDialogID(), number); |
| 136 | } |
| 137 | } |
| 138 | else |
| 139 | { |
| 140 | if (m_pCurrentDialog->IsWeSpeaking(m_pOurDialogManager)) |
| 141 | { |
| 142 | //если в списке допустимых фраз только одна фраза пустышка, то просто |
| 143 | //сказать (игрок сам не производит никаких действий) |
| 144 | if (!m_pCurrentDialog->PhraseList().empty() && m_pCurrentDialog->allIsDummy()) |
| 145 | { |
| 146 | CPhrase* phrase = m_pCurrentDialog->PhraseList()[Random.randI(m_pCurrentDialog->PhraseList().size())]; |
| 147 | SayPhrase(phrase->GetID()); |
| 148 | }; |
| 149 | |
| 150 | //выбор доступных фраз из активного диалога |
| 151 | if (m_pCurrentDialog && !m_pCurrentDialog->allIsDummy()) |
| 152 | { |
| 153 | int number = 0; |
| 154 | for (PHRASE_VECTOR::const_iterator it = m_pCurrentDialog->PhraseList().begin(); it != m_pCurrentDialog->PhraseList().end(); it++) |
| 155 | { |
| 156 | CPhrase* phrase = *it; |
| 157 | AddQuestion(phrase->GetText(), phrase->GetID(), number); |
| 158 | } |
| 159 | } |
| 160 | else |
| 161 | UpdateQuestions(); |
| 162 | } |
| 163 | } |
| 164 | m_bNeedToUpdateQuestions = false; |
| 165 | } |
| 166 | |
| 167 | ////////////////////////////////////////////////////////////////////////// |
| 168 |
nothing calls this directly
no test coverage detected