MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / scrollCommandHistoryPositionUp

Method scrollCommandHistoryPositionUp

source/modes/ConsoleInterface.cpp:192–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192boost::optional<const ConsoleInterface::String_t&> ConsoleInterface::scrollCommandHistoryPositionUp(const ConsoleInterface::String_t& currentPrompt)
193{
194 //If the list is empty, or we are at the top, return none
195 if(mCommandHistoryBuffer.empty() || mHistoryPos == mCommandHistoryBuffer.begin())
196 {
197 return boost::none;
198 }
199 else
200 {
201 if(!isInHistory())
202 {
203 mTemporaryCommandString = currentPrompt;
204 }
205 --mHistoryPos;
206 return boost::optional<const String_t&>(*mHistoryPos);
207 }
208}
209
210boost::optional<const ConsoleInterface::String_t&> ConsoleInterface::scrollCommandHistoryPositionDown()
211{

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.80
keyPressedMethod · 0.80

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64