1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 01:04:50 +01:00

Close #12409: Refactor CONSOLE_INPUT to use strong enum (#13052)

This commit is contained in:
Bryan DiLaura
2020-10-01 03:31:03 -06:00
committed by GitHub
parent afbc983a94
commit 56e8cc77c6
4 changed files with 24 additions and 24 deletions

View File

@@ -39,15 +39,15 @@ void InGameConsole::WritePrompt()
InteractiveConsole::WriteLine("> ");
}
void InGameConsole::Input(CONSOLE_INPUT input)
void InGameConsole::Input(ConsoleInput input)
{
switch (input)
{
case CONSOLE_INPUT_LINE_CLEAR:
case ConsoleInput::LineClear:
ClearInput();
RefreshCaret();
break;
case CONSOLE_INPUT_LINE_EXECUTE:
case ConsoleInput::LineExecute:
if (_consoleCurrentLine[0] != '\0')
{
HistoryAdd(_consoleCurrentLine);
@@ -62,7 +62,7 @@ void InGameConsole::Input(CONSOLE_INPUT input)
}
ScrollToEnd();
break;
case CONSOLE_INPUT_HISTORY_PREVIOUS:
case ConsoleInput::HistoryPrevious:
if (_consoleHistoryIndex > 0)
{
_consoleHistoryIndex--;
@@ -72,7 +72,7 @@ void InGameConsole::Input(CONSOLE_INPUT input)
_consoleTextInputSession->Length = utf8_length(_consoleTextInputSession->Buffer);
_consoleTextInputSession->SelectionStart = strlen(_consoleCurrentLine);
break;
case CONSOLE_INPUT_HISTORY_NEXT:
case ConsoleInput::HistoryNext:
if (_consoleHistoryIndex < _consoleHistoryCount - 1)
{
_consoleHistoryIndex++;
@@ -87,13 +87,13 @@ void InGameConsole::Input(CONSOLE_INPUT input)
ClearInput();
}
break;
case CONSOLE_INPUT_SCROLL_PREVIOUS:
case ConsoleInput::ScrollPrevious:
{
int32_t scrollAmt = GetNumVisibleLines() - 1;
Scroll(scrollAmt);
break;
}
case CONSOLE_INPUT_SCROLL_NEXT:
case ConsoleInput::ScrollNext:
{
int32_t scrollAmt = GetNumVisibleLines() - 1;
Scroll(-scrollAmt);