Fix disappearing bind button when renaming search

GuiAdvancedMemoryCard: When the rename field is used, it filters out
every P2P tunnel that does not match the name, including the currently
selected P2P tunnel, from an internal list. This internal list is used
to determine whether the bind button should be shown, and if there is
no selected P2P tunnel, they are not shown. Since we removed the P2P
tunnel from the internal list, they are not shown. :(

Fix by using the master list instead of the filtered list.
This commit is contained in:
Firenoo committed 2023-02-19 18:46:37 -08:00
1 parent 74422c75f6
commit 9dad0d79e4
1 file changed
+1 -1
@@ -44,7 +44,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound {
private var sortedInfo = infos.toList()
private var selectedInfo: InfoWrapper?
get() = sortedInfo.find { it.index == selectedIndex }
get() = infos.find { it.index == selectedIndex }
set(value) {
selectedIndex = value?.index ?: -1
}