| 185 | } |
| 186 | |
| 187 | void UI::ConsoleBox::increaseSelectionIndex(int amount) |
| 188 | { |
| 189 | const auto& suggestionsList = m_Engine.getConsole().getSuggestions(); |
| 190 | // check if suggestions for last token are empty |
| 191 | if (suggestionsList.empty() || suggestionsList.back().empty()) |
| 192 | return; |
| 193 | |
| 194 | int suggestionCount = static_cast<int>(suggestionsList.back().size()); |
| 195 | auto newIndex = Utils::mod(m_CurrentlySelected + amount, suggestionCount); |
| 196 | setSelectionIndex(newIndex); |
| 197 | } |
| 198 | |
| 199 | void UI::ConsoleBox::setSelectionIndex(int newIndex) |
| 200 | { |