MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / increaseSelectionIndex

Method increaseSelectionIndex

src/ui/ConsoleBox.cpp:187–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void 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
199void UI::ConsoleBox::setSelectionIndex(int newIndex)
200{

Callers 1

onKeyDownMethod · 0.80

Calls 4

modFunction · 0.85
backMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected