| 347 | */ |
| 348 | |
| 349 | void Console::RefreshHistory() |
| 350 | { |
| 351 | m_historyDrawer.Clear(); |
| 352 | auto it = m_historyLines.end(); |
| 353 | if (m_historyLines.size() > m_maxHistoryLines) |
| 354 | it -= m_maxHistoryLines; |
| 355 | else |
| 356 | it = m_historyLines.begin(); |
| 357 | |
| 358 | for (unsigned int i = 0; i < m_maxHistoryLines; ++i) |
| 359 | { |
| 360 | if (m_maxHistoryLines - i <= m_historyLines.size() && it != m_historyLines.end()) |
| 361 | { |
| 362 | m_historyDrawer.AppendText(it->text); |
| 363 | ++it; |
| 364 | } |
| 365 | |
| 366 | m_historyDrawer.AppendText(Nz::String('\n')); |
| 367 | } |
| 368 | |
| 369 | m_historyTextSprite->Update(m_historyDrawer); |
| 370 | } |
| 371 | } |