Prevent clicking on racer scroll buttons when hidden (#263)

* Prevent clicking on racer scroll buttons when hidden (#262)

Fix a bug where racers could be scrolled in other view modes, messing up
the screen.

Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
This commit is contained in:
Artur Rojek 2022-12-11 23:41:54 +01:00 committed by GitHub
parent 8070edc9ec
commit f4eb9a8607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -1282,6 +1282,12 @@ int TryToMoveToArrows(int* pCurrent_choice, int* pCurrent_mode) {
int UpOpponent(int* pCurrent_choice, int* pCurrent_mode) {
LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode);
#if defined(DETHRACE_FIX_BUGS)
// fixes bug where racers could be scrolled in other race menu modes
if (gProgram_state.view_type != eVT_Opponents) {
return 0;
}
#endif
AddToFlicQueue(gStart_interface_spec->pushed_flics[5].flic_index,
gStart_interface_spec->pushed_flics[5].x[gGraf_data_index],
gStart_interface_spec->pushed_flics[5].y[gGraf_data_index],
@ -1310,6 +1316,12 @@ int UpOpponent(int* pCurrent_choice, int* pCurrent_mode) {
int DownOpponent(int* pCurrent_choice, int* pCurrent_mode) {
LOG_TRACE("(%p, %p)", pCurrent_choice, pCurrent_mode);
#if defined(DETHRACE_FIX_BUGS)
// fixes bug where racers could be scrolled in other race menu modes
if (gProgram_state.view_type != eVT_Opponents) {
return 0;
}
#endif
AddToFlicQueue(gStart_interface_spec->pushed_flics[6].flic_index,
gStart_interface_spec->pushed_flics[6].x[gGraf_data_index],
gStart_interface_spec->pushed_flics[6].y[gGraf_data_index],