commit 721106ae2bdb77e5aaa082dd8b8ec7779ccdba2e
parent a5b917b2f7ac4c60e6e3d38aabeb7601bec5acbd
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Thu, 24 Oct 2024 22:57:45 +0200
Merge branch 'refs/heads/dev' into dev-gh
Diffstat:
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/ui/setup/screens/impl/MappingsScreen.kt b/app/src/main/kotlin/me/rhunk/snapenhance/ui/setup/screens/impl/MappingsScreen.kt
@@ -10,6 +10,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
import me.rhunk.snapenhance.ui.setup.screens.SetupScreen
import me.rhunk.snapenhance.ui.util.AlertDialogs
@@ -51,7 +52,9 @@ class MappingsScreen : SetupScreen() {
return@launch
}
- goNext()
+ withContext(Dispatchers.Main) {
+ goNext()
+ }
}.onFailure {
isGenerating = false
infoText = context.translation["setup.mappings.generate_failure"] + "\n\n" + it.message
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/SendOverride.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/messaging/SendOverride.kt
@@ -63,9 +63,17 @@ class SendOverride : Feature("Send Override") {
}
// set back the original snap duration
- remove(2)
snapDocPlayback.getByteArray(2)?.let {
+ val originalHasSound = firstOrNull(2)?.toReader()?.getVarInt(5)
+ remove(2)
addBuffer(2, it)
+
+ originalHasSound?.let { hasSound ->
+ edit(2) {
+ remove(5)
+ addVarInt(5, hasSound)
+ }
+ }
}
}