| 162 | } |
| 163 | |
| 164 | std::optional<std::string> Console::browseHistory(bool upOrDown) |
| 165 | { |
| 166 | if (upOrDown) |
| 167 | { |
| 168 | if (mHistoryIndex + 1 < (int32_t)mHistory.size()) |
| 169 | { |
| 170 | mHistoryIndex++; |
| 171 | return mHistory[mHistory.size() - mHistoryIndex - 1]; |
| 172 | } |
| 173 | } |
| 174 | else |
| 175 | { |
| 176 | if (mHistoryIndex >= 0) |
| 177 | { |
| 178 | mHistoryIndex--; |
| 179 | return mHistoryIndex >= 0 ? mHistory[mHistory.size() - mHistoryIndex - 1] : ""; |
| 180 | } |
| 181 | } |
| 182 | return {}; |
| 183 | } |
| 184 | |
| 185 | int Console::inputTextCallback(ImGuiInputTextCallbackData* data) |
| 186 | { |