| 262 | } |
| 263 | |
| 264 | void InGameConsole::Update() |
| 265 | { |
| 266 | _consoleTopLeft = { 0, 0 }; |
| 267 | _consoleBottomRight = { ContextGetWidth(), 322 }; |
| 268 | |
| 269 | if (_isOpen) |
| 270 | { |
| 271 | // When scrolling the map, the console pixels get copied... therefore invalidate the screen |
| 272 | WindowBase* mainWindow = WindowGetMain(); |
| 273 | if (mainWindow != nullptr) |
| 274 | { |
| 275 | Viewport* mainViewport = WindowGetViewport(mainWindow); |
| 276 | if (mainViewport != nullptr) |
| 277 | { |
| 278 | if (_lastMainViewport != mainViewport->viewPos) |
| 279 | { |
| 280 | _lastMainViewport = mainViewport->viewPos; |
| 281 | |
| 282 | GfxInvalidateScreen(); |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | if (_isCommandAwaitingCompletion && !IsExecuting()) |
| 289 | { |
| 290 | WritePrompt(); |
| 291 | _isCommandAwaitingCompletion = false; |
| 292 | } |
| 293 | |
| 294 | // Flash the caret |
| 295 | _consoleCaretTicks = (_consoleCaretTicks + 1) % 30; |
| 296 | } |
| 297 | |
| 298 | void InGameConsole::Draw(RenderTarget& rt) const |
| 299 | { |
no test coverage detected