Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/cpp/sweetloader
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,15 @@ class MinecraftActivity : MainActivity(), PojavControlsHost {
private fun startInbuiltModServices() {
overlayManager = InbuiltOverlayManager(this)
overlayManager?.showEnabledOverlays()
// The in-game Mod Menu is drawn natively on the game's GL context; the controller builds its
// catalogue and forwards input into it for as long as the session lives.
org.chimeramc.client.launcher.core.mods.inbuilt.overlay.InGameMenuController.install(this)
}

private fun stopInbuiltModServices() {
overlayManager?.hideAllOverlays()
overlayManager = null
org.chimeramc.client.launcher.core.mods.inbuilt.overlay.InGameMenuController.release(this)
}

override fun onNewIntent(intent: Intent) {
Expand Down Expand Up @@ -575,6 +579,13 @@ class MinecraftActivity : MainActivity(), PojavControlsHost {
}

override fun dispatchTouchEvent(event: MotionEvent): Boolean {
// An open Mod Menu owns every touch: it is a full-screen overlay drawn into the game's
// back buffer, so the game must not also receive the tap.
if (org.chimeramc.client.launcher.core.mods.inbuilt.overlay.InGameMenuController.getInstance()
?.handleTouch(event) == true) {
return true
}

if (shouldConsumeMouseMotion(event)) {
return true
}
Expand Down Expand Up @@ -861,6 +872,10 @@ class MinecraftActivity : MainActivity(), PojavControlsHost {
flushLookDelta()
super.tick()
overlayManager?.tick()
// Apply whatever the native menu raised this frame (a toggle, a config change, a favourite)
// on the main thread, where the launcher's own module changes also happen.
org.chimeramc.client.launcher.core.mods.inbuilt.overlay.InGameMenuController.getInstance()
?.drainAndApply()
}

override fun getDataDir(): File {
Expand Down
Loading
Loading