keep search text

This commit is contained in:
asdflj committed 2022-09-13 11:13:41 +08:00
1 parent 39a9a4a66b
commit 96d89a2d2a
2 files changed
+4 -1

No files matched your search

@@ -6,7 +6,7 @@ object ClientCache {
val positions = mutableListOf<Pair<List<Int?>, EnumFacing>>()
var selectedPosition: List<Int?>? = null
var selectedFacing: EnumFacing? = null
var searchText: String= ""
fun clear() {
positions.clear()
selectedPosition = null
@@ -88,6 +88,8 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound {
widgetDevices[i].x = guiLeft + tableX
widgetDevices[i].y = guiTop + tableY + 33 * i
}
searchBar.text = ClientCache.searchText
reGenInfoFromText()
}
private fun reGenInfoFromText() {
@@ -158,6 +160,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound {
}
override fun onGuiClosed() {
ClientCache.searchText = searchBar.text
saveP2PChannel()
syncMemoryInfo()
ModNetwork.channel.sendToServer(C2SCloseGui())