From d618c8e1e1ddb0b64262cbe5e589442fe46477f2 Mon Sep 17 00:00:00 2001 From: def Date: Thu, 19 Nov 2020 18:10:58 +0100 Subject: [PATCH] Fix assets menu Multiple assets would be highlighted Bug introduced in https://github.com/ddnet/ddnet/pull/3304 --- src/game/client/components/menus_demo.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 66f45c3a9..e0df0c4cb 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -569,23 +569,11 @@ void CMenus::UiDoListboxStart(const void *pID, const CUIRect *pRect, float RowHe gs_ListBoxScrollValue += Num == 1 ? 0.1f : 3.0f / Num; } - // TODO: Still have to press twice after updating search, why? if(gs_ListBoxScrollValue < 0.0f) gs_ListBoxScrollValue = 0.0f; if(gs_ListBoxScrollValue > 1.0f) gs_ListBoxScrollValue = 1.0f; - if(gs_ListBoxSelectedIndex < 0) - { - gs_ListBoxSelectedIndex = 0; - gs_ListBoxNewSelected = 0; - } - if(gs_ListBoxSelectedIndex >= NumItems) - { - gs_ListBoxSelectedIndex = NumItems - 1; - gs_ListBoxNewSelected = NumItems - 1; - } - Scroll.HMargin(5.0f, &Scroll); gs_ListBoxScrollValue = DoScrollbarV(pID, &Scroll, gs_ListBoxScrollValue);