Merge pull request #13 from asdflj/master

keep search text
This commit is contained in:
Martin Robertz authored and GitHub committed 2022-09-13 13:26:05 +02:00
commit 057c4fecc3
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())