Always allow typing replay search query, similar to addon search

This commit is contained in:
indev committed 2024-08-16 01:58:33 +03:00
1 parent 6fc2681b34
commit 1959edf357
1 file changed
+7 -21
+7 -21
View File
@@ -6758,7 +6758,6 @@ I_mutex replayquerymutex;
#define MAXREPLAYQUERY 40
char replayqueryinput[MAXREPLAYQUERY+1]; // The input typed
size_t replayquerypos = 0; // Position in input window
boolean replayqueryopen = false; // Is query window open?
size_t replayqueryfound = 0; // Number of checked replay entries
size_t replayquerycheck = 0; // Index of next replay entry to check in demolist_all
@@ -6818,7 +6817,6 @@ static void ResetReplayQuery(void)
{
memset(replayqueryinput, 0, MAXREPLAYQUERY);
replayquerypos = 0;
replayqueryopen = false;
replayqueryfound = 0;
replayquerycheck = 0;
@@ -6965,16 +6963,8 @@ void M_ReplayHut(INT32 choice)
static boolean M_HandleReplayHutQuery(INT32 choice)
{
if (!replayqueryopen)
return false;
switch (choice)
{
case KEY_ENTER:
case KEY_ESCAPE:
replayqueryopen = false;
break;
case KEY_BACKSPACE:
if (replayquerypos == 0)
break;
@@ -6988,7 +6978,7 @@ static boolean M_HandleReplayHutQuery(INT32 choice)
dir_on[menudepthleft] = 0;
PrepReplayList(false);
break;
return true;
default:
if (choice < 32 || choice > 127)
@@ -7006,9 +6996,11 @@ static boolean M_HandleReplayHutQuery(INT32 choice)
dir_on[menudepthleft] = 0;
PrepReplayList(false);
}
return true;
}
return true;
return false;
}
static void M_HandleReplayHutList(INT32 choice)
@@ -7018,12 +7010,6 @@ static void M_HandleReplayHutList(INT32 choice)
switch (choice)
{
case '/':
case 'f':
case 'F':
replayqueryopen = true;
break;
case KEY_UPARROW:
if (!replaynamesloaded)
return;
@@ -7442,13 +7428,13 @@ static void M_DrawReplayHut(void)
// Draw search query
M_DrawTextBoxFlags(x, 200 - 22, MAXREPLAYQUERY, 1, V_SNAPTOBOTTOM);
if (replayqueryopen || replayquerypos)
if (replayquerypos)
V_DrawString(x + 8, 200 - 14, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, replayqueryinput);
else
V_DrawString(x + 8, 200 - 14, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, "\x86Press '/' or 'f' to search replays");
V_DrawString(x + 8, 200 - 14, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, "\x86Type to search...");
// draw text cursor for name
if (replayqueryopen && skullAnimCounter < 4) // blink cursor
if (replayquerypos && skullAnimCounter < 4) // blink cursor
V_DrawCharacter(x + 8 + V_StringWidth(replayqueryinput, V_ALLOWLOWERCASE), 200 - 14, '_'|V_SNAPTOBOTTOM, false);
if (replaynamesloaded && replayquerycheck < sizedirmenu)