From 9dad0d79e461414fb4323d75907d42c2c94dbfdb Mon Sep 17 00:00:00 2001 From: Firenoo <49818773+firenoo@users.noreply.github.com> Date: Sun, 19 Feb 2023 18:46:37 -0800 Subject: [PATCH] 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. --- .../projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt index fc52421..d91b42e 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt @@ -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 }