Compare commits

...

2 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
837a8eff41
Merge c12a79d6e6 into f1b8f495b6 2026-01-25 19:54:13 -05:00
Tristan Cormier
c12a79d6e6 feat(console): add CONSOLELINE::Backspace 2025-12-08 09:17:54 -05:00
2 changed files with 21 additions and 0 deletions

View File

@ -84,6 +84,26 @@ CONSOLELINE::~CONSOLELINE() {
} }
} }
void CONSOLELINE::Backspace() {
if (this->inputpos > this->inputstart) {
if (this->chars <= this->inputpos) {
this->buffer[this->inputpos - 1] = '\0';
}
else {
memcpy(
&this->buffer[this->inputpos - 1],
&this->buffer[this->inputpos],
this->chars - this->inputpos + 1
);
}
this->inputpos--;
this->chars--;
SetInputString(this->buffer);
}
}
void DrawBackground() { void DrawBackground() {
uint16_t indices[] = { uint16_t indices[] = {
0, 1, 2, 3 0, 1, 2, 3

View File

@ -19,6 +19,7 @@ class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
// Member functions // Member functions
~CONSOLELINE(); ~CONSOLELINE();
void Backspace();
}; };
void ConsoleScreenAnimate(float elapsedSec); void ConsoleScreenAnimate(float elapsedSec);