Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Android library changes in Godot 4.4-beta4 #266

Merged
merged 1 commit into from
Feb 19, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ package org.godotengine.openxr.vendors

import android.os.Bundle
import android.util.Log
import androidx.annotation.CallSuper
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import org.godotengine.godot.GodotActivity
import org.godotengine.godot.BuildConfig
Expand Down Expand Up @@ -61,10 +60,32 @@ class GodotPanelApp : GodotActivity() {
super.onCreate(savedInstanceState)
}

@CallSuper
protected override fun updateCommandLineParams(args: Array<String>) {
// Force XR to be turned off and discard other params.
super.updateCommandLineParams(arrayOf("--xr_mode_regular", "--xr-mode", "off"))
override fun getCommandLine(): MutableList<String> {
val oldCmdline = super.getCommandLine()

// Remove any existing command-line arguments setting the XR mode.
val newCmdline = mutableListOf<String>()
var skipNext = false
for (arg in oldCmdline) {
if (skipNext) {
skipNext = false
continue
}

when (arg) {
"--xr_mode_regular", "--xr_mode_openxr" -> continue
"--xr-mode" -> {
skipNext = true
continue
}
else -> newCmdline.add(arg)
}
}

// Add new arguments to force XR to be turned off.
newCmdline.addAll(listOf("--xr_mode_regular", "--xr-mode", "off"))

return newCmdline
}

override fun supportsFeature(featureTag: String): Boolean {
Expand Down
Loading