feat(console): reset highlight when console is closed

This commit is contained in:
fallenoak 2025-10-02 21:33:31 -05:00
parent d30d5c49dc
commit 669e093ef2
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 9 additions and 2 deletions

View File

@ -4,6 +4,8 @@
#include "event/Event.hpp" #include "event/Event.hpp"
#include <cstdint> #include <cstdint>
void ResetHighlight();
namespace { namespace {
int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) { int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
@ -27,7 +29,7 @@ int32_t OnKeyDown(const EVENT_DATA_KEY* data, void* param) {
// Reset the highlight when toggled off // Reset the highlight when toggled off
if (!ConsoleGetActive()) { if (!ConsoleGetActive()) {
// TODO ResetHighlight(); ResetHighlight();
} }
return 0; return 0;
@ -37,7 +39,8 @@ int32_t OnKeyDown(const EVENT_DATA_KEY* data, void* param) {
return 1; return 1;
} }
// TODO // TODO handle other keys
return 0; return 0;
} }

View File

@ -87,6 +87,10 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
// TODO // TODO
} }
void ResetHighlight() {
// TODO
}
void ConsoleScreenAnimate(float elapsedSec) { void ConsoleScreenAnimate(float elapsedSec) {
auto finalPos = ConsoleGetActive() ? std::min(1.0f - s_consoleHeight, 1.0f) : 1.0f; auto finalPos = ConsoleGetActive() ? std::min(1.0f - s_consoleHeight, 1.0f) : 1.0f;
finalPos = std::max(finalPos, 0.0f); finalPos = std::max(finalPos, 0.0f);